[FFmpeg-user] H.264 Quicktime encoded file stutters
Marcelo Boufleur
mboufleur at gmail.com
Thu Nov 27 21:24:38 CET 2014
After some more testing, it seems to me that the problem does not lie in
H.264 encoding, but in Quicktime container itself.
I made another test, and encoded the MXF into Quicktime ProRes, which
played fine in Quicktime Player. No stutter, no issues, it was ok.
Then, I grabbed this ffmpeg-ProRes file and fed it to Compressor in order
to create a final H.264 file. The resulting file ended up having a stutter
just like the original H.264 ffmpeg file.
When played side by side, the H.264 file from ffmpeg and the H.264 file
from ffmpeg>compressor seemed very similar. The main difference was that
the original H.264 ffmpeg file had all frames (i.e. when moving frame by
frame in Quicktime player, it was possible to see that all frames were
indeed in the file), and the H.264 file converted by Compressor had
duplicated frames that indeed caused the stutter effect when played.
So there may be something or some timebase in the final Quicktime container
that my get messed up in Apple software and/or workflow (the "tbn"
perhaps?).
2014-11-27 17:33 GMT-02:00 Marcelo Boufleur <mboufleur at gmail.com>:
> Hello everyone,
>
> I am still quite new to ffmpeg, but I'm already using it to convert some
> content - mostly to Quicktime format.
>
> During one of these attempts, I wanted to convert a JPEG2000 MXF file from
> a DCP into Quicktime file with H.264 codec, that would mimic the same
> experience as if the file would be encoded with Quicktime player itself (or
> maybe Compressor).
>
> At the end, this Quicktime file would be played using a windows PC with
> the Quicktime Player, so my goal was to create the exact same experience.
>
> I created a small sample from Quicktime player and then compared it to the
> same file created using ffmpeg. At first, I was able to adjust all settings
> in ffmpeg (CAVLC, ref frames, b-frames, resolution, bitrate, etc) to mimic
> all configurations used by the H.264 file created by Quicktime player.
>
> The info was provided by Mediainfo, and although not all parameters for
> H.264 were there, the ffmpeg generated file seemed to equalize all settings.
>
> Unfortunately, when played in Quicktime player, the final ffmpeg H.264
> file would stutter. The original movie frame rate had 24fps, and Quicktime
> would play only 16fps on average.
>
> This is the command line I am currently using:
>
> ffmpeg -r 24 -i Input.mxf -vf "scale=1920:1038,pad=1920:1080:0:21"
> -pix_fmt yuv420p -c:v libx264 -r 24 -profile:v main -level 4.1 -preset
> faster -coder 0 -crf 21 -x264opts
> keyint=60:bframes=1:ref=2:qpmin=4:b-pyramid=0 Output.mov
>
> And this is the console output:
>
> ffmpeg version N-67501-g064a237 Copyright (c) 2000-2014 the FFmpeg
> developers
> built on Nov 9 2014 22:52:31 with gcc 4.9.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-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme
> --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-libwebp
> --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
> --enable-zlib
> libavutil 54. 11.100 / 54. 11.100
> libavcodec 56. 12.100 / 56. 12.100
> libavformat 56. 12.103 / 56. 12.103
> libavdevice 56. 2.100 / 56. 2.100
> libavfilter 5. 2.103 / 5. 2.103
> libswscale 3. 1.101 / 3. 1.101
> libswresample 1. 1.100 / 1. 1.100
> libpostproc 53. 3.100 / 53. 3.100
> [mxf @ 0000000004e833a0] "OPAtom" with 2 ECs - assuming OP1a
> Input #0, mxf, from 'MORTDECAI_TLR_S_QBP-XX_ENC-reel-1-jp2k.mxf':
> Metadata:
> uid : 5831cb6f-9270-4545-a789-5b79221e0074
> generation_uid : 9583e162-55e1-46ac-b111-4ee032c5f74e
> company_name : QubeCinema, Inc.
> product_name : QubeMaster Pro
> product_version : 2.5
> product_uid : a6d3ea56-8155-4dfc-86f6-664b12671427
> modification_date: 1969-08-14 04:58:00
> application_platform: win32
> timecode : 00:00:00:00
> Duration: 00:01:38.42, start: 0.000000, bitrate: 91072 kb/s
> Stream #0:0: Video: jpeg2000 (JPEG 2000 digital cinema 2K), xyz12le,
> 2048x858, 24 tbr, 24 tbn, 24 tbc
> [libx264 @ 0000000002def280] using cpu capabilities: MMX2 SSE2Fast SSSE3
> SSE4.2
> [libx264 @ 0000000002def280] profile Main, level 4.1
> [libx264 @ 0000000002def280] 264 - core 142 r2479 dd79a61 - H.264/MPEG-4
> AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html -
> options: cabac=0 ref=2 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=4 psy=1
> psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0
> cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=36
> lookahead_threads=8 sliced_threads=0 nr=0 decimate=1 interlaced=0
> bluray_compat=0 constrained_intra=0 bframes=1 b_pyramid=0 b_adapt=1
> b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=60 keyint_min=6
> scenecut=40 intra_refresh=0 rc_lookahead=20 rc=crf mbtree=1 crf=21.0
> qcomp=0.60 qpmin=4 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
> Output #0, mov, to 'Test.mov':
> Metadata:
> uid : 5831cb6f-9270-4545-a789-5b79221e0074
> generation_uid : 9583e162-55e1-46ac-b111-4ee032c5f74e
> company_name : QubeCinema, Inc.
> product_name : QubeMaster Pro
> product_version : 2.5
> product_uid : a6d3ea56-8155-4dfc-86f6-664b12671427
> modification_date: 1969-08-14 04:58:00
> application_platform: win32
> timecode : 00:00:00:00
> encoder : Lavf56.12.103
> Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
> 1920x1080, q=-1--1, 24 fps, 12288 tbn, 24 tbc
> Metadata:
> encoder : Lavc56.12.100 libx264
> Stream mapping:
> Stream #0:0 -> #0:0 (jpeg2000 (native) -> h264 (libx264))
> Press [q] to stop, [?] for help
> frame= 2362 fps=9.4 q=-1.0 Lsize= 52668kB time=00:01:38.37
> bitrate=4385.8kbits/s
> video:52642kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: 0.049134%
> [libx264 @ 0000000002def280] frame I:73 Avg QP:17.39 size:139477
> [libx264 @ 0000000002def280] frame P:1431 Avg QP:19.90 size: 25280
> [libx264 @ 0000000002def280] frame B:858 Avg QP:20.86 size: 8797
> [libx264 @ 0000000002def280] consecutive B-frames: 27.3% 72.7%
> [libx264 @ 0000000002def280] mb I I16..4: 51.5% 0.0% 48.5%
> [libx264 @ 0000000002def280] mb P I16..4: 15.0% 0.0% 2.6% P16..4:
> 29.8% 6.5% 1.2% 0.0% 0.0% skip:44.9%
> [libx264 @ 0000000002def280] mb B I16..4: 1.6% 0.0% 0.3% B16..8:
> 13.1% 3.0% 0.1% direct:11.6% skip:70.4% L0:38.5% L1:54.3% BI: 7.1%
> [libx264 @ 0000000002def280] coded y,uvDC,uvAC intra: 34.6% 64.0% 28.7%
> inter: 8.6% 22.5% 1.1%
> [libx264 @ 0000000002def280] i16 v,h,dc,p: 49% 21% 17% 13%
> [libx264 @ 0000000002def280] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 18% 15%
> 7% 8% 8% 7% 7% 5%
> [libx264 @ 0000000002def280] i8c dc,h,v,p: 55% 18% 21% 6%
> [libx264 @ 0000000002def280] Weighted P-Frames: Y:10.3% UV:5.0%
> [libx264 @ 0000000002def280] ref P L0: 74.0% 26.0%
> [libx264 @ 0000000002def280] kb/s:4381.77
>
>
> Any ideas what may be wrong?
>
More information about the ffmpeg-user
mailing list