
Recherche avancée
Autres articles (74)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
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 (...)
Sur d’autres sites (9056)
-
Organic Traffic : What It Is and How to Increase It
19 septembre 2023, par Erin — Analytics Tips -
Why doesn't the ffmpeg output display the stream in the browser ? [closed]
10 mai 2024, par TebyyWhy is it that when I create a livestream in Python using ffmpeg, and then I open the browser and visit the page, the page keeps loading continuously, and in PyCharm logs, I see binary data ? There are no errors displayed, and the code seems correct to me. I even tried saving to a file for testing purposes, and when I play the video, everything works fine. Does anyone know what might be wrong here ?


Code :


def generate_frames():
 cap = cv2.VideoCapture(os.path.normpath(app_root_dir().joinpath("data/temp", "video-979257305707693982.mp4")))
 while cap.isOpened():
 ret, frame = cap.read()
 if not ret:
 break

 yield frame


@app.route('/video_feed')
def video_feed():
 ffmpeg_command = [
 'ffmpeg', '-f', 'rawvideo', '-pix_fmt', 'bgr24',
 '-s:v', '1920x1080', '-r', '60',
 '-i', '-', '-vf', 'setpts=2.5*PTS', # Video Speed
 '-c:v', 'libvpx-vp9', '-g', '60', '-keyint_min', '60',
 '-b:v', '6M', '-minrate', '4M', '-maxrate', '12M', '-bufsize', '8M',
 '-crf', '0', '-deadline', 'realtime', '-tune', 'psnr', '-quality', 'good',
 '-tile-columns', '6', '-threads', '8', '-lag-in-frames', '16',
 '-f', 'webm', '-'
 ]
 ffmpeg_process = subprocess.Popen(ffmpeg_command, stdin=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=-1)
 frames_generator = generate_frames()
 for frame in frames_generator:
 ffmpeg_process.stdin.write(frame)
 ffmpeg_process.stdin.flush()

 ffmpeg_process.stdin.close()
 ffmpeg_process.wait()

 def generate_video_stream(process):
 startTime = time.time()
 buffer = []
 sentBurst = False
 for chunk in iter(lambda: process.stderr.read(4096), b''):
 buffer.append(chunk)

 # Minimum buffer time, 3 seconds
 if sentBurst is False and time.time() > startTime + 3 and len(buffer) > 0:
 sentBurst = True
 for i in range(0, len(buffer) - 2):
 print("Send initial burst #", i)
 yield buffer.pop(0)

 elif time.time() > startTime + 3 and len(buffer) > 0:
 yield buffer.pop(0)

 process.poll()
 if isinstance(process.returncode, int):
 if process.returncode > 0:
 print('FFmpeg Error', process.returncode)

 break

 return Response(stream_with_context(generate_video_stream(ffmpeg_process)), mimetype='video/webm', content_type="video/webm; codecs=vp9", headers=Headers([("Connection", "close")]))




-
SOLVED - Compiling FFMPEG on Windows with Cywin and NDK r5
19 mai 2012, par protectedmemberThis isn't a question - it's an answer for alll of you who have been facing the same problems as I have. I've been trying to compile this thing for a while now and I know of the numerous posts floating around the internet offering help. I have read and tried most of the suggestions and wanted to colate my success into this single post for others to benefit from.
Since I don't have a blog, I thought it wouldn't hurt to post on here instead.
I have managed to compile FFMPEG 0.10.3 (Freedom) on Windows 7 (32 bit) using NDK r5 and Cygwin. The steps :
1 - Download/install Cygwin in the root of your C drive. I'm not going to give instructions on this, it's simple enough and there are plenty of tutorials on this.
2 - Download NDK r5 from here and extract to the root of your C drive.
3 - Download FFMPEG 0.10.3 from here and extract to the root of your C drive.
4 - Open the file 'configure' in the root of the FFMPEG directory in a text editor.
5 - Comment out lines 2073, 2074 and 2075.
6 - Below 2075, add the following line :
TMPDIR=c :/cygwin/tmp
7 - Download this script (thankyou roman10) and place it inside your FFMPEG root directory. Rename the file to
build_android.sh
8 - Open the script in a text editor and edit line 17 to read
c :/android-ndk-r5
9 - Click start > run and type "bash" (without the speech marks) and press enter.
10 - Type the following and press enter :
cd /cygdrive/c/ffmpeg-0.10.3
11 - Type the following and press enter :
./build_android.sh
12 - Sit back and wait... libffmpeg.so will soon appear in your "c :\ffmpeg-0.10.3\android\" directory (where is defined in the bottom of the script from roman10's blog). The default architecture is armv7-a.
The script from roman10's blog will actually compile quite a large shared object (.so) file. The compiler flags can be adjusted to suit your needs in the script from roman10's blog.
I hope this helps,
P.