THE secrets of YIFY and high quality and small file sizes are not so secret after all… Encoding High quality Low bitrate Videos in Handbrake for any device

THE secrets of YIFY and high quality and small file sizes are not so secret after all…

UPDATE: Handbrake 0.9.9 has just been released, introducing numerous UI improvements that makes shit that much easier to do. The support for x264 built in presets almost renders the provided presets obsolete,except that when you use the support for built in presets feature you won’t be able to manually you could tune the features such as deblocking etc. by command line without any aid from the GUI so you run the risk of fucking up if you didn’t enter the values completely correctly, not that it matters that much. The presets provided for 0.9.8 still work in 0.9.9 though, so feel free to download and import them as you would. Don’t use 0.9.9! It is evil! It’s improved UI ate mah hard drive and raped mah wife miorgviudonbfbbkffdfvodfmkdov 

tl;dr

Converting/Transcoding/Encoding High quality Low bitrate Videos in Handbrake for any device

CLICK HERE TO DOWNLOAD HANDBRAKE (PC, Mac and Linux Versions Available)

If you’re a regular pirate of films and TV shows (unlike me, since I love obeying the law), you will notice that one of the very popular communities and trends in HD film piracy is YIFY whose release group offers films at a “high” Full HD quality at about 10% the file size (bit rate) of your common blue-ray disk.

image

image

This method of the distribution of films is very popular due to the low file sizes which can be very useful for those with limited HDD spaces and/or limited bandwidth. Many people, despite not being illegal film distributors themselves, are still fascinated by the group’s seemingly uncanny ability to make films tiny, and which to apply the techniques for legal purposes, such as ripping their legally purchased blue-ray disks in a fashion so that they could store 30 Good Quality 1080p films on their 64GB iPad.

Unfortunately, for most of those aspiring imbeciles, achieving such a feat could be a little difficult, considering how your average “movie converter” offers little options more than that of “set bit rate” and “set file type”. This is highly problematic because film converter software were designed for one purpose and one purpose ONLY: to make a file compatible with a device while consuming as little time in the process as possible. That is why if you try to encode a film in 720p @ the same bitrate of YIFY @ say… 800Kbps in your average media converter (such as freemake video converter, format factory, Ultra Video Converter, Arcsoft video converter or even Apple Quicktime), you’ll end up with something so ugly and so full of video artifacts that you would want to kill yourself for being so stupid as to think you could match the quality of YIFY in the first place. The reason for that is because these video converters utilize professionally determined presets that are not only good enough for the average user, but also quick enough for the impatient bunch. Which means that hardware acceleration such as nVidia CUDA or AMD’s equivalent would be used, and while those are incredibly useful for capturing games or on-screen activity on limited hard disk space, they can (and almost always will) result in file sizes that are a little too big for long term storage. Plus, graphic cards lack the ability to encode some of the complex algorithm abilities (yes, even your GTX680 will SUCK at encoding YIFY, despite being incredibly fast in the process), so therefore most professional encodes will try to avoid hardware acceleration from graphics cards.

So you see, there are many factors in influencing a good encode, of which the basics will be covered by this article.

Lesson #1, THE CONTAINER DOES NOT INFLUENCE THE FILE SIZE.

There is a common misconception that MP4 is better than AVI, or MKV is bigger than MOV, and to be fair, that is true to some extent. Provided the same content, an MKV file can be as much as 300KBs bigger than its equivalent MP4 file. This is because the container used in the MKV might store more data, or store less data in a slightly more inefficient way. However, as you might know, a 300KB difference is pale in comparison to the range of file sizes offered of the same films in allegedly the same qualities. So what could be causing the difference?

Codec.

The “MKV” or “MOV” is just a representation of the CONTAINER to the file. The container is what stores the video and audio content known as “streams”, which are the actual content encoded in different codecs.

image

THIS is what really matters

The only difference between containers is that sometimes certain containers can only support certain formats, or in avi’s case there is a 2GB size limit on the total length of content.

The best codec as of 2012 is still h264, a standard since 2004. While some argue that Youtube’s VP8 is comparable, x264’s developers have claimed that VP8 losses valuable compression with a limit on reference frames and the complete absence of B-frames and weighted prediction in an effort to be royalty free. And if you’re reading this article searching for YIFY, you probably don’t give a shit about royalties, so VP8 is out of the question.

