Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
Is there such a thing as not getting the perfect encode with Handbrake? I have an MKV file that I'm trying to convert to an m4v format. The MKV file plays flawlessly. At the beginning of the video, there is a scene that fades from black into a scene that has trees in it. Every time I run this through Handbrake(ATV3 quality), that opening scene starts off real pixelated until the fade-in is complete. I have changed many settings; a tweak here and a tweak there. No matter how many times I run it, the pixelation still occurs. So, is there such a thing as not getting the perfect encode?
 
Last edited:

Tweak3D

macrumors regular
Jul 17, 2007
181
0
What do you mean? This mkv file is a direct copy from a disc. Full quality, I thought.

did you make the MKV yourself? The ones i've made run about 20-40GB each and have never had an issue. If you've obtained it elsewhere, it may have already been down converted once which is quite common.
 

Macman45

macrumors G5
Jul 29, 2011
13,197
135
Somewhere Back In The Long Ago
I've kind of traded HB for MKV which I find better..I bought into the BETA deal in the hope that 3D support will come soon. It's faster than HB, but is not yet as comprehensive in terms of settings etc.

Still have Handbrake though.
 

mic j

macrumors 68030
Mar 15, 2012
2,663
156
Is there such a thing as not getting the perfect encode with Handbrake? I have an MKV file that I'm trying to convert to an m4v format. The MKV file plays flawlessly. At the beginning of the video, there is a scene that fades from black into a scene that has trees in it. Every time I run this through Handbrake(ATV3 quality), that opening scene starts off real pixelated until the fade-in is complete. I have changed many settings; a tweak here and a tweak there. No matter how many times I run it, the pixelation still occurs. So, is there such a thing as not getting the perfect encode?
First, make sure the pixelation is not in the source (disc), if it's not, then check to see if it's in the mkv. Use the same viewing source for both. I would suggest VLC but anything that will play both disc and file works. Also, if you are seeing pixelation on your computer screen, check the mp4 on your tv. I have run into sometimes seeing pixelation on my MBP but not on the mp4 through the aTV. Just trying to save a lot of effort by making sure there really is a problem. There have been several posters with "quality problems" only to find out after a few posts later that their source material was the issue.
 

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
Problem solved. It wasn't the source material. That played perfectly. I really don't understand the solution. I just updated HB to the latest Nightly version. I used the ATV3 preset just as I did with the previous version of HB. So, I'm not sure what changed, but whatever. Problem solved. Was kind of hoping Dynaflash would have some input.
 

dynaflash

macrumors 68020
Mar 27, 2003
2,119
8
Problem solved. It wasn't the source material. That played perfectly. I really don't understand the solution. I just updated HB to the latest Nightly version. I used the ATV3 preset just as I did with the previous version of HB. So, I'm not sure what changed, but whatever. Problem solved. Was kind of hoping Dynaflash would have some input.

So the nightly solved your issue ?
 

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
So the nightly solved your issue ?

Yep. I changed all sorts of settings on the version I was using. Then I decided to upgrade to the latest Nightly and the issue went away. Now, it had been a while since I last updated my Nightly version. Months.
 

dynaflash

macrumors 68020
Mar 27, 2003
2,119
8
Yep. I changed all sorts of settings on the version I was using. Then I decided to upgrade to the latest Nightly and the issue went away. Now, it had been a while since I last updated my Nightly version. Months.

yep, new version uses a bit different x264 settings. pretty close but uses (as I am sure you noticed on the video tab) x264 presets with an additional string. Glad to hear it fixed your problems. I hadn't noticed a diff on my encodes but its good to know its a bit better in some cases.
 

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
yep, new version uses a bit different x264 settings. pretty close but uses (as I am sure you noticed on the video tab) x264 presets with an additional string. Glad to hear it fixed your problems. I hadn't noticed a diff on my encodes but its good to know its a bit better in some cases.

Well, the ATV3 preset in the newest Nightly version has caused an interesting new problem. My encodes are twice the size than the old encodes. Is this expected? Should I accept this, or is there anything I can do to maintain quality while decreasing the end file size? I
 

