PDA

View Full Version : How can I achieve 720p Handbrake encodes that don't stutter?




Number6
May 14, 2010, 09:24 AM
Is there anybody here who has no problems with HD files that conform to Apple's specs for the Apple TV? I just finished a long encoding and tagging session only to be totally frustrated. Two out of three files stutter (or drop frames) during playback on the Apple TV :(

At first I tried steaming them over my n-network wirelessly but that was totally unwatchable. After syncing them to the Apple TV things improved a little bit but it still seemed like the movie freezes and picks up speed again every once in a while. That is just not good enough.

These files play just fine in Quicktime and iTunes and I encoded them with Dynaflash's advanced options which I added to Handbrake's (Version 0.9.4 x86_64 (2009112300) Apple TV setting. The advanced options read like this:

ref=3:mixed-refs=1:bframes=3:me=hex:subq=7:b-adapt=2:8x8dct=1:weightb=0:trellis=0:weightp=0

Constant quality is at 60.78% or RF 20 and I bumped the resolution to 1280x whatever the aspect ratio requires. Is there anything wrong with these settings?
I went with the standard Apple TV settings in Handbrake at first but if I bump up the resolution the problems are the same and the 960x540 resolution doesn't cut it. The framerate on all these files is 23,98 so a real 720p resolution should not be problem.

The crazy thing is that one file works and plays without stuttering (even over the network!) so what can I do to make all files come out that way?

I've had these problems ever since I started encoding HD video and I find myself re-encoding the same movies over and over and I'm sick of it. The iTunes HD movies look great and have similar specs and I want my collection in that quality, but it seems unachievable. My WDTV HD Media Player plays nearly everything I throw at it but the interface sucks so hard I would rather live with 720p video if I could get it to work.

Any ideas are greatly appreciated...



NightStorm
May 14, 2010, 09:29 AM
I'm sure dynaflash will comment here soon enough, but you should remember that he syncs all of his content which gives him a little more flexibility on what the AppleTV can handle (eliminating the streaming overhead). My advice would be to download one of the nightly builds of Handbrake (lots of fixes for things you'll likely come across in HD sources) and try the stock AppleTV preset, modified to use 1280 width. The updated preset uses vbv limits to help prevent the bitrate spikes that cause stuttering on the AppleTV.

The only dropped frames that I see anymore are in the first few seconds as the AppleTV starts to buffer the content. If the problem persists, you could try increasing the RF value to 21-23 which is more in range with the values recommended over on the Handbrake forums for AppleTV 720p encodes (although I use RF20 without issue).

Number6
May 14, 2010, 09:35 AM
That was quick! Thank you, I will try it tonight and post results.

NightStorm
May 14, 2010, 09:40 AM
That was quick! Thank you, I will try it tonight and post results.
Sorry for all the edits to my original post; I should know better than to read Macrumors while sitting in a meeting. :cool:

There is a lot of info regarding Bluray/HDDVD sources and Handbrake in the thread linked below, although I admit the info I provided in the first post is a little dated. One of these days I'll get around to updating it.

http://forum.handbrake.fr/viewtopic.php?f=14&t=9258

gnasher729
May 14, 2010, 09:50 AM
Increasing the resolution is a sure way to make it stutter. Use the original image size that Handbrake suggests, Strict Anamorphic in Picture Settings. Anything higher is a waste of CPU time. If your originals have bad quality, add a noise filter. You can try turning CABAC off, that is quite hard on playback, and you can try changing deblocking to (-1, -1) or (-2, -2); both options lose a bit of image quality but make it a lot easier on the decoder. And you might try what happens with "average bitrate" instead of "constant quality". Average bitrate would make every bit of the movie equally hard or easy to decode; "constant quality" would use more bits for critical parts of the movie to keep the quality up, but that might be what produces stuttering.

NightStorm
May 14, 2010, 10:06 AM
Increasing the resolution is a sure way to make it stutter. Use the original image size that Handbrake suggests, Strict Anamorphic in Picture Settings. Anything higher is a waste of CPU time. If your originals have bad quality, add a noise filter. You can try turning CABAC off, that is quite hard on playback, and you can try changing deblocking to (-1, -1) or (-2, -2); both options lose a bit of image quality but make it a lot easier on the decoder. And you might try what happens with "average bitrate" instead of "constant quality". Average bitrate would make every bit of the movie equally hard or easy to decode; "constant quality" would use more bits for critical parts of the movie to keep the quality up, but that might be what produces stuttering.