Some Hong Kong advertisements for RMVB-capable products say that HongKongers love RMVB. If you love RMVB, then I got news for you: RV40, RMVB’s current codec, is based off h264 like everyone else. However, I have doubts that any RMVB encoder out there will give you as many options as x264, so essentially to you, the average user of the computer world, RMVB is about as useless to this cause as the H263 based DivX. (Apparently DivX has its own h264 encoder, but 1. It’s free version is very limited and 2. it either costs money/ or watermarks your shit, plus it comes with bloatware, and its quality is not on par, so fuck it)

So currently by raw comparison, the most appropriate codec for the cause is x264, and mkv, flv or M4V has almost absolutely nothing to do with better or worse quality of videos.

Lesson #2, THE CODEC DOES NOT AUTOMATICALLY IMPLY QUALITY

“Whaaa~? But you just said-”

Yes- while this is true in your average simple “converter”, (again,) x264’s developers have taught us that a well encoded MPEG2 file will be of much better quality than a badly encoded H264 file. And this is true, because codecs do have different levels of compression.

For example, H264 offers several profiles from 1 to 5.1, with each increase in profile implying higher playback requirements.

image

Handbrake makes it easy to make your file compatible. Select a preset or just tick off “iPod 5G support” and “Web optimized”, or manually disable B frames and set reference frames to 1, and disable CABAC, 8×8 etc.

For example, your expensive second hand iPhone 4 supports a puny baseline 3.1, which apparently means it will not playback files with resolutions of higher than 1280×720, and is also limited to a bit rate of 14000 in the main profile.

image

Not so premium anymore, huh.

Even worse, an older iPod might support H264, but will certainly not support B-frames and CABAC, which both contribute to compression levels significantly. For now, you should stick with H264.

Here’s something you’re not psyched about: H265(HEVC), the successor to H264(AVC), is supposed to be released sometime in the (near future), offering as much as 4x better compression in its (beta? Alpha?) current state of development. Hopefully an HEVC encoder will be available for the general public soon.

Lesson #3 THE BITRATE DOES NOT AUTOMATICALLY IMPLY QUALITY

That’s the point of this article. While a higher bitrate generally means higher quality, this is only valid within the limits of the same compression settings. Simple comparison is a CUDA encoding VS a CPU based encoding. The “advanced settings” and options in real encoders do exist for a reason.

Lesson #4 FASTER ENCODING GENERALLY = LESS QUALITY, and avoid (cannot stress this enough) video converters (and some video editors).

Again, why professional encoders never use CUDA for reasons I have already discussed.

“Video Converters” Are good looking software that offer very limited options, its unalterable presets designed only to make your file playable on your iPod in as short a time as possible, and nothing more.

My dad always tells me that if I really want to work with multimedia, I should go work for a big multimedia company with fancy machines because it will never be possible for me to set up a studio in my apartment. In a similar aspect, if you are trying to be a film-maker, the file size of your video should be the last of your concerns. When “exporting” from Premier etc, always export in a format and settings that are near-lossless, then re-encode them later for specific channels of distribution.

Lesson #5 USE SINGLE CORE IF POSSIBLE*, USE SINGLE CORE IF BATCH PROCESSING

“No way”, you say, “I may be an idiot attempting to encode similarly to YIFY when I clearly should shut up and just leave the encoding to the professionals, but even I know that multicore is good for multimedia processing”.

Too bad, moron. While multicore does have numerous (I cannot stress this enough) speed advantages, today’s topic is compression. And the thing about multicore processing is that (to my understanding) data is split into chunks for the processors to process, meaning thread 1 will receive chunk A, thread 2 will receive chunk B and thread 3 will receive chunk C. However, while they are processing, thread 1 cannot actually alter chunk B. Now compression is based on finding similar items and patterns, among other stuff, but when thread 1 is occupying chunk A, thread 2 cannot occupy chunk A to see if there are any similarities between them, thus resulting in a loss of compression. A single threaded operation however, will process the video bits one by one in an orderly fashion, thereby eliminating the chances of missing anything and achieving greatest compression in comparison to multicore operations.

