- <span class="CodeRay">Une date 2021 12 32
- 2021-12-03
- </span>

Recherche avancée
Autres articles (42)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)
Sur d’autres sites (8046)
-
ffmpeg can't extract a frame near the end of the video
29 mars 2024, par Rob AllsoppFrom what I gather, using ffmpeg to fully decode a video should give me an accurate duration. If I use :


ffmpeg -i my_vid.mov -f null -



for a particular video, I get an output of :


...
frame= 901 fps=0.0 q=-0.0 Lsize=N/A time=00:00:30.52 bitrate=N/A speed= 247x
...



But when I run the following command to extract a frame near the end, it fails :


ffmpeg -i my_vid.mov -ss 00:00:30.450 -q:v 2 -vframes 1 test_frame.jpg



outputs :


Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)



Backing up to 00:00:30.000 with the ffmpeg command does get me a frame, however, and any time before that works as expected also. It seems like I should be able to get frames up to 00:00:30.520, though. What could be wrong here ? Am I misreading the duration output ?


Here is the full output I get from the frame extraction command :


> ffmpeg -ss 00:00:30.450 -i file_example_MOV_640_800kB.mov -q:v 2 -vframes 1 test_frame.jpg

ffmpeg version 2021-04-20-git-718e03e5f2-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 56. 73.100 / 56. 73.100
 libavcodec 58.136.101 / 58.136.101
 libavformat 58. 78.100 / 58. 78.100
 libavdevice 58. 14.100 / 58. 14.100
 libavfilter 7.111.100 / 7.111.100
 libswscale 5. 10.100 / 5. 10.100
 libswresample 3. 10.100 / 3. 10.100
 libpostproc 55. 10.100 / 55. 10.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file_example_MOV_640_800kB.mov':
 Metadata:
 major_brand : qt
 minor_version : 512
 compatible_brands: qt
 encoder : Lavf57.19.100
 Duration: 00:00:30.57, start: 0.000000, bitrate: 208 kb/s
 Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 60 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : FFMP
 encoder : Lavc57.16.101 libx264
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 139 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 000001acc1d28580] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'test_frame.jpg':
 Metadata:
 major_brand : qt
 minor_version : 512
 compatible_brands: qt
 encoder : Lavf58.78.100
 Stream #0:0(eng): Video: mjpeg, yuvj420p(pc), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : FFMP
 encoder : Lavc58.136.101 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame= 0 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.00 bitrate=N/A speed= 0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)



Here's the full output with copyts :


> ffmpeg -copyts -sseof -3 -i file_example_MOV_640_800kB.mov -q:v 2 -update 1 test_frame.jpg

ffmpeg version 2021-04-20-git-718e03e5f2-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 56. 73.100 / 56. 73.100
 libavcodec 58.136.101 / 58.136.101
 libavformat 58. 78.100 / 58. 78.100
 libavdevice 58. 14.100 / 58. 14.100
 libavfilter 7.111.100 / 7.111.100
 libswscale 5. 10.100 / 5. 10.100
 libswresample 3. 10.100 / 3. 10.100
 libpostproc 55. 10.100 / 55. 10.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file_example_MOV_640_800kB.mov':
 Metadata:
 major_brand : qt
 minor_version : 512
 compatible_brands: qt
 encoder : Lavf57.19.100
 Duration: 00:00:30.57, start: 0.000000, bitrate: 208 kb/s
 Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 60 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : FFMP
 encoder : Lavc57.16.101 libx264
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 139 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
File 'test_frame.jpg' already exists. Overwrite? [y/N] y
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0000022d7e964480] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'test_frame.jpg':
 Metadata:
 major_brand : qt
 minor_version : 512
 compatible_brands: qt
 encoder : Lavf58.78.100
 Stream #0:0(eng): Video: mjpeg, yuvj420p(pc, progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : FFMP
 encoder : Lavc58.136.101 mjpeg
 Side data:
 cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame= 73 fps=0.0 q=2.0 Lsize=N/A time=00:00:00.00 bitrate=N/A speed= 0x
video:859kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown



-
FFMPEG concat filter has unconnected audio output
7 juillet 2021, par volx757I am trying to concat an arbitrary video file with a video file of 5 seconds of black. Here is the command I'm using :


ffmpeg -i tmp/converted_one_1234.mp4 -i public/empty.mp4 -vsync 2 -filter_complex "[0:v]scale=1024:576:force_original_aspect_ratio=decrease,pad=1024:576:(ow-iw)/2:(oh-ih)/2,setsar=1[v0]; [1:v]scale=1024:576:force_original_aspect_ratio=decrease,pad=1024:576:(ow-iw)/2:(oh-ih)/2,setsar=1[v1]; [v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]" -map [v] -map [a] output.mp4



And the error :


Filter concat:out:a0 has an unconnected output



