
Recherche avancée
Autres articles (31)
-
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 (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (6522)
-
Video concatenation using ffmpeg. Output video length is longer than inputs length
28 décembre 2022, par Rostyslav MosorovI have a problem with video mp4 concatenation using ffmpeg. I have two the same videos and I want to concatenate them. I created file inputs.txt and then used command :


ffmpeg -f concat -i inputs.txt -c copy mergedVideo.mp4


Output :


ffmpeg -f concat -i inputs.txt -c copy mergedVideo.mp4
ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
 built with clang version 12.0.1
 configuration: --prefix=/Users/runner/miniforge3/conda-bld/ffmpeg_1649114094397/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl --cc=arm64-apple-darwin20.0.0-clang --disable-doc --disable-openssl --enable-demuxer=dash --enable-gnutls --enable-gpl --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-neon --enable-libx264 --enable-libx265 --enable-libaom --enable-libsvtav1 --enable-libxml2 --enable-libvpx --enable-pic --enable-pthreads --enable-shared --disable-static --enable-version3 --enable-zlib --enable-libmp3lame --pkg-config=/Users/runner/miniforge3/conda-bld/ffmpeg_1649114094397/_build_env/bin/pkg-config --enable-cross-compile --arch=arm64 --target-os=darwin --cross-prefix=arm64-apple-darwin20.0.0- --host-cc=/Users/runner/miniforge3/conda-bld/ffmpeg_1649114094397/_build_env/bin/x86_64-apple-darwin13.4.0-clang
 libavutil 57. 17.100 / 57. 17.100
 libavcodec 59. 18.100 / 59. 18.100
 libavformat 59. 16.100 / 59. 16.100
 libavdevice 59. 4.100 / 59. 4.100
 libavfilter 8. 24.100 / 8. 24.100
 libswscale 6. 4.100 / 6. 4.100
 libswresample 4. 3.100 / 4. 3.100
 libpostproc 56. 3.100 / 56. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1561044a0] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'inputs.txt':
 Duration: N/A, start: -0.064000, bitrate: 1424 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1355 kb/s, 50 fps, 50 tbr, 12800 tbn
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 68 kb/s
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
File 'mergedVideo.mp4' already exists. Overwrite? [y/N] y
Output #0, mp4, to 'mergedVideo.mp4':
 Metadata:
 encoder : Lavf59.16.100
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 1355 kb/s, 50 fps, 50 tbr, 12800 tbn
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 68 kb/s
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=-1.0 size= 0kB time=00:00:00.06 bitrate= 6.0k[mov,mp4,m4a,3gp,3g2,mj2 @ 0x154f28b20] Auto-inserting h264_mp4toannexb bitstream filter
frame= 166 fps=0.0 q=-1.0 Lsize= 583kB time=00:00:03.39 bitrate=1407.4kbits/s speed= 179x 
video:550kB audio:29kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.737394%



Unfortunately the result is different then I expected :

movies comparison

The output is longer than the length of two inputs. Any thoughts ?


Also I tried using different commands :


ffmpeg -f concat -i inputs.txt -c copy mergedVideo.mp4



or set the framerate :


ffmpeg -r 50 -f concat -i inputs.txt -c copy mergedVideo.mp4



What is also weird that I have the same problem when using moviepy library.


from moviepy.editor import VideoFileClip, concatenate_videoclips
videos = [VideoFileClip("0.mp4"), VideoFileClip("0.mp4")]
concatenate_videoclips(videos).write_videofile('mergedVideo.mp4')



Update
ffprobe command for output file


ffprobe -v error -select_streams v -show_entries stream=codec_name,time_base,start_pts,start_time,duration -of default=noprint_wrappers=1 mergedVideo.mp4 
codec_name=h264
time_base=1/12800
start_pts=0
start_time=0.000000
duration=3.380000



For input :


ffprobe -v error -select_streams v -show_entries stream=codec_name,time_base,start_pts,start_time,duration -of default=noprint_wrappers=1 0.mp4 
codec_name=h264
time_base=1/12800
start_pts=0
start_time=0.000000
duration=1.660000



The duration supposed to be 2*1.66 = 3.32 and but it's 3.38.


Content of the inputs.txt


file '0.mp4'
file '0.mp4'



-
I want to record my computer screen and stream it to other computer browser over same network
25 décembre 2022, par Abdullah QasimI am using Flask for this purpose. I wanted to create a rtmp server that stream the screen in web browser.


My Python Code is :


import os
import subprocess

from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def index():
 return render_template('index.html')

if __name__ == '__main__':
 # Start the RTMP server in a separate process
 subprocess.Popen(['ffmpeg', '-f', 'gdigrab', '-framerate', '25', '-probesize', '100000000000', '-i', 'desktop', '-vcodec', 'libx264', '-preset', 'ultrafast', '-tune', 'zerolatency', '-f', 'flv', 'rtmp://localhost:5000/live/stream_name'])

 # Start the Flask app
 app.run()




My HTML code is :



 
 
 
 <code class="echappe-js"><script src="https://unpkg.com/video.js/dist/video.js"></script>

 
 
 