Your average high end nVidia GPU has a shit load of CUDA cores. If it even attempted to do a high compression encoding, I’ll bet 95% of the cores would be inactive half the time, just waiting for the other core to finish processing that chunk of data.

Update: Lemme clarify this some more, as folks at at this page have expressed doubts that a single thread encoding “improves quality”.

What I mean to say is that say on a quad core cpu, running four separate encoding threads with each thread using only one core, in parallel (ie encoding video1, video2, video3 and video4 at the same time) is much more efficient than having four multithreaded encodings run sequentially (ie encoding video1, and then video2, and then video3, and then video4), as restricting the encoding to one core would result in on average a 99% to 100% core usage during encoding, while if you encode in a multithreaded operation you might only have a average cpu load of 90%, because of the cores waiting for the other cores as described above.

So no you won’t lose quality in a multithreaded high compression encode because x264 is smart and understands when you value compression over speed, but you will lose speed and efficiency. Unless you force your multithread encode to operate your CPU at full load, then, the resulting product would definitely be of worst quality than a single core encode.

(assuming “ultra” compression settings) Just as if you run 4 single threaded 7zip compressions in parallel on a quad thread/quad core computer, it would be much faster than running 4 multithreaded 7zip compressions sequentially.  the 4 single threaded 7zip threads would put your CPU at 100% load constantly when a single multithreaded 7zip thread would use between 60% to 90% of your CPU (and therefore 60%-90% the speed) at any given moment.

multicore

But then again CPUs are so damned fast nowadays, so does my advice on speed and efficiency really matter?

edit again: dammit my incompetence sucks ass. yes you can restrict handbrake/x264 to use only one thread by adding threads=1 to the command line.

Lesson #6 BE AS LOSSLESS AS POSSIBLE WITH YOUR ORIGINAL CONTENT

If, say you are not trying to rip a newest blockbuster off your new Blu-ray disk, but rather you are trying to compress your family videos into a smaller size or you are an aspiring Youtuber (or a porno producer), please don’t do a YIFY-styled encoding, because the truth is, despite being far from rubbish, they still suck- the artifacts will still be unpleasantly visible. As a family man/woman/guy, you want to retain your memories with junior in as good a quality as your camera captured it. This means no RF30 for you; go straight to RF15 or less. (This RF stuff will be explained later)

As a producer/ video editor, you want to have the highest possible quality videos available for streaming. Let Youtube or Porn Site screw it up with their own crappy compression, it’s not your job. Your job is to make sure that when a new codec comes out, they will find your old file, re-encode it, and hopefully make it look better.

This is especially true for desktop captures. If you are making a screencap tutorial on using software, for GOD’S SAKE make it lossless! The last thing anyone wants to do is to find out that the lines for writing a GUI for smudge is smudge smudge smudge smudge smudge.

Lesson #7 DO NOT DO FILE SIZE/ BITRATE BASED ENCODES

A lot of P2P groups encode videos to file sizes of 400mb, 500mb, 600mb, 700mb, 1gb, 1.5gb etcetera. This was because it was easy for people to estimate file sizes, and also filling up a 700mb cd with a 699mb file felt good. However, that’s not a very smart thing to do. You see, people are terrible at estimating bitrates, which is why some dvdrips come out with a better quality than others. It was an impractical thing from a time where “699mb” was better than “701mb”- but that time is passed. Now, more and more groups are doing RateFactor based encodes, the “RF” I talked about earlier. The Xvid encoder has a rate factor slider, so does x264. To ensure that every file you ever transcode, whether action movie or cheap animation- comes out with the same quality, you have to do quality based encodes. The default slider in Handbrake is set at 20, however it is suggested that only a RF of 15 or lower can a file seem almost lossless. From my personal estimates, both 720p and 1080p encodes from YIFY are roughly equivalent to a ratefactor of 30, quality wise, and ratefactors of around 30 are recommended.

Lesson #8 DO NOT UPSIZE FILMS

image

x264’s default deblocking- from 352×144 to 1366×768

