[FFmpeg-user] DPX image sequence conversion issue

Stuart Bruce stuartrbruce at gmail.com
Fri Jan 3 21:04:18 CET 2014


I've come across an issue which is either my human error or an FFmpeg 
bug, and I'm not sure which.

I've got an image sequence of 150 DPX files, and I need to create a 
lo-res h264 MOV from them.

When I set the rate to 25fps, it works absolutely fine. The resulting 
file appears as 150 frames in QuickTime Player.

However when I change to 24fps (-r 24), which is what it should be for 
this particular footage, the resulting file only has 146 frames in it. 
Both FFprobe and QuickTime Player report that the resulting file has 146 
frames, even though it's the same source image sequence of 150 frames. 
There's no apparent error that I can see.

I haven't changed anything else about the command line except the rate.

I've attached a big dump of output below: the command line, then the 
output log, and then the FFprobe result, firstly for the 25fps version 
(which is fine) and then the 24fps version (which isn't).

I'd welcome any help please. If I'm doing something wrong, please point 
out it; alternatively if it's an FFmpeg issue, a work-around would be 
helpful as I'm hoping to get this working a.s.a.p.

Thanks

Stuart


Big pile of output text:

(1) - 25FPS import, works correctly. 
------------------------------------------------------------------

ffmpeg.exe -i e:\temp_dpx\s-tk-015-00400_edit_%04d.dpx
-r 25 -s 640x360 -pix_fmt yuv420p e:\temp_dpx\output_25.mov 2> 
e:\temp_dpx\25.tx
t

Output log:
ffmpeg version N-59488-g8a1714a Copyright (c) 2000-2014 the FFmpeg 
developers
   built on Jan  2 2014 22:01:54 with gcc 4.8.2 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads 
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r 
--enable-gnutls --enable-iconv --enable-libass --enable-libbluray 
--enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc 
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb 
--enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus 
--enable-librtmp --enable-libschroedinger --enable-libsoxr 
--enable-libspeex --enable-libtheora --enable-libtwolame 
--enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc 
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 
--enable-libxavs --enable-libxvid --enable-zlib
   libavutil      52. 59.100 / 52. 59.100
   libavcodec     55. 47.100 / 55. 47.100
   libavformat    55. 22.102 / 55. 22.102
   libavdevice    55.  5.102 / 55.  5.102
   libavfilter     4.  0.103 /  4.  0.103
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from 'e:\temp_dpx\s-tk-015-00400_edit_%04d.dpx':
   Duration: 00:00:06.00, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: dpx, gbrp10le, 1998x1122, 25 tbr, 25 tbn, 25 tbc
[libx264 @ 0035ee40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0035ee40] profile High, level 3.0
[libx264 @ 0035ee40] 264 - core 140 r2377 1ca7bb9 - H.264/MPEG-4 AVC 
codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - 
options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 
psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 
8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 
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=1 
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 
keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 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, mov, to 'e:\temp_dpx\output_25.mov':
   Metadata:
     encoder         : Lavf55.22.102
     Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 
640x360, q=-1--1, 12800 tbn, 25 tbc
Stream mapping:
   Stream #0:0 -> #0:0 (dpx -> libx264)
Press [q] to stop, [?] for help
frame=   25 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   49 fps= 48 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   73 fps= 47 q=28.0 size=      58kB time=00:00:00.84 bitrate= 
563.9kbits/s
frame=   96 fps= 47 q=28.0 size=      89kB time=00:00:01.76 bitrate= 
416.1kbits/s
frame=  118 fps= 46 q=28.0 size=     127kB time=00:00:02.64 bitrate= 
393.1kbits/s
frame=  141 fps= 46 q=28.0 size=     185kB time=00:00:03.56 bitrate= 
426.7kbits/s
frame=  150 fps= 43 q=-1.0 Lsize=     367kB time=00:00:05.92 bitrate= 
507.7kbits/s

video:365kB audio:0kB subtitle:0 global headers:0kB muxing overhead 
0.441655%
[libx264 @ 0035ee40] frame I:1     Avg QP:21.49  size: 18564
[libx264 @ 0035ee40] frame P:127   Avg QP:22.36  size:  2717
[libx264 @ 0035ee40] frame B:22    Avg QP:26.00  size:   442
[libx264 @ 0035ee40] consecutive B-frames: 80.0%  1.3%  0.0% 18.7%
[libx264 @ 0035ee40] mb I  I16..4: 10.9% 76.1% 13.0%
[libx264 @ 0035ee40] mb P  I16..4:  0.2%  1.6%  0.9%  P16..4: 20.3% 
6.0%  4.9%  0.0%  0.0%    skip:66.2%
[libx264 @ 0035ee40] mb B  I16..4:  0.0%  0.1%  0.0%  B16..8: 13.9% 
1.5%  0.5%  direct: 0.3%  skip:83.6%  L0:42.9% L1:55.6% BI: 1.5%
[libx264 @ 0035ee40] 8x8 transform intra:64.5% inter:65.4%
[libx264 @ 0035ee40] coded y,uvDC,uvAC intra: 79.0% 93.4% 75.6% inter: 
10.2% 15.0% 4.8%
[libx264 @ 0035ee40] i16 v,h,dc,p: 36% 20%  9% 35%
[libx264 @ 0035ee40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 19% 11%  7% 7%  
8%  8%  9%  9%
[libx264 @ 0035ee40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 17% 12%  8% 8%  
9%  7%  8%  7%
[libx264 @ 0035ee40] i8c dc,h,v,p: 38% 23% 24% 15%
[libx264 @ 0035ee40] Weighted P-Frames: Y:1.6% UV:0.8%
[libx264 @ 0035ee40] ref P L0: 71.3% 12.1%  8.3%  7.8%  0.5%
[libx264 @ 0035ee40] ref B L0: 83.3%  9.9%  6.8%
[libx264 @ 0035ee40] ref B L1: 80.7% 19.3%
[libx264 @ 0035ee40] kb/s:497.76

FFprobe analysis of result:
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/50
codec_tag_string=avc1
codec_tag=0x31637661
width=640
height=360
has_b_frames=2
sample_aspect_ratio=0:1
display_aspect_ratio=0:1
pix_fmt=yuv420p
level=30
timecode=N/A
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/12800
start_pts=0
start_time=0.000000
duration_ts=76800
duration=6.000000
bit_rate=498680
nb_frames=150
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=eng
TAG:handler_name=DataHandler
[/STREAM]

(2) - 24FPS import 
----------------------------------------------------------------------------------------------------------------
works incorrectly, gives a 146-frame result instead of the 150 frames it 
should be.

ffmpeg.exe -i e:\temp_dpx\s-tk-015-00400_edit_%04d.dpx
-r 24 -s 640x360 -pix_fmt yuv420p e:\temp_dpx\output_24.mov 2> 
e:\temp_dpx\24.tx
t

Output log is the same as above, until:
Output #0, mov, to 'e:\temp_dpx\output_24.mov':
   Metadata:
     encoder         : Lavf55.22.102
     Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 
640x360, q=-1--1, 12288 tbn, 24 tbc
Stream mapping:
   Stream #0:0 -> #0:0 (dpx -> libx264)
Press [q] to stop, [?] for help
frame=   25 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   49 fps= 48 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   71 fps= 46 q=28.0 size=      58kB time=00:00:00.79 bitrate= 
605.2kbits/s dup=0 drop=1
frame=   92 fps= 45 q=28.0 size=      89kB time=00:00:01.66 bitrate= 
435.4kbits/s dup=0 drop=2
frame=  114 fps= 45 q=28.0 size=     122kB time=00:00:02.58 bitrate= 
386.1kbits/s dup=0 drop=3
frame=  137 fps= 45 q=28.0 size=     183kB time=00:00:03.54 bitrate= 
422.9kbits/s dup=0 drop=4
frame=  146 fps= 42 q=-1.0 Lsize=     364kB time=00:00:06.00 bitrate= 
497.1kbits/s dup=0 drop=4

video:362kB audio:0kB subtitle:0 global headers:0kB muxing overhead 
0.464572%
[libx264 @ 0278ee40] frame I:1     Avg QP:21.36  size: 18808
[libx264 @ 0278ee40] frame P:118   Avg QP:22.08  size:  2859
[libx264 @ 0278ee40] frame B:27    Avg QP:26.01  size:   526
[libx264 @ 0278ee40] consecutive B-frames: 74.0%  2.7%  4.1% 19.2%
[libx264 @ 0278ee40] mb I  I16..4:  9.2% 78.9% 11.8%
[libx264 @ 0278ee40] mb P  I16..4:  0.2%  1.7%  0.9%  P16..4: 20.6% 
5.9%  5.3%  0.0%  0.0%    skip:65.4%
[libx264 @ 0278ee40] mb B  I16..4:  0.0%  0.2%  0.1%  B16..8: 15.5% 
2.0%  0.7%  direct: 0.3%  skip:81.3%  L0:38.5% L1:59.0% BI: 2.5%
[libx264 @ 0278ee40] 8x8 transform intra:64.5% inter:65.4%
[libx264 @ 0278ee40] coded y,uvDC,uvAC intra: 78.2% 93.5% 75.3% inter: 
10.2% 14.8% 4.8%
[libx264 @ 0278ee40] i16 v,h,dc,p: 35% 19%  6% 39%
[libx264 @ 0278ee40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 19% 12%  7% 7%  
8%  8%  9% 10%
[libx264 @ 0278ee40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 17% 12%  8% 8%  
9%  7%  8%  6%
[libx264 @ 0278ee40] i8c dc,h,v,p: 39% 23% 23% 15%
[libx264 @ 0278ee40] Weighted P-Frames: Y:1.7% UV:0.8%
[libx264 @ 0278ee40] ref P L0: 70.6% 12.0%  9.0%  7.9%  0.5%
[libx264 @ 0278ee40] ref B L0: 85.0%  9.7%  5.3%
[libx264 @ 0278ee40] ref B L1: 86.7% 13.3%
[libx264 @ 0278ee40] kb/s:487.06

FFprobe analysis of result:
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/48
codec_tag_string=avc1
codec_tag=0x31637661
width=640
height=360
has_b_frames=2
sample_aspect_ratio=0:1
display_aspect_ratio=0:1
pix_fmt=yuv420p
level=30
timecode=N/A
id=N/A
r_frame_rate=24/1
avg_frame_rate=24/1
time_base=1/12288
start_pts=0
start_time=0.000000
duration_ts=74752
duration=6.083333
bit_rate=487964
nb_frames=146
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=eng
TAG:handler_name=DataHandler
[/STREAM]


-- 
Stuart Bruce
stuart at stuartbruce.co.uk



More information about the ffmpeg-user mailing list