<script>&#xA; var player = videojs(&#x27;my-video&#x27;);&#xA; </script>

 




When I run the flask app it produces an error :


* Serving Flask app 'server' (lazy loading)
 * Environment: production
 WARNING: This is a development server. Do not use it in a production deployment.
 Use a production WSGI server instead.
 * Debug mode: off
ffmpeg version N-109449-gb92260f70a-20221223 Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 12.2.0 (crosstool-NG 1.25.0.90_cf9beb1)
 configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --disable-libmfx --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20221223
 libavutil 57. 43.100 / 57. 43.100
 libavcodec 59. 55.103 / 59. 55.103
 libavformat 59. 34.102 / 59. 34.102
 libavdevice 59. 8.101 / 59. 8.101
 libavfilter 8. 53.100 / 8. 53.100
 libswscale 6. 8.112 / 6. 8.112
 libswresample 4. 9.100 / 4. 9.100
 libpostproc 56. 7.100 / 56. 7.100
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[gdigrab @ 00000134692d9cc0] Capturing whole desktop as 1280x1024x32 at (0,0)
Input #0, gdigrab, from 'desktop':
 Duration: N/A, start: 1671986678.012939, bitrate: 1048586 kb/s
 Stream #0:0: Video: bmp, bgra, 1280x1024, 1048586 kb/s, 25 fps, 25.08 tbr, 1000k tbn
127.0.0.1 - - [25/Dec/2022 21:44:39] code 400, message Bad request version ('û\x9beùSØHãEieÐ×kbz\x84ã^\x9dÚ½\x8bCðúÚîE\x8cßYë×s\x92.')
127.0.0.1 - - [25/Dec/2022 21:44:39] "♥ |☻÷xU▲Ϋ▲6/Åp²fÔ☻ a↑¢.6Õü+c)Â.çÇɰµ³Eߨ9ê;Èy ►hBZ¡↨LµrXÏëâM¤.Äÿ{@o↑É[ýÐNäo2¶¤{ö°RTâZ驨´ÅIonׯ¶¼ÈAiæ>7/þ↑m¨Q8bů޵¡!wâÙâÄt±õ§ð² ®
 ·×«2ùðT«{ ý?ò¸ö$¬pòpów4êñOf¬=dâ2♣D¤B ¤↓▲ôm<·-/"CÑu*A&2Öj uõÓ☻ô\ß+ŧ«ø↑1☺Φúì\yª~Ç↑▲¤Yín
eîÔioPþ♣ü Mí▲^ôüdÕ{∟¶¶jE▼j♦1VÒYW×▼©Àñ_K|÷¶Ã}¦ ↑a↔;☻ÿ|É@8u7Ó8.AkÕuwMùÊ÷H5!PÎÐÛ´▼Ãdá~5iã
▬e
ûùSØHãEieÐ×kbz
 ã^CðúÚîEßYë×s." 400 -
[rtmp @ 000001346ae35180] Cannot read RTMP handshake response
rtmp://localhost:5000/live/stream_name: End of file



I have searched on internet to fix this error but did not got any help.


-
ffmpeg with delayed inputs put an extra audio output at 0 seconds
19 mars 2023, par RalphCan someone explain why the input files are played 4 times in total, at 0, 1, 2, 3 seconds.


- 

- The ffmpeg processes three input files (mp3).
- The complex filter delays the inputs by 1, 2, 3 seconds input-wise.
- amix mixes the delayed outputs together.
- And finally, a coded transforms it into an output mp3.










ffmpeg -i in0.mp3 -i in1.mp3 -i in2.mp3 -filter_complex "[0]adelay=1000[delayed1];[1]adelay=2000[delayed2];[2]adelay=3000[delayed3];[delayed1][delayed2][delayed3]amix=inputs=3:duration=longest" -codec:a libmp3lame -q:a 4 output.mp3



short version : 2 delayed beeps, an finally there come 3 beeps out (@ 0, 1, 2 seconds) :


ffmpeg -i beep.mp3 -filter_complex "[0]adelay=1000[delayed1];[0]adelay=2000[delayed2];[delayed1][delayed2]amix=inputs=2:duration=longest" -codec:a libmp3lame -q:a 4 output.mp3



ffmpeg version N-110011-gf456c192d9-tessus on a Mac M1.


I added also a silent input file from 0 to 1 seconds without any alteration of the outcome.
I added a silent stream as input as well without improvement. E.g. :


... -filter_complex "aevalsrc=0:d=4[silence];...



Another test with another ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers built with Apple clang version 13.1.6 (clang-1316.0.21.2.5) :

ffmpeg -i beep.mp3 -filter_complex "[0]adelay=1000[delayed1];aevalsrc=0:d=5[silence];[silence][delayed1]amix=inputs=2:duration=longest" -codec:a libmp3lame -q:a 4 output.mp3

There are again 2 beeps, at 0 and 1 second - going mad here !

(concat solves the issue. But I want to have a flexible solution with possibly overlapping audio streams.) Thanks for giving a hint !