I’ve seen dumb people ask for instructions on “making a DVD into HD quality”, aka interpolating it. Hey- newsflash: basic h264 decoder offers built in deblocking which is similar to “smoothing”, which is also interpolating, which is upsizing, and the deblocking filter is only deactivated optionally on lesser devices, so unless your choice of interpolation software is REALLY FRIGGIN FLY, I suggest you just leave your film at the resolution it is, and let the guest do the dirty work.

Now there IS an exception to this. If you plan on uploading footage from 3D games or you kidnapped Michael bay to make your youtube videos, then it is perfectly acceptable to upscale a 480p or 720p film to 1080p, just so that youtube would give it a higher bitrate and therefore better quality, because for youtube and streaming sites in general, quality will always be crappy for high motion videos, and upscaling is one way of countering that.

Lesson #9 DO NOT RE-ENCODE AT A HIGHER BITRATE FOR NO REASON

Especially when at the same encoding settings.

Re-encoding in general is a bad idea. If you’ve ever dealt with early versions of ms paint, you’ll know that if your file is saved as a jpeg image, each time you press ctrl-s the quality degradation becomes more and more obvious. That is because the jpg file is saved at a quality of around 75% the original in order to achieve what is deemed the appropriate level of compression.

image

Re-encoding at a higher bitrate will not “interpolate quality” by itself, which leads to -

Lesson #10 Use filters and “effects”

If you’re a hardcore file sharer who wants to keep the film in as much of its original form and detail, then too bad- “600mb 720p mkv” style ain’t for you. On the YIFY website he clearly states that he uses a combination of software and settings that work best, which will most likely include filters such as “contrast”, “cartoon” or “denoise”.

A light amount of Cartoon special effects will simplify colors, reduce file size requirements while making the film still seem high quality.

Contrast will help simplified colors look better.

Not only does denoise cancel out “noisy” scenes, it also helps compression significantly, because it also smooths out grains, which are bad for video compression. I had a personal experience with this, where I filmed s short walk down a mountain, then used a movie editor to give it noise. The resulting 5min 352×240 file @RF15 in similar AVC encoding settings occupied around 1GB of HDD. Noise is not good for compression, so use denoise filters.

Lesson #11 Single pass bitrate encoding is not necessarily worse than two-pass bitrate encoding

Multi-pass encoding wasn’t just a way to improve quality, it’s purpose was to generate a stats file in the first pass which will be used to determine the appropriate RF used so that the resulting file is same size as that which the user specified. Normally, single pass bitrate encodings convert your bitrate into a RF value with a maximum bitrate limit and takes it from there. The result may be larger or smaller than estimated- multipass merely makes sure it’s the exact bitrate you want it to be.

And Finally- Lesson #12 VIDEO ENCODING TAKES TIME

image

Hey BRO, no pain no gain, BRO (source)

I highly recommend visiting the source. I personally find this thread hilarious because its populated with people who really shouldn’t be messing with video encoding.

image

Encoding in H264 takes a lot of time. I’ll assume this guy was using one of those gay presets (I automatically assume that almost all presets are gay) in AutoGK, and even that predicted 14hrs for *just 4 hours of film.

It takes guts for the average human being to try and encode like YIFY. For example, I’m on an Acer Aspire-481G ultraportable, and that means a 17W i5-3317 ULV Processor. I have no secondary computer, so this means that whenever I encode, I encode on the go, everywhere, anywhere, and anytime, and naturally there are many problems I’ve experienced. For one, I have to put the computer to hibernation every time I stow it in my bag or it’ll overheat. Secondly, the battery drains superfast every time I bring my computer out of hibernation and it continues its task. I have to constantly keep my laptop plugged in, and that is a “bit” damaging to the battery.

image

My wonderful computer which can play Sleeping dogs even though it’s so thin and so cheap (source)

So far, it’s just me bitchin about my slim ultrabook wannabe. But here are some things that might apply to you too:

1. If you don’t have a fast processor, it’s gonna take a while. In my trial and error session with a laptop I borrowed, it took almost 4 days for an i7-2630QM to encode Total Recall (2012) to a YIFY-like 1080p output. If you have an old computer, you’re electricity bills are gonna get fagged up, because old processors are totally less efficient.