mic j

macrumors 68030
Mar 15, 2012
2,663
156
Well, the ATV3 preset in the newest Nightly version has caused an interesting new problem. My encodes are twice the size than the old encodes. Is this expected? Should I accept this, or is there anything I can do to maintain quality while decreasing the end file size? I
I just used the latest nightly to transcode and obtained normal file sizes. Encodes vary widely in size depending on the nature of the source material. If you really want to get to the root of the matter, and not go on a wild goose chase, I would suggest taking a file you know was encoded using the stable release version and running it through a nightly version (all same settings of course) and verify that the file size changes that much.
 

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
If you really want to get to the root of the matter, and not go on a wild goose chase, I would suggest taking a file you know was encoded using the stable release version and running it through a nightly version (all same settings of course) and verify that the file size changes that much.

So, the source file(a 55min TV show) was run through both versions of a Nightly Handbrake. The older version gave me file sizes around 2 gigs. The new version encodes the same file with what I believe to be the same settings to 6.3 gigs. Thats bigger than most feature length movies. I used the ATV3 preset in both Nightly versions.
 

dynaflash

macrumors 68020
Mar 27, 2003
2,119
8
So, the source file(a 55min TV show) was run through both versions of a Nightly Handbrake. The older version gave me file sizes around 2 gigs. The new version encodes the same file with what I believe to be the same settings to 6.3 gigs. Thats bigger than most feature length movies. I used the ATV3 preset in both Nightly versions.

well, I would have to see the activity logs for each encode. if you are so inclined put each on a pastebin.com site and put the links to each here. Beyond that I would be totally shooting in the dark. I have not noticed any kind of difference like you are describing. something is wrong with the settings.
 

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
well, I would have to see the activity logs for each encode. if you are so inclined put each on a pastebin.com site and put the links to each here. Beyond that I would be totally shooting in the dark. I have not noticed any kind of difference like you are describing. something is wrong with the settings.

I'll work on that, however, I don't know if I can give you the activity log for the encode on the previous version of that Nightly. I replaced it. I should be able to get you the activity log on my current encode. Hopefully you'll be able to tell me why the ATV3 preset is all of a sudden spitting out larger files.
 

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
well, I would have to see the activity logs for each encode. if you are so inclined put each on a pastebin.com site and put the links to each here. Beyond that I would be totally shooting in the dark. I have not noticed any kind of difference like you are describing. something is wrong with the settings.

So here's the link to my latest encode using the ATV3 preset: http://pastebin.com/Gz8HRHw5

The resulting file is 6.89gigs when historically I've reached 2.35gig files sizes.
 

hipnetic

macrumors 65816
Oct 5, 2010
1,266
562
This sounds a lot like something I experienced a long while ago when messing around with Handbrake trying to find the "perfect" settings that I could save as a preset for "set and forget" encoding perfection. I had an Iron Man Blu-ray rip and used a small sample from the beginning of the movie when he was a prisoner in the caves. Encoding with Handbrake I tried the default/recommended RF setting (I forget what that is/was, maybe 18?) but I saw some noticeable macro blocking in the dark areas. After much experimentation, I think I got it to the point of being imperceptible by using an RF value of 12. Of course, the lower the value, the higher the filesize.

After wasting much time on this, and never being quite satisfied, I decided that (at least for the time being) I wasn't going to waste my time converting my .MKV files with Handbrake to .MP4 files since I had some streaming devices/HTPCs capable of playing the "raw" MKV files anyway, and hard drives were cheap enough that I could just buy another small external 1TB drive when I got close to filling up my current one.

BTW, I might have missed it, but what kind of disc was this MKV produced from? A Blu-ray or DVD? If it's a Blu-ray, a 2.35GB filesize seems way too tiny to expect decent quality out of. I think that RF12 Iron Man rip/conversion would have resulted in around 10GB or more for the full movie.

