Changes between Version 5 and Version 6 of Encode/VFX


Ignore:
Timestamp:
Nov 7, 2012, 6:02:26 AM (7 years ago)
Author:
jakubk
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Encode/VFX

    v5 v6  
    6767Like prores, H264 understands the concept of "profiles". These are basically just encoding presets grouped together in a convenient keyword. Existing profiles are: baseline, main, high, high10, high422, high444. Apple's Quicktime only supports *baseline* and *main* profiles and it only supports the 420 colorspace. There are three types of quality settings for H264: bitrate, -qp and -crf. Bitrate is only useful for 2 pass encoding which is not really the best encoding method for this kind of workflow. -qp is the second one and -crf is the third. -qp and -crf are basically the same, with -crf resulting in a smaller file. [http://mewiki.project357.com/wiki/X264_Settings#qp This guide] contains a good writeup and description for these options. Based on testing we found that -crf is definitely the way to go and recommend using -crf as the main quality control parameter for H264 encoded movies. A crf value of 0 produces lossless and very large movies which are unplayable at high (2K+) resolutions. The playback problem continues with increasing CRF values, but becomes manageable at around crf 15 and higher. We found that a crf value of 19 produces very good movies with a very small file size and they should generally play back on reasonable hardware (apple laptops made in the last 2-3 years).
    6868
    69 As stated before, the main problem with H264 is the frame-by-frame scrubbing, but aside from that we found that it produces the most color correct output and clips of very high quality. For purely playback applications it is definitely the codec to go with, as it plays on pretty much everything. One thing to keep in mind is that encoding H264 does take the longest out of all the three codecs we tested. (but we haven't played with encoder optimization because we were after the best quality clips, so your mileage may vary).
     69==== Frame-by-Frame scrubbing
     70As stated before, the main problem with H264 is the frame-by-frame scrubbing, but aside from that we found that it produces the most color correct output and clips of very high quality. For purely playback applications it is definitely the codec to go with, as it plays on pretty much everything. One way around this is to make every frame in the H264 clip an I-frame. This will eliminate the presence of P-frames and B-frames but will therefore pretty much eliminate the incredible space savings that H264 offers. This is achieved by setting the -bf parameter to 0 (-bf stands for bframe) and the -g (keyint) parameter to 1. Using these settings will require a lower CRF setting, usually around 7 - 11 would be good. If a clip is encoded like this with only I-frames, then scrubbing frame-by-frame is no longer a problem and the playback is actually much better and easier, as there is no need to compute the P-frames out of the I-frames.
    7071
    71 An example command line for using H264 as an encoder would be:
     72An example command line for using H264 (with only I-frames) as an encoder would be:
    7273{{{
    73 TODO
     74# 2k stereo @ 48 fps (420)
     75ffmpeg -y -probesize 5000000 -f image2 -r 48 -force_fps -i ${DPX_HERO} -probesize 5000000 -f image2 -r $48 -force_fps -i ${DPX_2ND} -c:v libx264 -profile:v main -g 1 -tune stillimage -crf 9 -bf 0 -vendor ap10 -pix_fmt yuv420p -s 2048x1152 -r 48 -map 0:0 -map 1:0 -metadata stereo_mode=left_right output.mov
    7476}}}
     77
     78== Size comparison
     79This chapter provides an overview of the size and bitrates of the resulting clips when generated using different codecs and different settings.
     80||= Codec =||= Colorspace =||= Resolution =||= Bitrate kbps =||= FPS =||= Size =||= Settings =||
     81|| apch || yuv422p10le || 2048x1152 || 298810   || 48   || 342M || Prores HQ qscale 5 ||
     82|| apch || yuv422p10le || 2048x1152 || 123706 || 48 || 142M|| Prores HQ qscale 15 ||
     83|| apcn || yuv422p10le || 2048x1152 || 226430 || 48 || 260M || Prores SQ qscale 5 ||
     84|| apcn || yuv422p10le || 2048x1152 || 98805 || 48 || 114M || Prores SQ qscale 15 ||
     85|| apcs || yuv422p10le || 2048x1152 || 177594 || 48 || 204M || Prores LT qscale 5 ||
     86|| apcs || yuv422p10le || 2048x1152 || 79015 || 48 || 91M || Prores LT qscale 5 ||
     87|| jpeg || yuvj422p || 2048x1152 || 134660 || 48 || 155M || Photo JPEG qscale 1 ||
     88|| avc1 || yuvj422p || 2048x1152 || 207538 || 48 || 238M || H264, keyint = 1, CRF 7 ||
     89|| avc1 || yuvj422p || 2048x1152 || 130145 || 48 || 149M || H264, keyint = 1, CRF 11 ||
     90|| avc1 || yuvj422p || 2048x1152 || 21865 || 48 || 26M || H264, keyint = 48, CRF 17 ||
     91|| avc1 || yuvj422p || 2048x1152 || 146389 || 48 || 168M || H264, keyint = 48, CRF 7 ||
     92|| avc1 || yuvj422p || 2048x1152 || 286524 || 48 || 328M || H264, keyint = 48, CRF 1 ||