2. When you have the encoder running in the background, you cannot play games. You’re limited to small tasks such as waiting for the mouse to move from 1230, 230 to 934, 317 (well, not unless you’ve got lots of other shit open), and maybe checking your email. You can’t edit videos, and you can’t play old games even though they’ve got lesser system requirements since when all the threads of your hyper threaded quad core 3.6ghz CPU are used simultaneously, the old single threaded game will only be able to use one thread at a speed and efficiency of around 200-300 Mhz (3.6/4/2=400)

3. You cannot reboot

4. Everything is slow

5. Even if you have the newest fastest consumer processor, you will still be unable to fully utilize your computer for at least a day if you wanna do a single threaded 1080p encode of a 2 hour film, and if you make a mistake, you start over.

Bottom line is, why do it yourself if someone with the time and equipment has done it for you? Therefore I discourage anyone who actually needs their computer every day from doing video encoding. It’s messy and not for the impatient or the morons.

Continue reading if you still think you’re up to the task.

Now that you’ve learnt the basics…

image

(Source)

*tips for porn producers highlighted in bold italics

1. Install, then open up Handbrake (this tutorial covers version 0.98)

image

2. Drag your film onto the program or select Source-> Video file

3. Downloadthis preset pack for handbrake 0.98 x64 , and select options->import from the bottom right corner of the program. Locate the downloaded file from the window and open it.

image

4. Locate “Placebo” in the preset list and double click

preset

5. If you wanna downsize the video, change the width in the appropriate box (green circle) The “display size” might show weird numbers, but it is most beneficial to keep it that way, as leaving the resolution non-anamorphic will result in worse compression. Don’t worry, your video will still be displayed in the resolution it should be.

Check the red circle’s area. If you see that there are numbers other than zero in the listboxes but your video doesn’t need to be cropped, select “custom” and edit all values to zero. This function automatically removes “black bars”, but is buggy in some cases.

image

If your video is in an incorrect aspect ratio and you want to correct it using a custom resolution, select Anamorphic and choose none. Now you can set custom values to make it 4:3, 16:9, etc.

image

If you want to keep your original resolution, select this too.

6. Now you can flip to the filters tab and apply some simple filters. Note that if denoise is not set to “Medium”, set it to “Medium”. Grayscale encoding might help compression by 0.5%, but the end result is, you guessed it- grayscale.

Note: If you’re producing videos, turn off denoise.

image

7. Flip to the video tab. Make sure the codec is set to H.264. Make sure the FPS is same as source, and you can decide whether you want variable or constant framerates. VFR helps compression a bit, and its effects aren’t that obvious as the resulting framerate wouldn’t be hugely affected- you probably wouldn’t even notice it were there.However, constant frame rate is preferable for high motion videos- better safe than sorry, right?

image

8. The default RF value is set as 30, good for 1080p (1920*xxxx) and 720p (1280*xxx) all the way to DVD quality (720*xxx). For 480p, use a RF of 25. For 240p, use a RF of 23.

If you are producing, use RF15 (or23) for full HD, RF14 (or20) for 720p, RF12 (or 18) for DVD and 480p, and RF 10(or17) for 240p.

*OR values are for if you really value your HDD space that much, then fine.

If you insist on a specific file size, calculate the bit rate (including the audio of 96kbps by default), select Avg Bitrate, enter value, select 2-Pass Encoding and leave turbo first pass alone. This is only useful if you’re encoding for cd or DVD. I personally use the xvid encoder that comes with klite codec pack to calculate bit rate, but I’m sure much better solutions are availabe.

9. Switch to the audio tab. If the box is empty and your video is supposed to have audio, click “add track”. If your video contains multiple audio tracks and you want to add a specific one, click on the listbox beneath “add track”, and select from the list. You can add multiple audio streams, however if you do, please change the container from MP4 to MKV, as the MP4 container does not support multiple audio streams. If a track is labeled as o 0 (as shown in picture below), you have to remove it and add it again. To remove audio tracks first click on a track, and then press “remove”.image

Make sure the audio codec is faac, mixdown stereo, samplerate auto and bitrate @96. If you really hate faac that much, you could always mux in your nero/itunes encoded aac stream later.

If you’re a producer for (especially music videos), select “360” for the audio bitrate.

