
Recherche avancée
Médias (91)
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Lights in the Sky
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Head Down
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Echoplex
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Discipline
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Letting You
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (111)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (12706)
-
Input FFMPEG subprocess to FFMPEG RTMP stream in python ?
12 mai 2021, par GuisoI managed to stream frames of a video to the RTMP server but I also want to stream the audio - for that I can't use the rawvideo format and now I don't know how many bytes are required for the ffmpeg video to send to the ffmpeg stream.


If there is an easier way to do this I would much prefer it, I tried my best in making comments so that the code is understandable.


WIDTH = 1152
HEIGHT = 720
RTMP = ""
#Returns frame of a video
def read_frame(process1, width, height):
 frame_size = width * height * 3 #<--- I don't know how many bytes should I ask for.
 in_bytes = process1.stdout.read(frame_size)
 if len(in_bytes) == 0:
 return []
 else:
 assert len(in_bytes) == frame_size
 frame = (
 np
 .frombuffer(in_bytes, np.uint8)
 .reshape([height, width, 3])
 )
 return frame


def getVideoOutput(in_filename):
 args = (
 ffmpeg
 .input(in_filename # Path to file
 ,loglevel="quiet"#Don't show ffmpegs logs
 )
 .output('pipe:', format='flv')#Outputs a pipe
 .compile()
 )
 return subprocess.Popen(args, stdout=subprocess.PIPE)

#Start stream
def startStream(width, height):
 args = (
 ffmpeg
 .input('pipe:', #Sats to ffmpeg that the input is a stream
 format='flv'#Format of the video
 ,r="30"#Sets average fps
 ,s='{}x{}'.format(width, height)#Set the width and height of the input
 ,loglevel="quiet" #Don't show ffmpegs logs 
 )
 .output(RTMP,vcodec="libx264",preset="ultrafast",acodec="aac",format="flv")
 .overwrite_output()
 .compile()
 )
 return subprocess.Popen(args, stdin=subprocess.PIPE)

#Writes frame to the stream
def write_frame(process2, frame):
 process2.stdin.write(
 frame
 .astype(np.uint8)
 .tobytes()
 )

#Gets frames from multiple videos
def getBytes():
 for video in os.listdir(".\\Videos"):#Loops through videos in the videos folder 
 #while True:
 #video = os.listdir(".\\Videos")[0]
 videoPath = os.path.join(pathlib.Path().absolute(),"Videos",video)
 pipe = getVideoOutput(videoPath) #Get a stream of bytes from the video
 while True:
 frame = read_frame(pipe,WIDTH,HEIGHT)#Get a frame
 if frame == []:#If the video ends Go to the next one
 break
 yield frame#return the frame


stream = startStream(WIDTH,HEIGHT)#Starts stream to server and outputs a subprocess
FrameGenerator = getBytes()#Start generator

while True:
 write_frame(stream,next(FrameGenerator))#infinite loop writes to the stream a frame



-
Getting error "WebAssembly.Memory() : could not allocate memory" when running ffmpeg.wasm on android chrome browser
27 juin 2022, par Ravi KunduError in detail :


WebAssembly.Memory(): could not allocate memory
at https://*******/ffmpeg-core.js:22:82
at https://*******/ffmpeg.min.js:1:6506
at f (https://*******/ffmpeg.min.js:1:11322)
at Generator._invoke (https://*******/ffmpeg.min.js:1:11110)
at Generator.next (https://*******/ffmpeg.min.js:1:11747)
at i (https://*******/ffmpeg.min.js:1:4295)
at c (https://*******/ffmpeg.min.js:1:4498)



Code for ffmpeg :


const downloadWithFFMPEG = async () =>{
 const sourceBuffer = await fetch(recordingURL).then(r => r.arrayBuffer());
 await ffmpeg.load();
 await ffmpeg.FS(
 "writeFile",
 "input.webm",
 new Uint8Array(sourceBuffer, 0, sourceBuffer.byteLength)
 );
 await ffmpeg.run("-i", "input.webm", "-c", "copy", "output.mp4")
 const output = ffmpeg.FS("readFile", "output.mp4");
 var link = document.createElement('a')
 link.href = URL.createObjectURL(new Blob([output.buffer], { type: 'video/mp4;codecs=H264' }));
 link.download = this.data;
 link.click();
 recording = false;
}



Brief about problem :
The error only comes for android chrome browser. The same code works fine on pc/laptop chrome.
Have also enabled Webassembly-thread on chrome ://flags for android browser as someone suggested me to do it but still same error. Can someone help me ?


-
Rolling screen capture with ffmpeg on windows
11 décembre 2020, par gap210I have the following code to capture a video stream from my webcam. I use ffmpeg to write to named windows pipe, then read it with python and display with opencv. The thing is that the opencv stream is 'rolling' as shown here https://www.youtube.com/watch?v=H78TRo3DZIo


If I capture the output to a video instead of a pipe, with the command :


ffmpeg -f dshow -video_size 1920x1080 -framerate 60 -i video="USB Video" -c:v copy out.avi


everything looks fine. What should I change to achieve the desired effect ? (non-rolling stream)


My code below :


import cv2
import time
import subprocess
import numpy as np

w, h = 800, 600

# Get frame generator
gen = ffmpegGrab()

# Get start time
start = time.time()

# Read video frames from ffmpeg in loop
nFrames = 0
cmd = 'C:/Users/......./Downloads/ffmpeg-4.3.1-2020-11-19-full_build/bin/ffmpeg.exe -f dshow -framerate 60 -video_size 800x600 -i video="USB Video" -pix_fmt bgr24 -vcodec rawvideo -f image2pipe -'

proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, bufsize=10**9)
while True:
 # Read next frame from ffmpeg

 frame = proc.stdout.read(w * h * 3)
 frame = np.frombuffer(frame, dtype=np.uint8).reshape((h, w, 3))
 cv2.imshow('screenshot', frame)

 if cv2.waitKey(1) == ord("q"):
 break

 fps = nFrames / (time.time() - start)
 print(f'FPS: {fps}')

cv2.destroyAllWindows()