The only thing that I really agree with you is disabling CABAC as it is likely the "straw that broke the camel's back" in this instance. The updated AppleTV preset disables CABAC and enforces vbv limits to prevent bitrate spikes larger than what the AppleTV can handle (as shown through testing). The AppleTV preset defaults to 960x540 to ensure maximum compatibility, but you can create 1280x720 encodes as long as you're aware of the playback limitations of the AppleTV.

That said, we're all entitled to our own opinions on what settings produce the best output. All that matters is that the results look good to you.

tommylotto
May 14, 2010, 11:04 AM
I know others here disagree, but my stuttering problem on certain files (e.g. Gladiator) would not go away no matter how I reduced the resolution of the encode. I was reducing a 1080p MKV to DVD resolution and it was still stuttering on the AppleTV. Then I changed the frame rate from "Same As Source" to the hard setting "23.98". BAM! Everything was perfect -- no stutter. I could even boost the resolution using the custom anamorphic setting to something like 1723x720 and still no stutter. It was beautiful. So, now, I first check in VLC to find out the actual fps of the MKV file and hard select that frame rate in handbrake as oppose to allowing handbrake to determine and select the frame rate for me. I think I have read that there is something wrong with some MKV's made by MakeMKV.

rayward
May 14, 2010, 11:14 AM
I have encoded a ton of Blu Rays through Handbrake. Every once in a while, one will stutter in the manner you describe. I simply re-encode the same rip using the same specs and so far not one has failed to come out perfectly on the second (or very occasionally third) try. It's a ballache to have to run the encode more than once, but it's either that or not have the movie in the library.

I have no idea why some come out that way. The only correlation I can infer is that the stuttering happens when I try to do anything else with my Mac while it's chewing on an HD encode. This makes no sense, but since I have made it SOP to avoid touching my Mac while it's at work (which includes not watching anything on my Apple TV that may be streamed) I have had 100% stutter-free results. If nothing else, this allows me to justify to myself the planned upgrade to an i7 iMac...

FWIW, I use the Apple TV preset, but adjust the picture settings so that anamorphic is set to "None" and the resolution is fixed at 1280 x xxx. That's just a personal preference, and I doubt it has anything to do with stuttering encodes.

roidy
May 14, 2010, 11:24 AM
These are the advanced options I use:-
226237
All of my HD video is encoded at 1280x720 and has a bitrate of around 6-6.5Mbps, I stream all of my content over a wired connection and my ATV never has a problem. I curently use HB 0.9.4svn3154 but have never had problems even using older versions.

bucksaddle
May 14, 2010, 12:28 PM
As others have mentioned, and also shown in roidy's screenshot, disabling CABAC is the key to this one. Although not officially supported as per Apple's ATV specs page I think it is safe(ish) to use on SD material but I would say it was a no-go on an HD source.
Your other advanced settings look pretty close to what I use and I have no problems with HD playback, with CABAC off.

Number6
May 14, 2010, 09:25 PM
First of all - thanks to all the people who replied. Just finished my re-encode and I am streaming (not syncing!) a 720p HD file with no stuttering to my Apple TV right now :D

The first thing I tried was what NightStorm suggested and got the latest nightly build of Handbrake. Using the new Apple TV preset I raised the 960 resolution to 1280 and that's it. The resulting file looks very sharp and finally there is no S-T-U-T-T-E-R!

The only thing that's not quite iTunes store HD quality are complex shades of color (mostly in backgrounds, sometimes in faces) which seem to become "busy" or having some kind of solarization effect. Hard to describe, might be because I am dealing with material that has been compressed before?

In the last column of roidy's settings there are some different values but I really don't know what they do. Maybe these could help with the "moving walls"?

Anyway, I will try the other failed encodes now, experiment a little bit and report back.

