
Recherche avancée
Médias (2)
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
Autres articles (45)
-
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 (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...) -
Possibilité de déploiement en ferme
12 avril 2011, parMediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)
Sur d’autres sites (8644)
-
ffmpeg HLS creation and segmentation results in "cannot decode" on iPad
5 mai 2014, par jt_dylanI have the following code that plays on Mac Safari :
<video controls="controls" width="480" height="270">
<source src="http://d1ckv7o9k6o3x9.cloudfront.net/d54cfa01-eff2-4e86-946e-dc8b2ee4a7e8/media/ hls/MVI_5927.m3u8">
</source></video>The url can be cut/pasted into the browser and works also but neither this code nor the url works in Windows Safari or iPad. Specifically on iPad I receive a cannot decode error. On Mac I have Quicktime installed so I tried that on Windows with no luck. The link that can be play on Mac is below.
http://d1ckv7o9k6o3x9.cloudfront.net/d54cfa01-eff2-4e86-946e-dc8b2ee4a7e8/media/hls/MVI_5927.m3u8
Browser Versions of software :
Mac Safari : Version 7.0.3 (9537.75.14) (works)
Windows Safari : Version 5.1.7 (7534.7.2) (doesn’t work - blank screen)
iPad Safari : ios Version 7.1.1 (doesn’t work - cannot decode)Here is how I’m creating my mp4 (lgpl)
I’m creating an mp4 with this command :
ffmpeg -i input.mov c:v mpeg4 q:v 1 test.mp4I’m creating the hls using ffmpeg lpgl with this command :
ffmpegcmd -re -y -i test.mp4 -map 0 -f segment -segment_list test.m3u8 -segment_list_flags +live -segment_time 1 -segment_list_type m3u8 test%05d.ts 2>&1
Now this works in Mac Safari with Quicktime installed but results in "cannot decode" if I try the url from ipad Safari.
I then tried with libx264 to create the mp4 as h.264 with aac and then copy to mpeg2 container as follows :
ffmpeg -i test.mov -c:v libx264 -c:a libfdk_aac -preset slower -b:a 240k test.slower.mp4
ffmpeg -i test.slower.mp4 -vcodec copy -f mpegts -bsf h264_mp4toannexb test.slower.ts
ffmpeg -re -y -i test.slower.ts -map 0 -f segment -segment_list test.slower.m3u8 -segment_list_flags +live -segment_time 1 -segment_list_type m3u8 test.slower.%05d.tsThis still produces the same results. Any idea what is wrong here ?
Any help is much appreciated.
Regards,
jt_dylanOutput from libx264 commands below :
ffmpeg -i test.mov -c:v libx264 -c:a libfdk_aac -preset slower -b:a 240k test.slower.mp4
ffmpeg version git-2014-05-04-aeeb3d4 Copyright (c) 2000-2014 the FFmpeg developers
built on May 4 2014 17:01:19 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
libavutil 52. 81.100 / 52. 81.100
libavcodec 55. 60.103 / 55. 60.103
libavformat 55. 37.102 / 55. 37.102
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tst/MVI_1716.MOV':
Metadata:
major_brand : qt
minor_version : 537331968
compatible_brands: qt CAEP
creation_time : 2012-07-21 05:17:44
Duration: 00:00:20.06, start: 0.000000, bitrate: 34471 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 33663 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 48k tbc (default)
Metadata:
creation_time : 2012-07-21 05:17:44
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s (default)
Metadata:
creation_time : 2012-07-21 05:17:44
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x39ae9e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x39ae9e0] profile High, level 5.0
[libx264 @ 0x39ae9e0] 264 - core 142 r2 ac76440 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=8 deblock=1:0:0 analyse=0x3:0x133 me=umh subme=9 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=60 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 'tstconv/MVI_1716.slower.mp4':
Metadata:
major_brand : qt
minor_version : 537331968
compatible_brands: qt CAEP
encoder : Lavf55.37.102
Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p, 1920x1080, q=-1--1, 24k tbn, 23.98 tbc (default)
Metadata:
creation_time : 2012-07-21 05:17:44
Stream #0:1(eng): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, mono, s16, 240 kb/s (default)
Metadata:
creation_time : 2012-07-21 05:17:44
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> libx264)
Stream #0:1 -> #0:1 (pcm_s16le -> libfdk_aac)
Press [q] to stop, [?] for help
frame= 481 fps=1.5 q=-1.0 Lsize= 18428kB time=00:00:20.07 bitrate=7519.9kbits/s
video:17827kB audio:589kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.060811%
[libx264 @ 0x39ae9e0] frame I:3 Avg QP:23.31 size:113718
[libx264 @ 0x39ae9e0] frame P:135 Avg QP:25.06 size: 56912
[libx264 @ 0x39ae9e0] frame B:343 Avg QP:27.13 size: 29825
[libx264 @ 0x39ae9e0] consecutive B-frames: 1.2% 4.2% 20.6% 74.0%
[libx264 @ 0x39ae9e0] mb I I16..4: 20.0% 53.3% 26.6%
[libx264 @ 0x39ae9e0] mb P I16..4: 9.7% 22.8% 5.4% P16..4: 41.0% 8.6% 5.4% 0.1% 0.0% skip: 7.0%
[libx264 @ 0x39ae9e0] mb B I16..4: 3.3% 7.2% 2.0% B16..8: 40.7% 9.8% 1.7% direct: 6.3% skip:29.0% L0:49.6% L1:44.7% BI: 5.7%
[libx264 @ 0x39ae9e0] 8x8 transform intra:58.9% inter:70.2%
[libx264 @ 0x39ae9e0] direct mvs spatial:99.4% temporal:0.6%
[libx264 @ 0x39ae9e0] coded y,uvDC,uvAC intra: 58.6% 46.9% 7.3% inter: 23.9% 20.2% 0.2%
[libx264 @ 0x39ae9e0] i16 v,h,dc,p: 10% 64% 14% 12%
[libx264 @ 0x39ae9e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 7% 50% 10% 3% 4% 3% 8% 4% 12%
[libx264 @ 0x39ae9e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 4% 64% 5% 2% 3% 2% 6% 2% 10%
[libx264 @ 0x39ae9e0] i8c dc,h,v,p: 35% 53% 9% 3%
[libx264 @ 0x39ae9e0] Weighted P-Frames: Y:11.1% UV:4.4%
[libx264 @ 0x39ae9e0] ref P L0: 47.8% 12.2% 15.8% 6.8% 5.7% 4.2% 4.3% 2.6% 0.6% 0.0%
[libx264 @ 0x39ae9e0] ref B L0: 76.8% 10.5% 5.1% 2.9% 2.2% 1.5% 0.9%
[libx264 @ 0x39ae9e0] ref B L1: 94.6% 5.4%
[libx264 @ 0x39ae9e0] kb/s:7279.24
ffmpeg -i test.slower.mp4 -vcodec copy -f mpegts -bsf h264_mp4toannexb test.slower.ts
ffmpeg version git-2014-05-04-aeeb3d4 Copyright (c) 2000-2014 the FFmpeg developers
built on May 4 2014 17:01:19 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
libavutil 52. 81.100 / 52. 81.100
libavcodec 55. 60.103 / 55. 60.103
libavformat 55. 37.102 / 55. 37.102
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tstconv/MVI_1716.slower.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.37.102
Duration: 00:00:20.11, start: 0.042667, bitrate: 7508 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1920x1080, 7279 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 240 kb/s (default)
Metadata:
handler_name : SoundHandler
[swscaler @ 0x367c0c0] deprecated pixel format used, make sure you did set range correctly
Output #0, segment, to 'MVI_1716.slower.%05d.ts':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.37.102
Stream #0:0(eng): Video: mpeg2video, yuv420p, 1920x1080, q=2-31, 200 kb/s, 90k tbn, 23.98 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: mp2, 48000 Hz, mono, s16, 384 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mpeg2video)
Stream #0:1 -> #0:1 (aac -> mp2)
Press [q] to stop, [?] for help
frame= 482 fps= 24 q=31.0 Lsize=N/A time=00:00:20.12 bitrate=N/A dup=1 drop=0
video:8293kB audio:944kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 195032183209984.000000%
ffmpeg version git-2014-05-04-aeeb3d4 Copyright (c) 2000-2014 the FFmpeg developers
built on May 4 2014 17:01:19 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
libavutil 52. 81.100 / 52. 81.100
libavcodec 55. 60.103 / 55. 60.103
libavformat 55. 37.102 / 55. 37.102
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tstconv/MVI_1716.slower.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.37.102
Duration: 00:00:20.11, start: 0.042667, bitrate: 7508 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 1920x1080, 7279 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 240 kb/s (default)
Metadata:
handler_name : SoundHandler
File 'tstconv/MVI_1716.slower.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'tstconv/MVI_1716.slower.ts':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.37.102
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuvj420p, 1920x1080, q=2-31, 7279 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: mp2, 48000 Hz, mono, s16, 384 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (aac -> mp2)
Press [q] to stop, [?] for help
frame= 481 fps=0.0 q=-1.0 Lsize= 20334kB time=00:00:20.12 bitrate=8276.6kbits/s
video:17827kB audio:944kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.325850%
ffmpeg -re -y -i test.slower.ts -map 0 -f segment -segment_list test.slower.m3u8 -segment_list_flags +live -segment_time 1 -segment_list_type m3u8 test.slower.%05d.ts
ffmpeg version git-2014-05-04-aeeb3d4 Copyright (c) 2000-2014 the FFmpeg developers
built on May 4 2014 17:01:19 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2)
configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
libavutil 52. 81.100 / 52. 81.100
libavcodec 55. 60.103 / 55. 60.103
libavformat 55. 37.102 / 55. 37.102
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mpegts, from 'tstconv/MVI_1716.slower.ts':
Duration: 00:00:20.11, start: 1.430733, bitrate: 8282 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc), 1920x1080, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, mono, s16p, 373 kb/s
[swscaler @ 0x1fe9ae0] deprecated pixel format used, make sure you did set range correctly
Output #0, segment, to 'MVI_1716.slower.%05d.ts':
Metadata:
encoder : Lavf55.37.102
Stream #0:0: Video: mpeg2video, yuv420p, 1920x1080, q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
Stream #0:1(eng): Audio: mp2, 48000 Hz, mono, s16, 384 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mpeg2video)
Stream #0:1 -> #0:1 (mp2 -> mp2) -
Carrierwave-video "Process hung" error while encoding uncompressed video files
28 avril 2014, par CrampsI have an API for a mobile app that accepts video uploads. This app is for both iOS and Android devices, so for video compatibility’s sake these videos are encoded to H.264 once uploaded to the server using carrierwave-video (ffmpeg wrapper gem for Ruby on Rails). Right now this seems to be working, and videos are uploaded and encoded and can be played in both Android and iOS devices. However, sometimes the process hangs while encoding heavy (uncompressed ?) video files, usually 10+ seconds long. This is the output of ffmpeg :
Failed to transcode with FFmpeg.
Check ffmpeg install and verify video is not corrupt or cut short.
Original error: Process hung. Full output:(That’s it, the full output seems empty.)
These are the encoding parameters I’m using in my Carrierwave Uploader :
encode_video(:mp4, custom: '-y -vcodec libx264 -acodec libfaac -vpre ultrafast 2> /home/user/log/ffmpeg.log, resolution: '640x640')
According to the SuperUser question I linked above a solution would be to encode the video twice, once to AVI for compression(?) and then encode to MP4. I don’t know if that would work, but I don’t know how to do this either in my uploader. I would have to encode the output video file of my first (AVI) encoding process.
Now that there’s some context, my question is : How can I solve this "Process hung" error ?
In case the answer to that is to go with this double encoding method suggested, how can I achieve this using Carrierwave-video ?
One last note is that if I try to encode these videos using
ffmpeg
straight from command-line the videos encode and playback successfully.Thank you for your time !
PD : Wasn’t sure if I should add ruby-on-rails tag. I’ll remove it if necessary !
Edit
This is what I get fromffmpeg -i filename.mp4
ffmpeg version 0.10.3 Copyright (c) 2000-2012 the FFmpeg developers
built on Apr 30 2013 11:26:53 with gcc 4.5.4
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-O2 -march=athlon64 -pipe' --extra-cflags='-O2 -march=athlon64 -pipe' --extra-cxxflags='-O2 -march=athlon64 -pipe' --disable-static --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --disable-stripping --disable-debug --disable-doc --disable-vaapi --disable-vdpau --disable-ffplay --enable-openssl --enable-nonfree --enable-libmp3lame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libaacplus --enable-nonfree --enable-libfaac --enable-nonfree --disable-indev=v4l --disable-indev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss --disable-outdev=sdl --enable-pthreads --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-libvpx --enable-libope libavutil 51. 35.100 / 51. 35.100
libavcodec 53. 61.100 / 53. 61.100
libavformat 53. 32.100 / 53. 32.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 61.100 / 2. 61.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/user/api/uploads/tmp/e54zfghzt9.mp4':
Metadata:
major_brand : isom
minor_version : 0
compatible_brands: isom3gp4
creation_time : 2014-04-23 14:56:19
Duration: 00:00:14.27, start: 0.000000, bitrate: 20757 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 20993 kb/s, SAR 65536:65536 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc
Metadata:
creation_time : 2014-04-23 14:56:19
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 190 kb/s
Metadata:
creation_time : 2014-04-23 14:56:19
handler_name : SoundHandleThen it just starts buffering as such :
time=00:00:13.20 bitrate=2533.2kbits/s
frame= 405 fps= 7 q=24.0 size= 4083kB time=00:00:13.20 bitrate=2533.2kbits/s
frame= 407 fps= 7 q=24.0 size= 4083kB time=00:00:13.20 bitrate=2533.2kbits/s
frame= 409 fps= 7 q=24.0 size= 4083kB time=00:00:13.20 bitrate=2533.2kbits/s
frame= 412 fps= 7 q=24.0 size= 4083kB time=00:00:13.20 bitrate=2533.2kbits/s
frame= 417 fps= 7 q=24.0 size= 4083kB time=00:00:13.20 bitrate=2533.2kbits/s
frame= 417 fps= 7 q=24.0 Lsize= 4194kB time=00:00:13.90 bitrate=2471.5kbits/s
video:3957kB audio:223kB global headers:0kB muxing overhead 0.310939%
[libx264 @ 0x7f28327ccc50] frame I:2 Avg QP:21.50 size: 25120
[libx264 @ 0x7f28327ccc50] frame P:415 Avg QP:25.32 size: 9642
[libx264 @ 0x7f28327ccc50] mb I I16..4: 35.8% 0.0% 64.2%
[libx264 @ 0x7f28327ccc50] mb P I16..4: 8.4% 0.0% 3.2% P16..4: 43.6% 19.0% 5.6% 0.0% 0.0% skip:20.2%
[libx264 @ 0x7f28327ccc50] coded y,uvDC,uvAC intra: 45.2% 53.6% 27.3% inter: 39.4% 27.6% 2.7%
[libx264 @ 0x7f28327ccc50] i16 v,h,dc,p: 28% 57% 11% 5%
[libx264 @ 0x7f28327ccc50] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 66% 11% 1% 1% 1% 2% 1% 2%
[libx264 @ 0x7f28327ccc50] i8c dc,h,v,p: 23% 58% 17% 3%
[libx264 @ 0x7f28327ccc50] kb/s:2331.88`
-
avconv "select" filter doesn't discard first frames
1er avril 2014, par user2152106I'm trying to segment a video using avconv's "select" filter to extract only a specific range of frames from the input file. As an example, imagine I have a 60fps video file called input.mp4, with 3000 frames (i.e. 50 seconds), and I run
avconv -i input.mp4 -vf "select='lt(n,2000)'" output1.mp4
avconv -i input.mp4 -vf "select='gte(n,2000)'" output2.mp4What I expect is that output1.mp4 has the first 2000 frames of input.mp4 (and lasts 33 seconds), and output2.mp4 has the last 1000 (and lasts 17 seconds).
I count the frames by running
avconv -i video.mp4 -vcodec copy -an -f null /dev/null 2>&1 | grep 'frame='
and checking the value assigned to 'frame'.
What I actually get, is that output1.mp4 has 2000 frames and lasts 33 seconds, but output2.mp4 has 2999 frames, and still lasts the full 50 seconds. When I open output2.mp4, I notice that the first 2000 frames of the video are actually just a repetition of the 2000th frame of the input, i.e. the first 2000 frames seem to be correctly filtered, but replaced by the first of the accepted frames.
This is not a pts problem. I check the number of packets and their relative pts using avprobe :
avprobe -show_packets output2.mp4
echo $(avprobe -show_packets output2.mp4 2>/dev/null | grep PACKET | wc -l)/2 | bcI see that there are actually 2999 packets.
What am I doing wrong ?
Side questions :
- Assuming I'm doing something wrong, why does output2.mp4 contain 2999 rather than the full 3000 ?
- The behaviour doesn't change whether I use the "gte" or "gt" function in the filter. Why could that be ?