So I understand the issue is that there is an audio stream that is not getting mapped to an output. The arbitrary video has audio in it, the black video technically has no sound, but it has an audio stream (verified with ffprobe).


I think I'm just missing how the syntax works here. I've tried removing the audio input from this section :


[v0][0:a][v1]concat=n=2:v=1:a=1[v][a]



but it doesn't work. How do I avoid this error ?


edit with complete log of ffmpeg events (i should note that before this failing operation, there is one in which the arbitrary video gets converted to an mp4. The concat fails regardless of whether the first conversion is included) :


ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
 built with Apple clang version 12.0.5 (clang-1205.0.22.9)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'http://s3.amazonaws.com/bucket/27173/custom_video/final/IMG_2753.mp4?1625616358':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Duration: 00:00:15.93, start: 0.000000, bitrate: 802 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 320x568, 723 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : Core Media Video
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 70 kb/s (default)
 Metadata:
 handler_name : Core Media Audio
 vendor_id : [0][0][0][0]
File 'tmp/converted_one_27173.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (aac (native) -> mp2 (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7fe770820400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fe770820400] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x7fe770820400] 264 - core 163 r3060 5db6aa6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'tmp/converted_one_27173.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 320x568, q=2-31, 30 fps, 15360 tbn (default)
 Metadata:
 handler_name : Core Media Video
 vendor_id : [0][0][0][0]
 encoder : Lavc58.134.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 Stream #0:1(und): Audio: mp2 (mp4a / 0x6134706D), 44100 Hz, mono, s16, 384 kb/s (default)
 Metadata:
 handler_name : Core Media Audio
 vendor_id : [0][0][0][0]
 encoder : Lavc58.134.100 mp2
frame= 478 fps=353 q=-1.0 Lsize= 2033kB time=00:00:15.89 bitrate=1047.8kbits/s speed=11.7x 
video:1271kB audio:747kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.769286%
[libx264 @ 0x7fe770820400] frame I:11 Avg QP:23.67 size: 9018
[libx264 @ 0x7fe770820400] frame P:200 Avg QP:25.18 size: 4565
[libx264 @ 0x7fe770820400] frame B:267 Avg QP:30.02 size: 1081
[libx264 @ 0x7fe770820400] consecutive B-frames: 20.5% 12.1% 8.8% 58.6%
[libx264 @ 0x7fe770820400] mb I I16..4: 9.3% 78.4% 12.3%
[libx264 @ 0x7fe770820400] mb P I16..4: 10.3% 32.2% 1.0% P16..4: 34.0% 12.3% 5.0% 0.0% 0.0% skip: 5.2%
[libx264 @ 0x7fe770820400] mb B I16..4: 1.0% 4.2% 0.1% B16..8: 50.8% 4.2% 0.3% direct: 1.7% skip:37.6% L0:52.8% L1:42.8% BI: 4.4%
[libx264 @ 0x7fe770820400] 8x8 transform intra:75.0% inter:70.6%
[libx264 @ 0x7fe770820400] coded y,uvDC,uvAC intra: 47.7% 64.1% 8.5% inter: 17.0% 19.6% 2.4%
[libx264 @ 0x7fe770820400] i16 v,h,dc,p: 17% 21% 8% 53%
[libx264 @ 0x7fe770820400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 23% 15% 5% 7% 7% 7% 5% 7%
[libx264 @ 0x7fe770820400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 24% 14% 5% 9% 7% 9% 5% 6%
[libx264 @ 0x7fe770820400] i8c dc,h,v,p: 47% 25% 20% 8%
[libx264 @ 0x7fe770820400] Weighted P-Frames: Y:11.5% UV:5.5%
[libx264 @ 0x7fe770820400] ref P L0: 73.5% 12.0% 11.9% 2.0% 0.5%
[libx264 @ 0x7fe770820400] ref B L0: 96.0% 3.8% 0.2%
[libx264 @ 0x7fe770820400] ref B L1: 98.1% 1.9%
[libx264 @ 0x7fe770820400] kb/s:653.11
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
 built with Apple clang version 12.0.5 (clang-1205.0.22.9)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Trailing option(s) found in the command: may be ignored.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tmp/converted_one_27173.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Duration: 00:00:15.93, start: 0.000000, bitrate: 1045 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 320x568, 653 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
 Metadata:
 handler_name : Core Media Video
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 384 kb/s (default)
 Metadata:
 handler_name : Core Media Audio
 vendor_id : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'public/empty.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Duration: 00:00:05.01, start: 0.000000, bitrate: 17 kb/s
 Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], 7 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 2 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
Filter concat:out:a0 has an unconnected output



-
Anomalie #4830 : extraire_date extravagant
6 juillet 2021Ça retourne une date "03" puisque 32 n’est pas un jour valide, mais 3 peut l’être.