NightStorm
May 15, 2010, 08:27 AM
First of all - thanks to all the people who replied. Just finished my re-encode and I am streaming (not syncing!) a 720p HD file with no stuttering to my Apple TV right now :D

The first thing I tried was what NightStorm suggested and got the latest nightly build of Handbrake. Using the new Apple TV preset I raised the 960 resolution to 1280 and that's it. The resulting file looks very sharp and finally there is no S-T-U-T-T-E-R!
Glad to hear that worked for you. I've been using those settings for 50+ Bluray/HDDVD encodes with no issues so far.

The only thing that's not quite iTunes store HD quality are complex shades of color (mostly in backgrounds, sometimes in faces) which seem to become "busy" or having some kind of solarization effect. Hard to describe, might be because I am dealing with material that has been compressed before?
You're on the right track here... Apple/"the studios" have access to much higher quality sources when they encode for sale in the iTunes store.

roidy
May 15, 2010, 03:11 PM
The only thing that's not quite iTunes store HD quality are complex shades of color (mostly in backgrounds, sometimes in faces) which seem to become "busy" or having some kind of solarization effect. Hard to describe, might be because I am dealing with material that has been compressed before?

In the last column of roidy's settings there are some different values but I really don't know what they do. Maybe these could help with the "moving walls"?

Yep if you look at my screen shot you'll see I use both the 'No Fast-P Skip' and 'No DCT-Decimate' options and a deblocking value of -1,-1.

First the 'No Fast-P Skip' option is the one you want to stop the problem your having, namely the color banding(solarization effect). Don't let anyone tell you that color banding is because iTunes uses higher quality source because it isn't, I've seen the same problem on quite a few iTunes purchased encodes. If there is no color banding on your source material then there is no reason it should be on your encoded version.

Second the 'No DCT-Decimate' option will prevent the encoder from destroying subtle detail in the source material like filmgrain.

Third, the -1,-1 deblocking values are because I think Handbrake makes your encodes too soft and blurry with the default values.

The only downside to these options is a slightly longer encode time. Give them a try and see.

roidy
May 15, 2010, 03:18 PM
You're on the right track here... Apple/"the studios" have access to much higher quality sources when they encode for sale in the iTunes store.

And yet alot of the content sold on the iTunes store is still poor quality. Things have been getting better lately through:)

This thread is a good example:-
http://forums.macrumors.com/showthread.php?t=877155

stevol
May 15, 2010, 05:28 PM
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16)

Can someone tell us where to get the latest build of handbrake? I went to the supposed "snapshot" page, but no download was available. Thanks.

NightStorm
May 15, 2010, 07:41 PM
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16)

Can someone tell us where to get the latest build of handbrake? I went to the supposed "snapshot" page, but no download was available. Thanks.

Handbrake switched to nightly builds... There is a sticky in the handbrake forums with all the info you need.

stevol
May 15, 2010, 08:01 PM
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16)

Does the more recent nightly build(s) have any significant changes or improvements to the ATV preset? Would love to have a built-in preset for mkv from blu-ray to ATV (like an ATV 720p preset). Then we can relax on these forums knowing that the issues we are having are resolved (for now) and that the frustrating process has now become a piece of cake!

brentsg
May 16, 2010, 11:49 AM
The nightly builds aren't designed to address the presets, but to enhance code through bug and performance fixes.

You will have to experiment with the detailed settings on your own to identify a set that looks good to your eye, is optimal for your source material, and is optimal for whatever hardware you have on hand to encode with.

NightStorm
May 16, 2010, 02:27 PM
The nightly builds aren't designed to address the presets, but to enhance code through bug and performance fixes.

You will have to experiment with the detailed settings on your own to identify a set that looks good to your eye, is optimal for your source material, and is optimal for whatever hardware you have on hand to encode with.

There are some changes to presets from .9.4 to the nightlies. For example, the AppleTV preset now uses vbv limits to prevent bitrate spikes that cause issues with smooth playback on the device, especially for HD sources.

brentsg
May 16, 2010, 02:45 PM
There are some changes to presets from .9.4 to the nightlies. For example, the AppleTV preset now uses vbv limits to prevent bitrate spikes that cause issues with smooth playback on the device, especially for HD sources.