10. Switch to subtitles tab. If your video contains subs, now is the time to add them. I recommend that you add all of them since subs are so damned small anyways, however if you add subs you have to set the container as mkv (matroska)- mp4 does not support built in text subs. You add subs the same way you add audio streams, and here you get to change several properties of the subs as well.

image

update: If you know your video contains special subtitles (such as the Jabba the Hutt translation in Star Wars) and you want to preserve it in your encode but it isn’t listed in the list of subtitles, add “Foreign Audio Search” to the list of subtitle tracks. 

11. Switch to the advanced tab.

image

“Holy crap, what the hell is that?”

You are now at the very last stage. This is where you set the compatibility of your video if you want it to work with a specific device. Check the spec sheets of your target device for things on this list you might want to disable to meet various profiles. If the preset don’t import properly, copy and paste this into the box at the bottom of the window:

ref=16:bframes=16:b-adapt=2:direct=auto:me=tesa:merange=24:subq=11:rc-lookahead=60:analyse=all:trellis=2:no-fast-pskip=1:threads=1

Note: disable (ie. delete) threads=1 if you’re only encoding 1 video

These settings basically emulate the “placebo” preset in x264:

This setting pushes h264 to its very limit. It’s a general purpose set of options that ensure maximum compression happens. For more info on the settings (and this is why I like Handbrake so much), hover your mouse on each of the options and a description will appear explaining it.

*edit: add “threads=1″ to the options. this is a life saver in both batch processing videos and in cases where you might want to be able to utilize the rest of your cores/threads for other uses if on multicore computers. However if you only plan on encoding one film in the near future, might wanna disable threads=1 as it is seriously slow on multicore and/or hyperthreaded systems and is only useful for batch processing.

If you are encoding for production, you might want to completely disable Psychovisual Rate Distortion and Psychovisual Trellis, as well as Deblocking. These can cause artifacts. Or blurring.

12. Now you’re all set.

image

Press Start, dumbass

Happy encoding!

Last but not least…

Video quality is nearly always more important than video resolution. The way YIFY has been able to evade its lawsuits… the ugly truth is YIFY encodes are still sub-par copies that no sane film producer would sell (aside from youtubers, amiright). I personally archive my films in a relatively high quality- low resolution format which I call “Recap Format”, basically VCD resolution @ RF23. And I’m happy to say that watching recap format can be a much better experience than watching a YIFY low bitrate 720p encode, even if the source of the recapped video is YIFY.

In the future when bandwidth, lossless video compression and storage mediums evolve, we will be able to stream lossless videos without artifacts off Youtube and download a few TBs of near-lossless 4320p films off iTunes- and by that time, YIFY styled encodes might just be headed towards obsolescence.

New: if you want you can download a sample of a recap format encoding by visiting recapstore.wordpress.com, where I am setting up a website dedicated to archiving films in the format.

Also new: grab* my 720p encode of TPB AFK at bayfiles here or via torrent  (tpb page) (encoded using aforementioned settings) and compare it with YIFY’s 720p encode of TPB AFK, and compare the picture quality to see for yourself.

FAQ:

Q: Why use HB when u can use x264 directly, fake n00b nerd?

A: Because some people (including me) are too dumb and/or lazy to use command line, then mux stuff in themselves, and manually crop them using video editors etc…

Q: The resulting file size after an RF15 encode using your settings is bigger than my source video, you time wasting asshole!

A: That is because your source video is in bad quality, and since RF15 is near-lossless, it will try to retain most detail in your video, including the artifacts in your video. To solve this problem, increase the RateFactor value to lower the encode quality, so that at some point x264 might decide to smooth out the artifacts (and some detail, because you will always lose some quality when reencoding unless in a lossless encode). 

Q: Why some 1080p vids come out 1000000kbps while others come out 180kbps?

A: When one is a lossless encode of high motion action sequence while another is a lossless encode of a very simple animation in 1080p

Q: 1280×544 isn’t 720p, 1920×800 isn’t 1080p, you dick

A: your 1080p monitor is incapable of displaying every single pixel of a 2592×1080 image at the same time without resizing it, so why do you consider it a 1080p monitor? AFAIK, 1080p, 720p etc isn’t about vertical resolution, its about horizontal resolution.

