[FFmpeg-user] Mixed telecined non-telecined media to constant frame rate.
Nicholas Robbins
nickrobbins at yahoo.com
Tue Jan 21 12:57:01 CET 2014
> On Tuesday, January 21, 2014 4:12 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> > Nicholas Robbins <nickrobbins <at> yahoo.com> writes:
>
>> >Did you test -r 60 ?
>
>> Trying -r 60 (or -r 60000/1001) produces no change in
>> the number of frames or their spacing.
>
> Please provide the command line and the complete, uncut
> console output.
>
> Carl Eugen
$ ffmpeg -i short.mkv -c copy -c:v libx264 -preset veryfast -crf 17 -vf pullup -r 60 out.mkv
ffmpeg version N-60019-gd9779d6 Copyright (c) 2000-2014 the FFmpeg developers
built on Jan 20 2014 19:52:41 with gcc 4.7.3 (Gentoo Hardened 4.7.3-r1 p1.3, pie-0.5.5)
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 -pipe -march=native -fomit-frame-pointer' --extra-cflags='-O2 -pipe -march=native -fomit-frame-pointer' --extra-cxxflags='-O2 -pipe -march=native -fomit-frame-pointer' --disable-static --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --disable-stripping --enable-nonfree --disable-indev=v4l2 --disable-outdev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss --disable-outdev=sdl --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-doc --disable-gnutls --enable-hardcoded-tables --enable-iconv --enable-network --disable-openssl --disable-ffplay --disable-vaapi --disable-vdpau --enable-zlib --disable-libvo-aacenc --disable-libvo-amrwbenc
--enable-libmp3lame --disable-libaacplus --enable-libfaac --disable-libtheora --disable-libtwolame --disable-libwavpack --enable-libx264 --enable-libxvid --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --disable-libv4l2 --disable-libpulse --disable-x11grab --disable-libflite --disable-frei0r --disable-fontconfig --disable-ladspa --disable-libass --disable-libfreetype --disable-libsoxr --enable-pthreads --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libcelt --disable-libgme --disable-libgsm --disable-libmodplug --disable-libopus --disable-libquvi --disable-librtmp --disable-libssh --disable-libschroedinger --disable-libspeex --disable-libvorbis --disable-libvpx --disable-libzvbi --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2
--disable-mipsfpu --disable-altivec --disable-vis --disable-amd3dnow --disable-amd3dnowext --disable-avx --disable-avx2 --disable-fma4 --disable-sse3 --disable-sse4 --disable-sse42 --enable-pic --cpu=host
libavutil 52. 63.100 / 52. 63.100
libavcodec 55. 48.102 / 55. 48.102
libavformat 55. 25.100 / 55. 25.100
libavdevice 55. 5.102 / 55. 5.102
libavfilter 4. 1.100 / 4. 1.100
libavresample 1. 1. 0 / 1. 1. 0
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, matroska,webm, from 'short.mkv':
Metadata:
creation_time : 2014-01-20 22:09:46
ENCODER : Lavf55.19.104
Duration: 00:00:40.13, start: 0.033000, bitrate: 6094 kb/s
Chapter #0.0: start 0.000000, end 40.096000
Metadata:
title : Chapter 01
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv), 720x480 [SAR 32:27 DAR 16:9], max. 8456 kb/s, SAR 186:157 DAR 279:157, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
[libx264 @ 0x4eae96da30] using SAR=186/157
[libx264 @ 0x4eae96da30] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x4eae96da30] profile High, level 3.1
[libx264 @ 0x4eae96da30] 264 - core 120 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=17.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'out.mkv':
Metadata:
encoder : Lavf55.25.100
Chapter #0.0: start 0.000000, end 40.063000
Metadata:
title : Chapter 01
Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 720x480 [SAR 186:157 DAR 279:157], q=-1--1, 1k tbn, 60 tbc
Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), 448 kb/s (default)
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video -> libx264)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1052 fps= 40 q=-1.0 Lsize= 13336kB time=00:00:40.12 bitrate=2722.6kbits/s
video:11125kB audio:2194kB subtitle:0 global headers:0kB muxing overhead 0.128029%
[libx264 @ 0x4eae96da30] frame I:7 Avg QP:13.27 size: 32725
[libx264 @ 0x4eae96da30] frame P:492 Avg QP:18.59 size: 16533
[libx264 @ 0x4eae96da30] frame B:553 Avg QP:20.49 size: 5476
[libx264 @ 0x4eae96da30] consecutive B-frames: 10.1% 55.5% 12.0% 22.4%
[libx264 @ 0x4eae96da30] mb I I16..4: 26.0% 40.0% 34.0%
[libx264 @ 0x4eae96da30] mb P I16..4: 7.0% 16.5% 1.0% P16..4: 33.5% 19.8% 14.3% 0.0% 0.0% skip: 7.8%
[libx264 @ 0x4eae96da30] mb B I16..4: 1.9% 2.9% 0.0% B16..8: 26.5% 9.1% 1.2% direct:23.2% skip:35.0% L0:28.8% L1:38.0% BI:33.2%
[libx264 @ 0x4eae96da30] 8x8 transform intra:65.0% inter:57.9%
[libx264 @ 0x4eae96da30] coded y,uvDC,uvAC intra: 71.5% 71.7% 39.7% inter: 34.2% 37.9% 4.6%
[libx264 @ 0x4eae96da30] i16 v,h,dc,p: 38% 22% 33% 7%
[libx264 @ 0x4eae96da30] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 15% 46% 3% 2% 3% 3% 3% 3%
[libx264 @ 0x4eae96da30] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 22% 18% 6% 6% 7% 7% 6% 7%
[libx264 @ 0x4eae96da30] i8c dc,h,v,p: 56% 18% 21% 5%
[libx264 @ 0x4eae96da30] Weighted P-Frames: Y:6.1% UV:5.5%
[libx264 @ 0x4eae96da30] kb/s:2276.35
ffprobe confirms the frame count.
and, it's not just a problem with my sample:
$ ffmpeg -f lavfi -i testsrc=s=pal -target pal-dvd -t 10 ten.mkv
ffmpeg version N-60019-gd9779d6 Copyright (c) 2000-2014 the FFmpeg developers
built on Jan 20 2014 19:52:41 with gcc 4.7.3 (Gentoo Hardened 4.7.3-r1 p1.3, pie-0.5.5)
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 -pipe -march=native -fomit-frame-pointer' --extra-cflags='-O2 -pipe -march=native -fomit-frame-pointer' --extra-cxxflags='-O2 -pipe -march=native -fomit-frame-pointer' --disable-static --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --disable-stripping --enable-nonfree --disable-indev=v4l2 --disable-outdev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss --disable-outdev=sdl --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-doc --disable-gnutls --enable-hardcoded-tables --enable-iconv --enable-network --disable-openssl --disable-ffplay --disable-vaapi --disable-vdpau --enable-zlib --disable-libvo-aacenc --disable-libvo-amrwbenc
--enable-libmp3lame --disable-libaacplus --enable-libfaac --disable-libtheora --disable-libtwolame --disable-libwavpack --enable-libx264 --enable-libxvid --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --disable-libv4l2 --disable-libpulse --disable-x11grab --disable-libflite --disable-frei0r --disable-fontconfig --disable-ladspa --disable-libass --disable-libfreetype --disable-libsoxr --enable-pthreads --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libcelt --disable-libgme --disable-libgsm --disable-libmodplug --disable-libopus --disable-libquvi --disable-librtmp --disable-libssh --disable-libschroedinger --disable-libspeex --disable-libvorbis --disable-libvpx --disable-libzvbi --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2
--disable-mipsfpu --disable-altivec --disable-vis --disable-amd3dnow --disable-amd3dnowext --disable-avx --disable-avx2 --disable-fma4 --disable-sse3 --disable-sse4 --disable-sse42 --enable-pic --cpu=host
libavutil 52. 63.100 / 52. 63.100
libavcodec 55. 48.102 / 55. 48.102
libavformat 55. 25.100 / 55. 25.100
libavdevice 55. 5.102 / 55. 5.102
libavfilter 4. 1.100 / 4. 1.100
libavresample 1. 1. 0 / 1. 1. 0
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, lavfi, from 'testsrc=s=pal':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 720x576 [SAR 1:1 DAR 5:4], 25 tbr, 25 tbn, 25 tbc
Output #0, dvd, to 'ten.mkv':
Metadata:
encoder : Lavf55.25.100
Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 1:1 DAR 5:4], q=2-31, 6000 kb/s, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo -> mpeg2video)
Press [q] to stop, [?] for help
frame= 250 fps= 57 q=2.0 Lsize= 1098kB time=00:00:09.96 bitrate= 903.1kbits/s
video:1033kB audio:0kB subtitle:0 global headers:0kB muxing overhead 6.297477%
$ ffmpeg -i ten.mkv -c copy -c:v libx264 -preset veryfast -crf 17 -r 120 ten-out.mkv
ffmpeg version N-60019-gd9779d6 Copyright (c) 2000-2014 the FFmpeg developers
built on Jan 20 2014 19:52:41 with gcc 4.7.3 (Gentoo Hardened 4.7.3-r1 p1.3, pie-0.5.5)
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 -pipe -march=native -fomit-frame-pointer' --extra-cflags='-O2 -pipe -march=native -fomit-frame-pointer' --extra-cxxflags='-O2 -pipe -march=native -fomit-frame-pointer' --disable-static --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --disable-stripping --enable-nonfree --disable-indev=v4l2 --disable-outdev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-outdev=alsa --disable-outdev=oss --disable-outdev=sdl --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-doc --disable-gnutls --enable-hardcoded-tables --enable-iconv --enable-network --disable-openssl --disable-ffplay --disable-vaapi --disable-vdpau --enable-zlib --disable-libvo-aacenc --disable-libvo-amrwbenc
--enable-libmp3lame --disable-libaacplus --enable-libfaac --disable-libtheora --disable-libtwolame --disable-libwavpack --enable-libx264 --enable-libxvid --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --disable-libv4l2 --disable-libpulse --disable-x11grab --disable-libflite --disable-frei0r --disable-fontconfig --disable-ladspa --disable-libass --disable-libfreetype --disable-libsoxr --enable-pthreads --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libcelt --disable-libgme --disable-libgsm --disable-libmodplug --disable-libopus --disable-libquvi --disable-librtmp --disable-libssh --disable-libschroedinger --disable-libspeex --disable-libvorbis --disable-libvpx --disable-libzvbi --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2
--disable-mipsfpu --disable-altivec --disable-vis --disable-amd3dnow --disable-amd3dnowext --disable-avx --disable-avx2 --disable-fma4 --disable-sse3 --disable-sse4 --disable-sse42 --enable-pic --cpu=host
libavutil 52. 63.100 / 52. 63.100
libavcodec 55. 48.102 / 55. 48.102
libavformat 55. 25.100 / 55. 25.100
libavdevice 55. 5.102 / 55. 5.102
libavfilter 4. 1.100 / 4. 1.100
libavresample 1. 1. 0 / 1. 1. 0
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
[NULL @ 0x324baa11b0] start time is not set in estimate_timings_from_pts
Input #0, mpeg, from 'ten.mkv':
Duration: 00:00:09.92, start: 0.540000, bitrate: 906 kb/s
Stream #0:0[0x1bf]: Data: dvd_nav_packet
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 1:1 DAR 5:4], max. 9000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
[libx264 @ 0x324baa29c0] using SAR=1/1
[libx264 @ 0x324baa29c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x324baa29c0] profile High, level 3.2
[libx264 @ 0x324baa29c0] 264 - core 120 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=17.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'ten-out.mkv':
Metadata:
encoder : Lavf55.25.100
Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 720x576 [SAR 1:1 DAR 5:4], q=-1--1, 1k tbn, 120 tbc
Stream mapping:
Stream #0:1 -> #0:0 (mpeg2video -> libx264)
Press [q] to stop, [?] for help
frame= 250 fps=104 q=-1.0 Lsize= 202kB time=00:00:09.89 bitrate= 167.0kbits/s
video:199kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.145975%
[libx264 @ 0x324baa29c0] frame I:1 Avg QP:18.47 size: 10196
[libx264 @ 0x324baa29c0] frame P:238 Avg QP:19.35 size: 800
[libx264 @ 0x324baa29c0] frame B:11 Avg QP:22.02 size: 262
[libx264 @ 0x324baa29c0] consecutive B-frames: 91.2% 8.8% 0.0% 0.0%
[libx264 @ 0x324baa29c0] mb I I16..4: 82.1% 6.9% 11.0%
[libx264 @ 0x324baa29c0] mb P I16..4: 3.8% 1.9% 0.0% P16..4: 5.2% 1.5% 0.4% 0.0% 0.0% skip:87.3%
[libx264 @ 0x324baa29c0] mb B I16..4: 1.2% 0.2% 0.0% B16..8: 3.5% 0.4% 0.0% direct: 1.9% skip:92.9% L0:70.3% L1:27.3% BI: 2.4%
[libx264 @ 0x324baa29c0] 8x8 transform intra:31.3% inter:62.9%
[libx264 @ 0x324baa29c0] coded y,uvDC,uvAC intra: 4.6% 40.4% 14.1% inter: 0.5% 5.5% 1.7%
[libx264 @ 0x324baa29c0] i16 v,h,dc,p: 88% 7% 1% 4%
[libx264 @ 0x324baa29c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 99% 0% 1% 0% 0% 0% 0% 0% 0%
[libx264 @ 0x324baa29c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 47% 24% 17% 3% 2% 2% 1% 3% 1%
[libx264 @ 0x324baa29c0] i8c dc,h,v,p: 11% 7% 68% 14%
[libx264 @ 0x324baa29c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x324baa29c0] kb/s:162.80
ffprobe confirms the frame count again with -count_frames.
Nicholas Robbins
More information about the ffmpeg-user
mailing list