Good to know, thanks.

gnasher729
May 16, 2010, 03:28 PM
Third, the -1,-1 deblocking values are because I think Handbrake makes your encodes too soft and blurry with the default values.

People will argue whether stronger or weaker deblocking looks better, but deblocking needs to be done during playback, so less deblocking (-1, -1 or even -2, -2 instead of 0, 0) will use less CPU time during playback and therefore reduce stuttering.

roidy
May 16, 2010, 05:16 PM
I agree things like deblocking values are subjective, what I think looks good may not look good to everyone. However when I was testing setting to get the perfect encode I tried a wide range of deblocking values from -4,-4 right upto 4,4 and the ATV never had a problem playing any of them so while deblocking might have some effect on cpu usage during playback I doubt it would be to the extent as to cause any playback problems.

Number6
May 16, 2010, 06:32 PM
Finished a couple of encodes with roidy's deblocking and anti-color banding settings and here are my (mixed) results. The movie that was finally stutter-free but still had "busy" walls sometimes (see post #11) was redone and showed very slight improvement in the walls, but the difference was so small that it could've been subjective. An A-B comparison was difficult since there was always a little time gap but in the end the results were very similar. File size and encoding time were nearly identical as well.

I checked the original mkv (a rather large 1080p encode) in VLC and the artifacts were definitely not there. So my encoding should be the culprit. I wonder if I increase the file size would the encode profit from it? Going from 13,23 GB to 2,63 GB, there must be some visible loss. The iTunes store file of "Quantum of Solace" is 3,8 GB, looks great and is roughly 20 minutes shorter in running time. I have a Drobo and space is really not much of an issue. I would even go for 6 GB if it yielded better results.

Than I checked another file that was very interesting. A VERY grainy 70's movie that originated from a 6,59 GB mkv and came out at 2,57 GB with only 88 minutes runtime. I started streaming the movie and after a couple of minutes I encountered the dreaded freeze and stutter again. Not as severe as before but still there. So I decided to sync the file and continued watching. There was no more stutter but the most amazing part was that the grain was intact! And I'm talking a lot of grain and fog here. No compression artifacts anywhere to be seen and the movie looked like it should. I never encoded this before but surely roidy's settings must have been a factor here.

This result is sure worth syncing and maybe if I had a wired network that wouldn't even be necessary. Anyway I am at loss on how to not just create bigger files but better ones. I know that I can set a desired file size in Handbrake but that does not seem very scientific. Which size is "best" for which movie? Most Handbrake users seem to advise on using constant quality.

If anyone has any further thoughts please share.

roidy
May 17, 2010, 07:10 AM
Umm... The fact that your original 1080p source file is only 13.23Gb means it's already been heaverly compressed to start with so getting a good re-encode from it may be difficult, plus 2.63Gb for a encoded HD movie seems very small to me. Use 'Get info' in iTunes to see what the actual bitrate for the file is. iTunes purchased HD content usually has a bitrate of about 4500kbps, all of my HD encodes have a bitrate of about 6000-6500kbps. Looking at your file size I think your bitrate maybe too low. Post all the settings your using.

NightStorm
May 17, 2010, 08:19 AM
Umm... The fact that your original 1080p source file is only 13.23Gb means it's already been heaverly compressed to start with so getting a good re-encode from it may be difficult, plus 2.63Gb for a encoded HD movie seems very small to me. Use 'Get info' in iTunes to see what the actual bitrate for the file is. iTunes purchased HD content usually has a bitrate of about 4500kbps, all of my HD encodes have a bitrate of about 6000-6500kbps. Looking at your file size I think your bitrate maybe too low. Post all the settings your using.

I have quite a few HDDVDs that, once extracted wtih eac3to and remuxed using tsmuxer, are approximately 13-15GB when all extras have been removed.

While 2.63GB may seem small, you've really got to trust that the x264 encoder knows what its doing when it decides how many bits to use for a particular section of video. For the longest time, I had trouble with how small my HD encodes were coming out of Handbrake (for example, my HP6 HD encode finished smaller than the digital copy included from the studio). But after doing a lot of A/B comparisons, I finally accepted that x264 knows what how to efficiently allocate/distribute bitrate without compromising quality or bloating encode size. If I had to give a range, I'd say my encodes typically finish somewhere between 2.5-4.5GB in size and look great on the AppleTV.

