Changes between Version 4 and Version 5 of Encode/VFX


Ignore:
Timestamp:
Nov 7, 2012, 2:09:19 AM (7 years ago)
Author:
jakubk
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Encode/VFX

    v4 v5  
    3030}}}
    3131
    32 This tells ffmpeg to take input stream #0 and input stream #1 and map both of them into output stream #0. It is possible which eye gets assigned to which track by changing the order of the -map arguments. Once a movie like this is opened in Quicktime, it will show as having 2 video tracks. It is then entirely up to the player that is used for playback to determine how to display this movie in 3D. RV for instance does it by default - all that needs to be done is to turn on stereo mode, but other players may require more tweaking. The metadata tag is potentially optional, I have not tested what happens if it is omitted.
     32This tells ffmpeg to take input stream #0 and input stream #1 and map both of them into output stream #0. It is possible to control which eye gets assigned to which track by changing the order of the -map arguments. Once a movie like this is opened in Quicktime, it will show as having 2 video tracks. It is then entirely up to the player that is used for playback to determine how to display this movie in 3D. RV for instance does it by default - all that needs to be done is to turn on stereo mode, but other players may require more tweaking. The metadata tag is potentially optional, I have not tested what happens if it is omitted.
    3333
    3434=== Prores
     
    5454
    5555=== Photo JPEG
    56 Photo JPEG is a reliable codec that produces movie clips readable on any architecture. There may be problems with playback in high (2K and over) resolutions and there are obviously file space considerations with this codec. Using lossless JPEG does not create very well compressed movies.
     56Photo JPEG is a reliable codec that produces movie clips readable on any architecture / OS. There may be problems with playback in high (2K and over) resolutions and there are obviously file space considerations with this codec. Using lossless JPEG does not create very well compressed movies. Based on empiric testing, resolutions up to 1K are perfectly ok with using Photo JPEG, but 2K and above do struggle quite a bit. When generating a Photo JPEG movie clip there is really only one setting which is relevant - qscale and it should be set to 1. The command line for generating a Photo JPEG movie is as follows:
     57{{{
     58# 2k mono @ 48 fps (422)
     59ffmpeg -y -probesize 5000000 -f image2 -r 48 -force_fps -i ${DPX_HERO} -c:v mjpeg -qscale:v 1 -vendor ap10 -pix_fmt yuvj422p -s 2048x1152 -r 48 output.mov
     60}}}
     61
     62=== H.264
     63H264 is the newest codec and it seems to be the plumbing that powers all of the videos on the internet. It's extremely efficient at compression - the resulting movie clips are easily 1/10th the size of the same clip made with prores, but it lacks in one critical area. Because of its heavy use of temporal compression, H264 encoded clips are very difficult to scrub frame-by-frame, especially going backwards. It needs to decode frames based on other nearby frames and this is not an easy task. It is very likely that H264 will not be able to be used in reviews that require frame-by-frame scrubbing, but it is an excellent and space-efficient codec for any playback only related workflows. And of course for mobile devices.
     64
     65H.264 support in ffmpeg is done through VLC's libx264 which is most likely the best H264 encoder out there. If compiling ffmpeg/libx264 manually, please see some of the excellent guides such as the UbuntuCompilationGuide. Reasonably detailed instructions on the plethora of H264 options can be found in the existing x264EncodingGuide. We will detail some of the missing information in this guide.
     66
     67Like 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).
     68
     69As 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).
     70
     71An example command line for using H264 as an encoder would be:
     72{{{
     73TODO
     74}}}