Edit: Just looked at your log file. Yeah, it looks like a Blu-ray 1920x1080 resolution source. Not sure of the full runtime length, but expecting a high level of picture quality at less than 3GB seems very unrealistic. Like I mentioned...hard drive space is super-cheap nowadays. Unless you have a need to be storing a bunch of these movies on your iPhone/iPad, I would highly recommend using better quality settings and just realizing that the filesizes are going to be quite a bit larger. Or embrace perfection (and really large file sizes) and just rip your movies with MakeMKV and call it a day.
 
Last edited:

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
BTW, I might have missed it, but what kind of disc was this MKV produced from? A Blu-ray or DVD? If it's a Blu-ray, a 2.35GB filesize seems way too tiny to expect decent quality out of. I think that RF12 Iron Man rip/conversion would have resulted in around 10GB or more for the full movie.

Edit: Just looked at your log file. Yeah, it looks like a Blu-ray 1920x1080 resolution source. Not sure of the full runtime length, but expecting a high level of picture quality at less than 3GB seems very unrealistic. Like I mentioned...hard drive space is super-cheap nowadays. Unless you have a need to be storing a bunch of these movies on your iPhone/iPad, I would highly recommend using better quality settings and just realizing that the filesizes are going to be quite a bit larger. Or embrace perfection (and really large file sizes) and just rip your movies with MakeMKV and call it a day.

I really don't understand opinions like this. I started using the ATV3 preset when it was first introduced to Handbrake, and the resulted files were small(Movies = 4 to 6 gigs). This is around the same 1080 file sizes that you can download from iTunes. I have a big library of movies that were all encoded using the ATV3 preset most of the movies average 5gigs. Something must have changed in the ATV3 preset.
 

mic j

macrumors 68030
Mar 15, 2012
2,663
156
I really don't understand opinions like this. I started using the ATV3 preset when it was first introduced to Handbrake, and the resulted files were small(Movies = 4 to 6 gigs). This is around the same 1080 file sizes that you can download from iTunes. I have a big library of movies that were all encoded using the ATV3 preset most of the movies average 5gigs. Something must have changed in the ATV3 preset.
I just looked through my library. I have about 20-30 BR rips. The range is 5-15GB. I would say the "usual" file size is 5-6GB with the longer ones running 10-15GB. Before the aTV3 preset was added, I use a setting recommended by Dynaflash. The aTV3 preset was built off those setting, with just some minor tweaks. So from what you are saying and what I see is my files, I would speculate the problem is with the earlier files and the transcode file sizes you see now are what I would call "normal". Additionally, most of my transcodes used the stable version of HB, not a nightly. I just starting using the nightly over my last few transcodes. Since you were seeing pixelation with your 2-3GB size rips, over-compression was probably the source of the artifacts. You are now at a "normal" size and pixelation is gone, right? So the remaining question is really were the parameters used on your earlier transcodes. Without log files, that will be impossible to know. But you're in "the zone" now. :)
 

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
Well, I've only ever noticed the pixelation on the one file that caused me to start this thread. I don't mind larger file sizes to get rid of pixelation problems, but file sizes twice the size of what I'm used to? I'd rather achieve file sizes more similar to those you can find on iTunes. A happy medium, if you will.
 

hipnetic

macrumors 65816
Oct 5, 2010
1,266
562
Let me try again...that Dexter rip likely had quite a few dark scenes. Live action movies (as opposed to a cartoon/CGI Disney Pixar film) is going to have a good amount of grain, and image noise in dark scenes. Image noise will look grainy on a high bitrate source. When you convert it with Handbrake, you/Handbrake have a choice: It can maintain a high bitrate (at least in these problematic scenes), which will drive up your filesize, or it can essentially de-noise the scene and compress it more (smaller filesize), but you'll end up with blotchy blocky patches.

If you're working with less grainy sources (and especially squeaky-clean CGI), Handbrake can do a remarkable job of compressing things down to a very small filesize while still maintaining a high level of PQ.