As stated previously, I use the stock AppleTV preset (from the nightly), with the width increased to 1280. Many devs/mods recommend increasing RF with HD sources, but I decided to keep it at 20 to try and keep my presets as similar as possible.

roidy
May 17, 2010, 10:08 AM
I just assumed that the OP was encoding from a Blu-ray rip and that when he said the source file was only 13GB that it was from the internet and had already been compressed. We really need to know from the OP what his source is and weather it's been re-encoded already.

A HDDVD rip is going to be smaller that a Blu-ray rip simply because the physical disk holds less data, 15/30GB for HDDVD vs 25/50GB for Blu-ray. Early HDDVD films were more heaverly compresed to fit on a cheaper single layer disk. I have yet to see a Blu-ray rip thats under about 18GB.

I agree the Handbrake encoder does a wonderful job of deciding which areas of a file need more or less bitrate, but you've still gotta give the encoder a fighting chance by setting a sensible bitrate/CQ to start with. Set it too low and I don't care how good the encoded is your gonna get poor results. Until we know the bitrates of the OP's source and final output files we're just guessing as to his problem.

The smallest HD encode I have has a bitrate of 4600kbps and a file size of 4.13GB. I would never go any lower than that because the results just don't look as good, but thats just my own personnal preference:)

NightStorm
May 17, 2010, 10:28 AM
I just assumed that the OP was encoding from a Blu-ray rip and that when he said the source file was only 13GB that it was from the internet and had already been compressed. We really need to know from the OP what his source is and weather it's been re-encoded already.
Agreed; a copy of the activity log would go a long way (and is why we require one on the Handbrake forums).

A HDDVD rip is going to be smaller that a Blu-ray rip simply because the physical disk holds less data, 15/30GB for HDDVD vs 25/50GB for Blu-ray. Early HDDVD films were more heaverly compresed to fit on a cheaper single layer disk. I have yet to see a Blu-ray rip thats under about 18GB.
This could be true, if the studio actually took the time to go back and re-encode from the master for the Bluray release. Unfortunately, I've seen quite a few examples where they simply reused what they had already produced for the HDDVD release and left the majority of the disc empty.

I agree the Handbrake encoder does a wonderful job of deciding which areas of a file need more or less bitrate, but you've still gotta give the encoder a fighting chance by setting a sensible bitrate/CQ to start with. Set it too low and I don't care how good the encoded is your gonna get poor results. Until we know the bitrates of the OP's source and final output files we're just guessing as to his problem.
I would never suggest using ABR with any source, except maybe old concert footage. Using a lower RF value will always get to better quality, but if you set it too low, you'll continuously (and frankly unnecessarily) hit the VBV limits.