Q: I’m one of the several white trash you’ve encountered over the internet who’ve decided its okay to make racist comments about you

A: Stop fucking your sister, retarded hick

Q: Son are you trying to be a comedian? 

A: I attempt to humor and entertain from time to time

Q: Now that the educational portion is over, why am I reading this crap?

A: Obviously I didn’t write this article just to educate people :P , so if you liked this article, subscribe and/or like and/or comment!

This article will be constantly updated until the next version of handbrake comes out, so in the meantime if you think I made a mistake somewhere, comment in the section below and I will investigate into my error, and correct my ways.

And while we’re on the topic of encoding, check out my new article on choosing a suitable codec for use in the awesome game recording software Dxtory, which you may find useful if you intend to record any gaming footage.

This article and its images (unless specified) ©Eric Yan 2012 All Rights Reserved

Hi there. If you look around my blog, you’ll notice that I write the occasional poetry. But what you don’t know, is that I occasionally record the poetry and magically turns it into a rap song. Sometimes I record enough of them to form an Album, and this is one of those times. Check it out (please?), it’s free!

No part of this article may be reproduced without the owner’s explicit written permission.

Software is Handbrake – open source

Dreamworks image used under fair use.

About these ads

231 thoughts on “THE secrets of YIFY and high quality and small file sizes are not so secret after all… Encoding High quality Low bitrate Videos in Handbrake for any device

  1. Hey Eric, do you still check these comments?

    Thanks for the tutorial by the way, your presets make it a breeze for quick lazy encoding.

    I just have a quick question, maybe you could help.

    I am trying to emulate this file’s quality/size: http://textuploader.com/khn0
    Using the “slow” preset resulted me with this: http://textuploader.com/khnk

    Now, The file size doesn’t exactly make a huge difference to me, but I was just wondering how the original file is so small, and the output is almost double. I know using the placebo setting would probably help, but for a 20 minute video, not sure if I want to invest an hour per video of many.

    Is there something I’m doing wrong, or is that just the effect of using the faster “slow” profile with less compression?

    Thanks for reading this!

  2. I have watched YIFY and I have watched full blu rays….
    IF you are watching this shit on a pad which most people have time for, off course the size helps.

    But really anyone who watches this on a 27 inch full HD screen and cannot tell the difference between a 4.5 gb 720p rip vs 770 mb rip is legally blind in my opinion.

    I never download YIFY but I can see why people would because everyone does not have acres of space.

    • just out of curiosity I went to Your Blog … where is Your Comment or Additional Input … did NOT see anything … except may be re-directing Traffic to your Blog.

  3. I love lesson #9: “Re-encoding in general is a bad idea.”

    I’m sorry — isn’t this “THE secrets of YIFY …”? I haven’t seen a single YIFY release that is NOT a re-encode of a proper release. This is the number one “secret” (it’s usually written in plain English in the info) of YIFY releases and why you should avoid everything that carries that label like the plague.

    Compressing the shizzles out of a first-tier source isn’t a crime. Compressing the shizzles out of a second or third-tier one is.

  4. Eric.

    Many thanks for the article.

    The thing I find most useful about YIFY’s stuff is the low bitrate whilst still maintaining reasonable quality at 720p. The bitrate is important to me for streaming via Serviio without constant buffering. File size is not so much a concern for me, so do you have any recommended settings in HB that might help reduce bitrate without producing blocky results at the possible cost of file size?

    I believe a clue may lie in YIFI’s MediaInfo, which often details both video ‘bitrate’ (typically under 1,000 Kbps) and ‘maximum bitrate’ (often circa 8,000 Kbps). Presumably the bitrate only climbs where necessary to maintain quality when required.

    The thing is, I’ve yet to find a profile or setting that does this in HB.

    Any advice would be appreciated.

    Thanks.

  5. A 2-pass ABR encoding does basically that, but the max bitrate is probably determined by the software. x264 allows you to specify max bitrate manually but that is not really useful for anything other than streaming, although enabling will probably cause the classic blocky action scene problem on lower bitrates.
    To specify a maximum bitrate, add
    vbv-maxrate=2000, vbv-bufsize=4000
    into the extra options in the video tab of the current 0.9.9. version of handbrake, where the first number (2000) is your maximum bitrate while the second (4000) is double the first number.
    tbh i just grabbed this off a google search http://veetle.com/index.php/article/view/bitrateLimit so I’m not entirely sure if it works, the seperating comma may have to be a colon or something.

    • Thanks for the quick reply, Eric.

      So my best bet might be to do a 2-pass ABR (with an ABR of around, say, 1,512 Kbps) and let the software determine the max bitrate rather than go with an RF and put a limit in myself?

  6. I think you are right with your thread=1 theory that the compression is slightly better. I just checked using the preview function. While all other parameters remained identical and the only thing I did between the two runs was to add the “thread=1″ option into the “extra options” field, the resulting file was indeed a tiny little bit shorter.
    The option also definitely worked, because before my (Win 7 64 showing) 8 cores were all fully occpied resulting in a 96 to 99% total CPU load. With the option added the total CPU-load was only jumping between 20 and 30%.

    The file was a 30 second preview of a DVD series. Using denoise=ultra light and RF 20 with x264 preset very slow, the file size without thread limitation was 4.028.992 bytes and with threads=1 was 4.022.272 Bytes.

    Despite the smaller result, I won’t limit the threads to 1 in the future though, because the resulting improvement of 0.1% doesn’t justify increasing the rendering time by factor 4 to 5.

    • Addendum. I just found the official documentation for x264. They confirm my test:

      http://mewiki.project357.com/wiki/X264_Settings

      threads

      Default: auto (frame based threads: 1.5 * logical processors, rounded down; slice based threads: 1 * logical processors)

      Enables parallel encoding by using more than 1 thread to increase speed on multi-core systems. The quality loss from multiple threads is mostly negligible unless using very high numbers of threads (say, above 16). The speed gain should be slightly less than linear until you start using more than 1 thread per 40px of vertical video, at which point the gain from additional threads sharply decreases.

      x264 currently has an internal limit on the number of threads set at 128, realistically you should never set it this high.

    • true.
      I hope I mentioned somewhere that thread=1 was only useful if you wanted to squeeze out a bit more compression from the smallest file sizes, or had a large number of videos to encode simultaneously to allocate one encode per core.

  7. Hi, I have some .mov files that are over 50GB. They came from encoding hi-8 tapes, which was done for me by a shop nearby. I’m trying to convert the .mov to .mp4 with Handbrake, but it’s not working. It looks like it’s setup, but when I push “encode”, the dialog box immediately pops up saying that the encoding is done, but of course it’s not done. Do you have any advice on any part of this process?

    • I just typed out a bunch of gibberish below until it occured to me that pasting the mediainfo from those .mov files would be a good idea so we get a better idea of what we’re dealing with. however in the meantime the stuff below could still be helpful, and keep searching for answers because I’ve also experienced similar situations and in my case it was with files that have weird codecs that handbrake didn’t recognize.
      firstly, if these files are very important to you, backup the files if you can.
      Ideally you’ll want to try out a multitude of other video converters to see if you can’t convert the files into something handbrake will recognize, of course try the newest version of handbrake first.
      Then, free video converters I recommend are format factory and freemake video converter, although the installers might try to install toolbars and such so be careful during the install process. In these video converters, always convert to your video’s original resolution and a reasonably high bitrate and see if it works, pay attention to audio sampling rate (keep same as your source file) and bitrate (320kpbs mp3 or aac is usually enough) as well, handbrake will comfortably take mpeg2 (dvd format), xvid/divx-mp3 (h.263) avi files, and of course h.264 avc-aac mp4 files, so convert to those formats first.
      If these free video converters don’t work and the files are of reasonable importance to keep trying, you may have to purchase/”obtain” some commercial video converters and video editing software (quicktime pro may be a good idea), and if that doesn’t work then as a last ditch “obtain” fraps (unless you own it legally in which case good for you!), play the movie in a video player that plays it and use fraps to record the playback, then encode the screen capture using handbrake (of course when you do this turn off the fps counter fraps usually displays, as well as make sure you have enough hard disk space).

  8. What a wonderful wonderful
    Article. Just what I needed thks so much..been looking for weeks for something like this… big help…:-)

If you can't think of anything to comment, just fill in your bank account details or social security number.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s