[FFmpeg-user] Mixed telecined non-telecined media to constant frame rate.

Nicholas Robbins nickrobbins at yahoo.com
Tue Jan 21 15:15:29 CET 2014

> On Tuesday, January 21, 2014 7:24 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> > Nicholas Robbins <nickrobbins <at> yahoo.com> writes:
>>  $ ffmpeg -i short.mkv -c copy -c:v libx264 -preset veryfast 
>>  -crf 17 -vf pullup -r 60 out.mkv 
> Does -vsync cfr make a difference?
> (Sorry, I am away from my workstation atm.)

adding in the -vsync cfr makes it actually add frames, but the duped frames are still 2,2,2,4.

> You may want to use -vcodec mpeg4 for testing... 

Will that make a difference or just go faster?

>>    configuration:
> Unrelated:

I use gentoo, and I'm building my ffmpeg using its build system (portage) which generates the configure command based on various "use flags" like for instance "x264" or "debug".

>>  --cc=x86_64-pc-linux-gnu-gcc
>>  --cxx=x86_64-pc-linux-gnu-g++ 
>>  --ar=x86_64-pc-linux-gnu-ar
> Are these really necessary?
> That may indicate a bug imo.
>>  --prefix=/usr
>>  --mandir=/usr/share/man
> (I wonder if this isn't the default but I may be wrong.)

Portage tends to overspecify configuration.

>>  --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' 
> As said elsewhere there are exactly two possibilities:
> Either this makes sense, then it should be made default for all 
> users, or it does not make sense, then please remove it.
> (To the best of my knowledge, it does not make sense.)

This is standard for gentoo. My understanding is that -pipe and -march=native can't hurt. -fomit-frame-pointer can't hurt if you are not debuging, and -02 usually helps. I can remove it if you think it is causing this behavior. Here is the relavent part of the "ebuild" for example

         "${S}/configure" \
                --prefix="${EPREFIX}/usr" \
                --libdir="${EPREFIX}/usr/$(get_libdir)" \
                --shlibdir="${EPREFIX}/usr/$(get_libdir)" \
                --mandir="${EPREFIX}/usr/share/man" \
                --enable-shared \
                --cc="$(tc-getCC)" \
                --cxx="$(tc-getCXX)" \
                --ar="$(tc-getAR)" \
                --optflags="${CFLAGS}" \
                --extra-cflags="${CFLAGS}" \
                --extra-cxxflags="${CXXFLAGS}" \
                $(use_enable static-libs static) \

>>  --enable-postproc 
>>  --enable-avfilter 
>>  --enable-bzlib
>>  --enable-zlib
>>  --enable-iconv 
>>  --enable-network 
>>  --disable-openssl
>>  --disable-gnutls
>>  --enable-iconv 
>>  --enable-network 
>>  --disable-openssl
>>  --disable-libvo-aacenc 
>>  --disable-libvo-amrwbenc
>>  --disable-libaacplus
>>  --disable-libtheora
>>  --disable-libtwolame 
>>  --disable-libwavpack
>>  --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
> These are all default values and shold be removed imo.

Like I said, in portage, you set flags in a global config file for things like pthreads. Then it builds the configure command using these flags. So even the defaults are often explicitly named.

here is the relevent portion of the ebuild:
        for i in bluray celt gme gsm modplug opus quvi rtmp ssh schroedinger speex vorbis vpx zvbi; do
                ffuse="${ffuse} ${i}:lib${i}"
        use fdk && myconf="${myconf} --enable-nonfree"

        for i in ${ffuse} ; do
                myconf="${myconf} $(use_enable ${i%:*} ${i#*:})"

use_enable checks to see if I have the vpx useflag set (I don't) and so adds --disable-libvpx to the configure command.

>>  --enable-pic
> I may miss something but I believe you should not mess 
> with this option.

Why? What is wrong with PIC?

>>  --enable-hardcoded-tables
> Really?

This is suggested by the people who maintain ffmpeg in gentoo. Does it hurt?

>>  --disable-armv5te 
>>  --disable-armv6
>>  --disable-armv6t2 
>>  --disable-neon 
>>  --disable-vfp 
>>  --disable-mips32r2 
>>  --disable-mipsdspr1 
>>  --disable-mipsdspr2
>>  --disable-mipsfpu 
>>  --disable-altivec 
>>  --disable-vis
> These look *very* strange to me...

Again, I don't have support for these things added in because I have a x64 cpu. These are presumably generated so that same ebuild can generate a config command for a ppc chip for instance. 

>>  --disable-runtime-cpudetect
> ... I wonder if this is a good idea...
>>  --disable-stripping
>>  --disable-debug

Seems like the debug is due to me setting -debug. This generally produces smaller code that runs (very slightly) faster. Is there a reason to leave debug in?  The stripping is set by the maintainer without an option to do otherwise. 

> .. and these finally convince me you should use 
> something like
> --enable-gpl --enable-libx264 --enable-nonfree --enable-libfaac
> --enable-shared
> (maybe --cpu=host)
> Carl Eugen

If you think it will make a difference with this problem, I will, but I would rather keep ffmpeg managed by my package manager.

Nicholas Robbins

More information about the ffmpeg-user mailing list