[FFmpeg-user] Strange -vf fps and -r behavior

Nicholas Robbins nickrobbins at yahoo.com
Wed Apr 16 02:47:01 CEST 2014


So I have a mkv that I pulled from a DVD. It thinks it is "30" fps but it is really "24". ffprobe gives 

Stream #0:0(eng): Video: mpeg2video (Main), yuv420p, 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc

but if I actually count the frames I get 23.97 fps. Ok so when I transcode it to libx264 with the command 

ffmpeg -i IN.mkv -map 0 -c:a copy -c:s copy -c:v libx264 -crf 25 -preset ultrafast -vf fps=fps=24000/1001 OUT.mkv

Some parts of it now appear to be at 12 fps. Stepping frame by frame it appears that in those sections the video is at 24 fps but each frame is doubled. 

If I extract the parts that do this and run them through the command on their own, no problem. Is this a bug, or am I doing something wrong?

I can make the problem go away if I use -r 24000/1001 instead, but my understanding is that -vf fps is preferred to -r.

Console output of "-vf fps=fps=24000/1001" version follows:

ffmpeg version N-62473-g79d82a6 Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr 15 2014 20:04:32 with gcc 4.7.3 (Gentoo Hardened 4.7.3-r1 p1.4, 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 --enable-runtime-cpudetect --enable-debug --disable-doc --disable-gnutls --enable-hardcoded-table
s --enable-iconv --enable-network --disable-openssl --disable-ffplay --disable-vaapi --disable-vdpau --disable-xlib --enable-zlib --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libmp3lame
 --disable-libaacplus --enable-libfaac --disable-libtheora --disable-libtwolame --disable-libwavpack --disable-libwebp --enable-libx264 --disable-libx265 --enable-libxvid --disable-libcdio --disabl
e-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --disable-opengl --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 --dis
able-libbluray --disable-libcelt --disable-libgme --disable-libgsm --disable-libmodplug --disable-libopus --disable-libquvi --disable-librtmp --disable-libssh --disable-libschroedinger --disable-li
bspeex --disable-libvorbis --disable-libvpx --disable-libzvbi --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-mips32r2 --disable-mipsdspr1 --disable-mipsd
spr2 --disable-mipsfpu --disable-altivec --disable-amd3dnow --disable-amd3dnowext --disable-avx --disable-avx2 --disable-fma3 --disable-fma4 --disable-sse3 --disable-sse4 --disable-sse42 --enable-pic --cpu=host
  libavutil      52. 76.100 / 52. 76.100
  libavcodec     55. 58.103 / 55. 58.103
  libavformat    55. 37.100 / 55. 37.100
  libavdevice    55. 13.100 / 55. 13.100
  libavfilter     4.  4.100 /  4.  4.100
  libavresample   1.  2.  0 /  1.  2.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, matroska,webm, from '/var/srv/media/videos/NO-BACKUP-holding/transcoding/2014-04-15-Tue-20-38/Law.and.Order.Criminal.Intent.2001.S03E02.film.mkv':
  Metadata:
    encoder         : libmakemkv v1.8.8 (1.3.0/1.4.1) x86_64-pc-linux-gnu
    creation_time   : 2014-02-14 03:09:14
  Duration: 00:43:56.37, start: 0.000000, bitrate: 5981 kb/s
    Chapter #0.0: start 0.000000, end 615.748467
    Metadata:
      title           : Chapter 01
    Chapter #0.1: start 615.748467, end 1140.539400
    Metadata:
      title           : Chapter 02
    Chapter #0.2: start 1140.539400, end 1677.475800
    Metadata:
      title           : Chapter 03
    Chapter #0.3: start 1677.475800, end 2636.367067
    Metadata:
      title           : Chapter 04
    Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, smpte170m), 720x480 [SAR 8:9 DAR 4:3], max. 9800 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc
    Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : Stereo
    Stream #0:2(eng): Subtitle: dvd_subtitle, 720x480
    Stream #0:3(spa): Subtitle: dvd_subtitle, 720x480
    Stream #0:4(fre): Subtitle: dvd_subtitle, 720x480
[libx264 @ 0x34b9e753d0] using SAR=8/9
[libx264 @ 0x34b9e753d0] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x34b9e753d0] profile Constrained Baseline, level 3.0
[libx264 @ 0x34b9e753d0] 264 - core 120 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 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=0 weightp=0 keyint=250 keyint_min=23 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, matroska, to '/tmp/transcode//Law.and.Order.Criminal.Intent.2001.S03E02.film.mkv':
  Metadata:
    encoder         : Lavf55.37.100
    Chapter #0.0: start 0.000000, end 615.748467
    Metadata:
      title           : Chapter 01
    Chapter #0.1: start 615.748467, end 1140.539400
    Metadata:
      title           : Chapter 02
    Chapter #0.2: start 1140.539400, end 1677.475800
    Metadata:
      title           : Chapter 03
    Chapter #0.3: start 1677.475800, end 2636.367067
    Metadata:
      title           : Chapter 04
    Stream #0:0(eng): Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=-1--1, 1k tbn, 23.98 tbc
    Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, 192 kb/s
    Metadata:
      title           : Stereo
    Stream #0:2(eng): Subtitle: dvd_subtitle, 720x480
    Stream #0:3(spa): Subtitle: dvd_subtitle, 720x480
    Stream #0:4(fre): Subtitle: dvd_subtitle, 720x480
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libx264)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
  Stream #0:3 -> #0:3 (copy)
  Stream #0:4 -> #0:4 (copy)
Press [q] to stop, [?] for help
frame=63210 fps=158 q=-1.0 Lsize=  375421kB time=00:43:56.38 bitrate=1166.5kbits/s    
video:306658kB audio:61790kB subtitle:5896kB other streams:0kB global headers:2kB muxing overhead: 0.287864%
[libx264 @ 0x34b9e753d0] frame I:253   Avg QP:21.47  size: 28960
[libx264 @ 0x34b9e753d0] frame P:62957 Avg QP:24.39  size:  4871
[libx264 @ 0x34b9e753d0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x34b9e753d0] mb P  I16..4:  5.2%  0.0%  0.0%  P16..4: 40.6%  0.0%  0.0%  0.0%  0.0%    skip:54.2%
[libx264 @ 0x34b9e753d0] coded y,uvDC,uvAC intra: 34.8% 29.2% 9.3% inter: 18.1% 9.5% 0.4%
[libx264 @ 0x34b9e753d0] i16 v,h,dc,p: 42% 27% 19% 12%
[libx264 @ 0x34b9e753d0] i8c dc,h,v,p: 49% 20% 25%  5%
[libx264 @ 0x34b9e753d0] kb/s:952.87
bench: utime=753.019s
bench: maxrss=27660kB



More information about the ffmpeg-user mailing list