As for the iTunes file sizes...you also need to recognize that these files may be produced from even higher quality sources and there may be human involvement in evaluating the movies scene-by-scene during the compression process and adjusting different values as needed. It's also quite possible that you'll see similar artifacting in the same problematic scenes. Compare apples to apples: Find out specifically which episodes are on that disc and add up the total filesizes of the individual 1080p episodes sold on iTunes. Then, buy the problematic episode and compare it directly to what you/Handbrake can produce.

Along the lines of my previous post...one approach you could take is to take the ATV3 preset and dial back the RF value (higher value = lower PQ but smaller filesize). Start by adding 2 to the value, compress just 2 minutes worth (Handbrake gives you this flexibility), and evaluate the end result. Keep doing this until the artifacting gets reintroduced. Then, set it back to the previous value, convert the entire disc, and see if you're happy with the resulting filesize.

Lastly, a really dumb/obvious question, but just in case...this Dexter disc has multiple episodes on it. What is the total runtime? It could be 3 hours or more. Obviously, the average 3-hour disc should have a 50% larger filesize than a 2-hour disc.
 

mic j

macrumors 68030
Mar 15, 2012
2,663
156
Well, I've only ever noticed the pixelation on the one file that caused me to start this thread. I don't mind larger file sizes to get rid of pixelation problems, but file sizes twice the size of what I'm used to? I'd rather achieve file sizes more similar to those you can find on iTunes. A happy medium, if you will.
For BR's you can increase the CQ to maybe 22, many do that. My problem with running on the edge like that, is you don't know you have a quality problem until you've invested the time into the transcode. As for iTunes file sizes, they often start with 4k res files, so they compress a lot more before degrading the image quality. Not sure it's possible to "routinely" achieve those file sizes without quality loss. But video quality is a very subjective experience and has a lot of variables (viewing distance, screen size, personal sensitivity, etc). So push the RF down as low as you can stand it and see where your file sizes fall.
 

cwazytech

macrumors 6502
Original poster
Jan 7, 2009
381
86
Colorado
I've been able to get away with an RF value of 18 for a long time now. My spidey senses tell me something in the ATV3 preset changed. I've noticed that in the latest version of Handbrake Nightly there are several new H264 value settings that can be adjusted. Is there anything there that can be adjusted that wont reduce noticeable video quality while reducing file size? I'm a little wet behind the ears when it comes to the technical stuff.
 

dynaflash

macrumors 68020
Mar 27, 2003
2,119
8
So here's the link to my latest encode using the ATV3 preset: http://pastebin.com/Gz8HRHw5

The resulting file is 6.89gigs when historically I've reached 2.35gig files sizes.

That is *not* the apple tv preset. One its a full 1080p source and you are using

Code:
[17:32:41]      + quality: 18.00 (RF)

which is very much different than the AppleTV 3 preset which uses rf 20.

At an RF of 18 for a full blu ray source I am not even remotely surprised at the size of the file. The rf scale is logarithmic not linear meaning the jump in size and bitrate from rf 20 to rf 18 is very big.

Now, try using the actual AppleTV 3 preset ;)
 

mic j

macrumors 68030
Mar 15, 2012
2,663
156
I've been able to get away with an RF value of 18 for a long time now. My spidey senses tell me something in the ATV3 preset changed. I've noticed that in the latest version of Handbrake Nightly there are several new H264 value settings that can be adjusted. Is there anything there that can be adjusted that wont reduce noticeable video quality while reducing file size? I'm a little wet behind the ears when it comes to the technical stuff.
I think Dynaflash mentioned that there are some changes but nothing that should double or triple file sizes. And, historically, I have always used the stable version and just recently switched to the nightly (just used it a couple days ago) and I have not seen any change in file sizes. From the information you have provided, it looks to me like the earlier transcodes (using the stable version, right?) are abnormally low, not that the new nightly is abnormally high. Also, you mention using an RF of 18, that is actually a large increase in quality from the default RF 20 of the aTV3 preset. Notice, above that I said you could move the RF maybe 22 for BR's, thus decreasing quality (but maybe not noticeably) and decrease file size.

Comment: You're too quick, Dynaflash!!!!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.