Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Release group LOL does an excellent job at encoding their releases on The Vampire Diaries (on other shows like How I Met Your Mother the bitrate is higher, so doesn't seem this effective).

About 200 MB each ~45mins MP4 file, amazing quality considering.

I just wonder what settings and what software they use. I've tried to get info from these files using MediaInfo, then use the settings in HandBrake, but I didn't really succeed.

Could anyone please help me? I don't have much knowledge about encoding/compressing.

share|improve this question

2 Answers 2

The guidelines for encoding (pirated) video are called "scene guides". They are signed by various release groups who will make sure their videos comply to the guide, LOL being one of these groups.

You can find a list of scene guides on scenerules.irc.gs. The standard you're looking for is—if I'm not mistaken—the SD x264 TV Releasing Standard 2012, assuming that your video is 1280×780. If you have HD video, you're probably not going to get really good quality at 200 MB for 45 minutes. That'd translate to roughly 600 kBit/s and would be enough for 720p though.

As for encoding tools, you can get pretty far with FFmpeg (which Handbrake is based on). The only culprit is that the use of FFmpeg and FAAC audio is banned for that scene guide, but unless you're actually contributing, that won't matter.

If you have no prior experience with video encoding and all of these keywords don't mean anything to you, please have a look at the following blog articles / Super User questions:

Basically, the rules say you have to use the x264 encoder with a Constant Rate Factor quality setting. What it does is quite different than setting a constant bitrate: you can set the CRF to have x264 encode the video with a constant quality.

Typical CRF levels are between 18 and 28, and the release group recommends 19–20 for high quality encoding of material that is easy to compress. You're not going to know the final file size in advance when doing that, but that's the whole point of doing CRF encoding: You don't care about the actual file size—you just want good quality.

Once you set up ffmpeg, and you have your input video ready, encoding is actually quite simple. Note however that your source video must be of high quality, otherwise re-encoding will only deteriorate its quality much more.

Here are the key parameters:

  • x264 video with:
    • CRF 19–20
    • slow profile (better compression efficiency at the expense of encoding time)
    • H.264 level 3.1, which sets a few constraints
    • Downscaling has to be done with any resizer other than bicubic (which is the FFmpeg-default). Lanczos can be used, for example.
    • A tune setting for the source (e.g. film for film-like content)
  • AAC audio with:
    • Variable bit rate encoding
    • Bit rate between 96 and 160 kBit/s

In ffmpeg, this translates to the following:

ffmpeg -i input.mp4 \
-c:v libx264 -crf 19 -level 3.1 -preset slow -tune film \
-filter:v scale=-1:720 -sws_flags lanczos \
-c:a libfaac -q:a 100 \
output.mp4

Remember that libfaac is banned, possibly because it doesn't deliver audio quality comparable to Nero or QuickTime, but in FFmpeg, your choices are a bit limited. You can also use -c:a libfdk_aac -vbr 5 if you compiled FFmpeg yourself (see here for your AAC choices) and also refer to the FFmpeg and AAC Encoding Guide for more information.

If your video ends up being too large, you may adjust the CRF. Values ±6 will result in half/double the bit rate, so if you start with 19 and go to 25, you'd end up with half the bitrate. The scene rules don't allow CRF above 24, but you probably won't mind.

share|improve this answer

Can't speak to the release group you mentioned since you didn't post the mediainfo. But here's a guide to making compact encodes, which means striking a good quality/size balance.

You should start with HandBrake and the best available source. In the Source section, select a short but difficult to encode segment (with both action and fine detail). In the Destination section, select libmkv. In the Video tab, uncheck use advanced options (you can still add those options case by case in more settings), select --rc=crf ratecontrol, the highest --preset your computer can bear (slower or veryslow), a --tune that matches the source (film or animation should cover it), and set the profile and level to auto/auto. Then play with the resolution (only if the source is HD; in picture settings, set anamorphic to loose and vary one of the axes, from the next highres resolution and down) and the --crf until you find a good compromise between quality and bitrate for your short segment. Note that the crf is tied to the rest of your encoding settings, which is why it should be the last video setting you change. In Audio, go with Vorbis at 160kbps (this will use AoTuV -q5, achieving transparency without further tuning). In the other tabs, check that everything you might need is preserved (chapter marks, subtitle tracks, metadata, etc). When you're satisfied, you can use these settings to encode the rest of the episode; the average bitrate should end up much lower than on the difficult segment. When you're confident in your settings, you can use them to encode whole seasons.

How the above steps improve compactness: libmkv gives you access to more codecs, profile and version to auto means there won't be any playback constraints to hold back the encoder. A short segment (a few seconds) gives you a lot more time to tweak things and look at the results. Tune optimises psychovisual (perceived) quality for what the source is supposed to look like. Higher presets improve compactness at the expense of encode time (this may not be noticeable on your difficult segment, but will improve the bitrate in most other scenes). CRF ratecontrol means that your encode will vary the bitrate to target a given quality, with more demanding episodes getting more space.

A denoising filter can also be very useful if you're keeping the original resolution. You'll want to keep it light because the goal isn't to clean up a perceptible source defect, but to improve compressibility without noticeably degrading quality. Here is a guide to using HandBrake's HQDN3D denoiser, which is in between x264's --nr and state of the art denoisers for quality.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.