The smallest HD encode I have has a bitrate of 4600kbps and a file size of 4.13GB. I would never go any lower than that because the results just don't look as good, but that just my own personnal preference:)
That is what is both great and maddening about video encoding... what looks great to you can look like complete crap to someone else. But in the end, it's really all about how it looks to you and the compromises you've chosen to make (speed, quality, size). Given the limitations on the playback device (AppleTV), bandwidth (streaming via 802.11n), and my output device (46" 720p DLP), I'm content with the settings that I'm using. :)

roidy
May 17, 2010, 10:55 AM
That is what is both great and maddening about video encoding... what looks great to you can look like complete crap to someone else. But in the end, it's really all about how it looks to you and the compromises you've chosen to make (speed, quality, size). Given the limitations on the playback device (AppleTV), bandwidth (streaming via 802.11n), and my output device (46" 720p DLP), I'm content with the settings that I'm using. :)

Agreed, when I started out doing my first encodes I'd spent hours encoding a chapter of a movie then tweaking a setting and encoding it again just to get it perfect. But after awhile there comes a time when you just have to accept it's never gonna be 100% perfect and you have to stop tinkering. Luckly the current ATV preset gives you a really good starting point to experiment from. Even before tweaking the ATV preset given the right CQ setting it's hard to tell the difference between an encode and a regular DVD.

Number6
May 17, 2010, 06:26 PM
Umm... The fact that your original 1080p source file is only 13.23Gb means it's already been heaverly compressed to start with so getting a good re-encode from it may be difficult, plus 2.63Gb for a encoded HD movie seems very small to me. Use 'Get info' in iTunes to see what the actual bitrate for the file is. iTunes purchased HD content usually has a bitrate of about 4500kbps, all of my HD encodes have a bitrate of about 6000-6500kbps. Looking at your file size I think your bitrate maybe too low. Post all the settings your using.

Sorry I wasn't specific enough, here's what I know: the 13,23 GB file is a re-encoded Blu-ray rip and in Quicktime (with Perian installed) it shows to have a data rate of 13,87 Mbit/s. My iTunes encode has a total bit rate of 2749 kbps - quite a difference!
I also checked the nfo that came with the mkv and it has some info which I cannot interpret but maybe it is of help to you guys:

Size: 12.3GB (DVD9+DVD5)
Runtime: 2:07:06
Res: 1920x1040
Codec: x264, 2pass - L4.1
Bitrate: 12364 Kbps
Audio: DTS 5.1 1.5Mbps, English
Subtitles: English (SRT)

avis [info]: 1920x1040 @ 23.98 fps (182841 frames)
x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2 SSE3 3DNow!
x264 [info]: slice I:3146 Avg QP:15.66 size:255681
x264 [info]: slice P:116112 Avg QP:17.73 size: 89273
x264 [info]: slice B:63583 Avg QP:22.14 size: 9684
x264 [info]: mb I I16..4: 0.6% 99.1% 0.4%
x264 [info]: mb P I16..4: 0.0% 7.2% 0.0% P16..4: 46.7% 31.3% 14.3% 0.0% 0.0% skip: 0.5%
x264 [info]: mb B I16..4: 0.0% 0.2% 0.0% B16..8: 11.9% 1.0% 1.6% direct: 1.3% skip:84.1%
x264 [info]: 8x8 transform intra:99.5% inter:90.5%
x264 [info]: direct mvs spatial:98.2% temporal:1.8%
x264 [info]: ref P 64.7% 17.7% 10.6% 7.0%
x264 [info]: ref B 77.2% 16.2% 6.6%
x264 [info]: kb/s:12363.8

encoded 182841 frames, 2.34 fps, 12364.27 kb/s

My Handbrake settings for this encode were the same as yours roidy, at least the advanced settings that you posted. My main video settings are the ones from the Apple TV preset of the nightly build svn3293 x86_64 (2010051301), as Night Storm suggested. Only the resolution was raised to 1280x(in this case)688. The constant quality is left untouched at RF 20. The percentage counter seems to be gone.

I'm sorry but I cannot locate any log files from my encodes. Where would these be?

I would be interested in how you achieve the higher bitrates and larger file sizes that satisfy you. Do you set an average bitrate and if so, which one? You wrote that your encodes have an average bitrate of 6000-6500kbps. Isn't that asking for trouble since Apple states "Up to 5 Mbps" in the Apple TV video specs? Is it possible to push that limit?

Of course I am still thinking about my initial stutter problems regarding this.

Ironically I seem to have more problems the higher quality my source is. The best looking encodes seem to come from rather small mkv's to begin with. I have a Blu-ray drive and for months I have tried to encode some of my own discs with horrible results. Sometimes Handbrake states "no valid source found" when I load an uncompressed mkv or ts. I does not make any difference wether it was created with makemkv on the Mac side or AnyDVD HD+tsMuxeR on the Windows side :o Go figure...

Thanks again for all the helpful input from all of you guys!

Number6
May 17, 2010, 06:31 PM
Agreed, when I started out doing my first encodes I'd spent hours encoding a chapter of a movie then tweaking a setting and encoding it again just to get it perfect. But after awhile there comes a time when you just have to accept it's never gonna be 100% perfect and you have to stop tinkering. Luckly the current ATV preset gives you a really good starting point to experiment from. Even before tweaking the ATV preset given the right CQ setting it's hard to tell the difference between an encode and a regular DVD.

Just a quick addition. I believe I've been in this tinkering phase for quite some time now. The only problem is that I cannot let go (yet) :D

roidy
May 18, 2010, 06:55 AM
Sorry I wasn't specific enough, here's what I know: the 13,23 GB file is a re-encoded Blu-ray rip and in Quicktime (with Perian installed) it shows to have a data rate of 13,87 Mbit/s. My iTunes encode has a total bit rate of 2749 kbps - quite a difference!
I also checked the nfo that came with the mkv and it has some info which I cannot interpret but maybe it is of help to you guys:

........

The fact that the source has already been compressed may be why your having problems getting a good quality encode from it, I would try decreasing the RF value (remember that decreasing the RF actually increase the quality), aim for a bitrate of about 4000kbps minimum.

Recent versions of Handbrake now have the ability to encode a section of a file between a start and end time. I would play your encoded file and make a note of the time at which one the the low quality parts is then encode again from your source file using a start and end time of about 30 seconds before and after the problem part. This way you can do multiple encodes with different RF values to see if the quality increses and the encodes wont take long to do.

I would be interested in how you achieve the higher bitrates and larger file sizes that satisfy you. Do you set an average bitrate and if so, which one? You wrote that your encodes have an average bitrate of 6000-6500kbps. Isn't that asking for trouble since Apple states "Up to 5 Mbps" in the Apple TV video specs? Is it possible to push that limit?

First never use average bitrate as it's very wasteful. Getting a higher bitrate is as simple as lowering the RF value. Don't worry too much about the apple specs, I have files of 6500kbps that play fine and I think I read somewhere that the opening movie that plays when you first turn on your ATV has a bitrate of about 10000kbps and that plays fine:) The most important thing is too keep your peek bitrate under control and thats what the vbv-maxrate and vbv-bufsize options are there for.

Of course I am still thinking about my initial stutter problems regarding this.

After see that your output file only has a bitrate of 2749kbps then I can't see that being the source of your stuttering problem. Are you using 'same as source' for your Handbrake fps setting, some people have better luck forcing a framerate, so for your file you could try setting it to 23.976 and see if it helps, I've never had any problem using 'same as source' but some people report that forcing a framerate solves there stuttering problem.

Number6
May 18, 2010, 05:38 PM
Recent versions of Handbrake now have the ability to encode a section of a file between a start and end time. I would play your encoded file and make a note of the time at which one the the low quality parts is then encode again from your source file using a start and end time of about 30 seconds before and after the problem part. This way you can do multiple encodes with different RF values to see if the quality increses and the encodes wont take long to do.

That was good advice as I was already tempted to try the complete file a fourth time. I took only the worst part (the one with the "busy" walls) and encoded it several times going from an RF value of 20 down to 16 with several steps in between. The data rate increased, as you said it would but the artifacts remained no matter how high the data rate went.

I also tried a 2-pass encode set at 5500kbps average bitrate just for the fun of it and that brought back the stutter (all files were streamed), although I did not change the other settings regarding limiting peak bitrate etc. Still it did not improve the walls.

I'm just gonna give up on that one but this was still a very interesting experiment. At RF 17 the data rate was similar to what I get from the iTunes store with HD material and I will encode some better source files in that way now. Hopefully some Blu-rays that have been giving me problems will work with the new settings...

roidy
May 19, 2010, 04:42 AM
At RF 17 the data rate was similar to what I get from the iTunes store with HD material and I will encode some better source files in that way now. Hopefully some Blu-rays that have been giving me problems will work with the new settings...

Be aware that the data rate for a small 30 second segment of a film wont nesseceraly be the same as for a whole film. For example:-

Lets say you encode a full film with a RF of 20 and you get a bitrate of say 4000kbps.

Now if you just encode a small 30 second protion of the film using a RF of 20 then if that section of film contains hardly any detail like a nightime scene, the resulting bitrate may be really low like only 1000kbps. However if the 30 section contains lots of details then the bitrate will be much higher. Thats how CQ encoding works it gives more bitrate to the areas of the film that need it.

My point is you can't rely on the bitrate of a small section of film to give you the overall bitrate for the whole film:)