[FFmpeg-user] Error on 2-pass x264: timebase mismatch with 1st pass (50/2997 vs 1001/30000)

sean darcy seandarcy2 at gmail.com
Sun May 8 15:20:16 CEST 2011


Pass 1 works. Pass 2 dies with timebase mismatch:

ffmpeg -i play.dv -an -pass 1 -vf yadif=1:0,hqdn3d -vcodec libx264 
-preset slower -tune film -r 59.94 -b 4000k -threads 0 -f null -y /dev/null

which runs fine, no errors:

ffmpeg version git-N-29568-g3b4621a, Copyright (c) 2000-2011 the FFmpeg 
developers
   built on May  2 2011 13:50:23 with gcc 4.6.0 20110428 (Red Hat 4.6.0-6)
   configuration: --prefix=/usr --bindir=/usr/bin 
--datadir=/usr/share/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man 
--shlibdir=/usr/lib64 --extra-cflags='-O2 -march=native -mtune=native 
-fopenmp -fomit-frame-pointer -pipe' --enable-static --enable-shared 
--enable-gpl --enable-nonfree --enable-version3 --enable-postproc 
--enable-avfilter --enable-pthreads --enable-x11grab --enable-gray 
--enable-vaapi --enable-hardcoded-tables --enable-frei0r 
--enable-libdirac --disable-decoder=libdirac --enable-libgsm 
--enable-libmp3lame --enable-libopenjpeg --enable-librtmp 
--enable-libschroedinger --disable-encoder=libschroedinger 
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx 
--enable-libx264 --enable-libxvid --enable-zlib --disable-debug 
--cpu=amdfam10 --arch=x86_64 --enable-pic --enable-libopencv
   libavutil    51.  2. 0 / 51.  2. 0
   libavcodec   53.  3. 0 / 53.  3. 0
   libavformat  53.  0. 3 / 53.  0. 3
   libavdevice  53.  0. 0 / 53.  0. 0
   libavfilter   2.  4. 0 /  2.  4. 0
   libswscale    0. 14. 0 /  0. 14. 0
   libpostproc  51.  2. 0 / 51.  2. 0
[dv @ 0x2797f00] Estimating duration from bitrate, this may be inaccurate
Input #0, dv, from 'play.dv':
   Duration: 00:51:08.43, start: 0.000000, bitrate: 28771 kb/s
     Stream #0.0: Video: dvvideo, yuv411p, 720x480, 28771 kb/s, PAR 8:9 
DAR 4:3, 29.97 tbr, 29.97 tbn, 29.97 tbc
     Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Incompatible pixel format 'yuv411p' for codec 'libx264', auto-selecting 
format 'yuv420p'
[buffer @ 0x279e0a0] w:720 h:480 pixfmt:yuv411p
[yadif @ 0x279ebc0] mode:1 parity:0
[hqdn3d @ 0x279f220] ls:4.000000 cs:3.000000 lt:6.000000 ct:4.500000
[hqdn3d @ 0x279f220] auto-inserting filter 'auto-inserted scaler 0' 
between the filter 'Parsed filter 0 yadif' and the filter 'Parsed filter 
1 hqdn3d'
[scale @ 0x279f8e0] w:720 h:480 fmt:yuv411p -> w:720 h:480 fmt:yuv420p 
flags:0xa0000004
[libx264 @ 0x279afc0] using SAR=8/9
[libx264 @ 0x279afc0] using cpu capabilities: MMX2 SSE2Fast FastShuffle 
SSEMisalign LZCNT
[libx264 @ 0x279afc0] profile Main, level 3.1
Output #0, null, to '/dev/null':
   Metadata:
     encoder         : Lavf53.0.3
     Stream #0.0: Video: libx264, yuv420p, 720x480 [PAR 8:9 DAR 4:3], 
q=2-31, pass 1, 4000 kb/s, 90k tbn, 59.94 tbc
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=183920 fps=121 q=0.0 Lsize=      -0kB time=3068.37 bitrate= 
-0.0kbits/s
video:0kB audio:0kB global headers:0kB muxing overhead -inf%
final ratefactor: 19.69

But pass 2 dies:

ffmpeg -i play.dv -an -pass 2 -vf yadif=1:0,hqdn3d -vcodec libx264 
-preset slower -tune film -r 59.94 -timestamp now -b 4000k -threads 0 
Play-yadif1-4000k.m4v
..........
[dv @ 0x22f6f00] Estimating duration from bitrate, this may be inaccurate
Input #0, dv, from 'play.dv':
   Duration: 00:51:08.43, start: 0.000000, bitrate: 28771 kb/s
     Stream #0.0: Video: dvvideo, yuv411p, 720x480, 28771 kb/s, PAR 8:9 
DAR 4:3, 29.97 tbr, 29.97 tbn, 29.97 tbc
     Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Incompatible pixel format 'yuv411p' for codec 'libx264', auto-selecting 
format 'yuv420p'
[buffer @ 0x22fd260] w:720 h:480 pixfmt:yuv411p
[yadif @ 0x22fdd20] mode:1 parity:0
[hqdn3d @ 0x22fe380] ls:4.000000 cs:3.000000 lt:6.000000 ct:4.500000
[hqdn3d @ 0x22fe380] auto-inserting filter 'auto-inserted scaler 0' 
between the filter 'Parsed filter 0 yadif' and the filter 'Parsed filter 
1 hqdn3d'
[scale @ 0x22fea00] w:720 h:480 fmt:yuv411p -> w:720 h:480 fmt:yuv420p 
flags:0xa0000004
[libx264 @ 0x22f9fc0] using SAR=8/9
[libx264 @ 0x22f9fc0] using cpu capabilities: MMX2 SSE2Fast FastShuffle 
SSEMisalign LZCNT
[libx264 @ 0x22f9fc0] timebase mismatch with 1st pass (50/2997 vs 
1001/30000)
Output #0, ipod, to 'Play-yadif1-4000k.m4v':
     Stream #0.0: Video: libx264, yuv420p, 720x480 [PAR 8:9 DAR 4:3], 
q=2-31, pass 2, 4000 kb/s, 90k tbn, 59.94 tbc
Stream mapping:
   Stream #0.0 -> #0.0
Error while opening encoder for output stream #0.0 - maybe incorrect 
parameters such as bit_rate, rate, width or height

I also tried this without putting a framerate in pass 1. Same result. 
Also used -r 1001/60000, again same result:

[libx264 @ 0xdd10c0] timebase mismatch with 1st pass (1001/60000 vs 
1001/30000)

How do you ( can you) do a 2 pass encoding while changing the frame rate?

sean



More information about the ffmpeg-user mailing list