Kodi Community Forum

Full Version: Handbrake VFR/CFR Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all --

I think this post would probably fit better in the "off topic" section of the forums, but I tried to post there several times and it tells me I don't have permission to start a new thread. No problem here, though, and this this next most appropriate place I could think to post it.

The question is probably pretty basic for those of you who have been doing this a while, but searches across several sites and forums (including Handbrake's own) mainly seem to find posts that are full of what turns out to be misinformation.

So, to get to it:

* I am converting my optical media to .mkv files for use in my HTPC, which relies on an AMD A4-3400 APU and displayed on a 55" LED HDTV. I don't intend on playing any of them streaming or on a portable device.

* The optical media in question is roughly 90% NTSC DVDs from films (mainstream movies), 5% Blu-ray, and 5% commercial DVDs from television shows or concert / music video.

* I'm ripping to VIDEO_TS folders using AnyDVD HD and then transcoding with Handbrake (h.264/x264).

In researching the various settings to use for the transcoding (h.264 format), I've seen assertions that CFR should essentially always be used and set to the 29.xxx NTSC framerate. However, the Handbrake manual seems to suggest that VFR would be preferred because different parts of a title may be created at different framerates (film vs computer generated titles vs video, etc) and the VFR will keep to the original framerate and sequence for each part.

As always, I'm sure the answer to this question depends to large extent on my goals and the usual tradeoffs: quality vs. file size vs. transcode time (FPS). My goal is to minimize resulting file size and transcode time while keeping the resulting video essentially identical to the original (to my eye). For DVD, this seems to correspond to a CRF of 18 with a modified High Profile present.

Since I'm not planning on streaming these files or viewing them on any kind of portable device, is there really any advantage to using constant framerate over variable -- or vice versa?

(Again, sorry this is off-topic and not exactly in the right place. Thus far I've found people to provide more helpful answers to questions on the XBMC forums than on Handbrake's own, so I thought I'd give it a shot here.)


Hi there,

in the first place you should ask yourself if recompression is needed at all. Compared to HD material (HDTV / Bluray) DVDs are rather small in size. You could stick to using MKV as target container and simply convert your DVDs over to MKV with MakeMKV. This would keep the original DVD audio, video and subtitle streams and store them uncompressed in an MKV container.

In regard to your question:
It depends on your aims what bitrate control / encoding method you use.

If you aim for a specific size of your movies then a constant bitrate method (best combined with multipass) is your choice.
Pro: You always know how big your movie will be for a specific bitrate.

Con: It is not guaranteed that you have a constant quality. If you choose a "too high" bitrate, then movies with a high action level with look good and show no compression artifacts / loss in detail but for movies with a low action level, you will wast bitrate and thus space. Those movies would look good at a much lower bitrate and thus a smaller filesize.
Also encoding takes about the double time if you stick to two-pass mode (what you should do).

If you aim for constant quality and are not space-limited, then any CQ / CRF-based encoding makes sense. You may first experiment a bit to find out which CRF value suits your quality aim (I usually stick to 21-22 for BD encoding). A quality-based bitrate control algorithm will make shure that the encoded video always gets "enough bitrate" to match the quality value you have choosen. Today a 2 TB HDD usually costs below 80€. So we are not really space-limited Smile

Pro: Constant quality. Faster than 2-pass bitrate encoding (only 50% of the time)
Con: Size of movie not predictable.

For automation of the whole process you might have a closer look at the commandline interfaces of MakeMKV and Handbrake:
http://www.makemkv.com/developers/usage.txt
https://trac.handbrake.fr/wiki/CLIGuide

HTH,
Holger