[XBOX] HOW-TO encode videos in H.264 to be able to achieve playback on the Xbox - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Announcements, Info, and General Discussion (/forumdisplay.php?fid=85)
+--- Forum: Tips, tricks, and step by step guides (/forumdisplay.php?fid=110)
+--- Thread: [XBOX] HOW-TO encode videos in H.264 to be able to achieve playback on the Xbox (/showthread.php?tid=33429)
- PKOneTwo - 2008-07-17 14:27
JPSiemer Wrote:I am back with new settings and a new Wiki page....
Hey JP. I've done some researching in audio codecs (since i had my av receiver) and now I've got something here:
As you may know AC3 Track gives alsmost the best quality, if you have a dvd source, becuase DVD is AC3 !!!
Why do you use still use AAC (when you have and DVD source).
Advantages of ac3:
- BETTER QUALITY (compared to AAC or Mp3 or OGG)
- NO CPU USAGE (almost every user has an AV receiver where you can pass through => 0% CPU Usage and letting x-box decode for people without av receiver =Y about 2-5% Usage)
- SMALL (it isn't as small as aac BUT it is not much bigger than usal MP3
If you have a DVD source its the BEST choice and your file will get about 50-70 megs bigger than usual AAC (depending on AAC Bitrate)!!!
If you have a video where the audio source isn't AC3 (like MPG1 or some other codecs), I would use MP3 instead of AAC:
- if your video is not a dvd source, than (by a very extreme high percentage) it is already ripped and rencoded OR a bad quality =>
no need to use aac, ust use MP3, there won't be a less in the audio at all
- ALMOST every source is a DVD => AC3 or would you re-rip / re-encode an old rip
I like AAC, but what i donÄt like about it is: it uses A LOT CPU RESOURCES, A LOOOOOOOT! It's about 20-30%.
I really like to see people using the CPU resources of about 20 - 30% for decoding the video, for instance in very complex scenes !!! Or for higher bitrates n the video !!!
- rcrh - 2008-07-21 15:44
JPSiemer Wrote:Please read the thread. Every single one of your questions has been answered. There is also a Wiki in which we have created on this subject...
JP, I realize you've done a tonne of work getting this to work using MeGUI but is there any chance of getting your final results translated back into an advanced setting for Handbrake?
I just can't get past how easy Handbrake is compared to MeGUI. Particularly the amount of steps you have to go through BEFORE you start encoding.
thanks for all of this great work. I really hope the
- JPSiemer - 2008-07-23 12:27
rcrh Wrote:JP, I realize you've done a tonne of work getting this to work using MeGUI but is there any chance of getting your final results translated back into an advanced setting for Handbrake?
Ya, Handbrake is easy to use but it just doesn't give me the freedom I need... Nonetheless, its great for the masses so give it a go...
Just input my settings into the GUI in the dialogue box and you're good to go... pretty simple task...
- JPSiemer - 2008-07-23 12:49
PKOneTwo Wrote:Hey JP. I've done some researching in audio codecs (since i had my av receiver) and now I've got something here:
I really like this post. You make a lot of good, valid points.
However, keep in mind that I always re-encode AC3 6 Channel audio to AAC 6 channel audio so the difference is size is a couple hundred MB. On 2 Channel audio the difference is minimal, like you said. I would like to go to MP3, but you cannot encode 6 channel MP3's.
On that other hand, you are actually onto something.... And it might be worth the extra couple hundred MB to use AC3 -- or the loss of fidelity and 5.1 in MP3. You see, in my tests with these new encodes I have been doing, videos encoded with deblocking had no problem playing back IF no audio track was muxed. But the addition of the audio track to the same exact video brought back the skipping. At first, I didn't equate this to the AAC codec using so much power, but now it makes a lot more sense...
So, in theory, you should be able to use the current settings posted in the wiki along with deblocking (remove the "-nf" option) as long as your audio is AC3 or MP3.
It would be interesting to know how much CPU 6-Channel AC3 uses and how much CPU 2-Channel MP3 uses. I'm assuming your "2-5%" figure is for 2-Channel AC3...
Can you guys give this a test and post your results? I would but I'm still having slight computer problems... I think my mobo is slowly dieing!!!
- PKOneTwo - 2008-07-23 21:20
I'm happy being to help ;-)
i was referring to this: if you use Ac3 and have an Av receiver connected with toslink (digital connection) to X-box, so the Ac3 stream (doesn't matter 2 or 6 channel) is pass throughed to the receiver. There is no intervention of the xbox, no CPU usage, nothing! You can use 100% CPU for video.
If you don't have an AC receiver, then the x-box have to decode the ac3 stream to analoge output => for 2 channels about 2-3%. (i dind't test the 6 channels AC3 to 2 channel analoge conversion, but may be about 7%).
Anyway: since we are all using DVD as a source: you can take the AC3 stream and there will be NO LOSS (nothing) of sound quality, and CPU can be used 100% for decoding.
Yes AC3 is little bigger than than AAC, but the difference is 100 -150 MB /at most). And don't firget one thing: you still can reencode the 6 Channel AC3 to a lower bitrate (say 224 Kbit). Is will become a difference of about 75MB then and the sound ist still almost perfect.
PS: I think if you use Mp3 the x-box CPU is used again (doesn't matter if you have Av receiver or not) because the decoding is done by the cpu. But the CPU usage is low (about 5%).
So finally: keeping AC3 stream ist the best thing you can do:
you can reencode it to a lower bitrate AND uses very LOW cpou usage for analoge output und NO CPU for pass through.
hope could answer ur questions.
JPSiemer Wrote:I really like this post. You make a lot of good, valid points.
- rcrh - 2008-07-23 22:59
JPSiemer Wrote:Ya, Handbrake is easy to use but it just doesn't give me the freedom I need... Nonetheless, its great for the masses so give it a go...
HEY, are you calling me massive? I might eat the occasional pizza entirely by myself, but come on!!!!
OK, kidding aside, way back on the first page of this thread you had handbrake settings as follows:
Are these still your final & best recommendations?
I ask because I see you've done a lot of further testing in megui. If any of these improvements can be translated back to HB I would be appreciative.
- JPSiemer - 2008-07-24 02:12
rcrh Wrote:HEY, are you calling me massive? I might eat the occasional pizza entirely by myself, but come on!!!!
No... these settings are outdated. It is not hard to translate the settings from MeGUI to Handbrake as they use the same language.
Anyways, I'm using the latest snapshot of HB @ http://handbrake.fr/?article=snapshot -- though, it probably doesn't matter if you are using the previous version.
2 Pass Encoding: CHECK
Average Bitrate: Use The Wiki Chart
Audio & Subtitle Tab:
Audio Codec: MP3, Vorbis, or AC3 (No AAC!)
The Advanced tab must match these values (or lower). All other settings in all the other tabs can be set to whatever you want (except for the couple of settings listed above).
NOTE: I have not tested these settings on Handbrake but they should work fine.
- JPSiemer - 2008-07-24 03:44
Well, after some initial tests with audio codecs, it seems that AC3 is going to the best option for people encoding H.264 for the Xbox.
My first test was encoding a video with 6-Channel Vorbis OGG and encoding the same video with 6-Channel AAC. I purposely maxed out the video settings on both to force skipped frames. That resulted in two videos that skipped a TON of frames, however the AAC file skipped a lot more than the OGG.
So then I encoded that same video with the same settings with 6-Channel AC3 audio, and that resulted in a video that dropped 40% less frames than the OGG and AAC.
So that proves that if you are looking to preserve your 6 channels, go with AC3 no matter what. The Xbox has less trouble decoding this format than any of the others.
I did not test MP3 yet, but seeing as you can't make a MP3 truly 6-channel, it would be safe to assume that the Xbox requires very little processing power to decode a 2-channel MP3, and probably even less for a 2-channel OGG (because OGG requires less CPU power than MP3). So if you are going for 2-channel audio, then I suggest either MP3 or OGG or AC3, but NEVER AAC.
So, to break it down...
--- AC3 (best option)
--- OGG (for vids with NO complex scenes)
--- MP3 (not possible)
--- AAC (never use)
--- AC3 (best option)
--- OGG (2nd best)
--- MP3 (3rd best)
--- AAC (for vids with NO complex scenes)
Hope this helps everyone out... Thanks goes to PKOneTwo for the valuable tip.
- PKOneTwo - 2008-07-24 13:38
Glad to see this (like i mentioned before)
But don't forget THE BEST PART: IF YOU passthrough THE AC3 (channles doesn't matter), the CPU won't be used in anyway. Because the decoding is done by the AV receiver.
JPSiemer Wrote:Well, after some initial tests with audio codecs, it seems that AC3 is going to the best option for people encoding H.264 for the Xbox.
- seph100 - 2008-07-26 21:09
Forgive me if this is noobish question as I am new to the encoding process. I followed your wiki article to the T but I am getting an error. MeGUI will encode the audio but when it moves onto what should be the first pass through the video it comes up with this error:
An error occurred: x246 [error]: ratecontrol_init: can't open stats file
An error occurred: x264 [error]: x264_encoder_open failed
This lead me to believe that the problem was with the --stats file part of the command. I created the file manually and I still get the error. I have searched on google to no avail. Any help would be greatly appreciated.