[XBOX] HOW-TO encode videos in H.264 to be able to achieve playback on the Xbox

  Thread Rating:
  • 10 Votes - 4.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
sion28 Offline
Senior Member
Posts: 245
Joined: Jul 2008
Reputation: 0
Location: Northern California, USA
Post: #361
JPS, the posts you are reading asking for a template were moved here from another thread. Gavo posted an original thread with his post above. It went on for a few posts then some admin moved it here in its entirety. Thus my post which LINKED to this thread. Hopefully now that those concerned know about this thread and the 720p thread, their questions are answered.

BTW, AC3 and DTS both would offer the LEAST load on the xbox hardware, since they are passed via SPDIF to the external processor.
find quote
JPSiemer Offline
Senior Member
Posts: 128
Joined: May 2008
Reputation: 1
Post: #362
sion28 Wrote:JPS, the posts you are reading asking for a template were moved here from another thread. Gavo posted an original thread with his post above. It went on for a few posts then some admin moved it here in its entirety. Thus my post which LINKED to this thread. Hopefully now that those concerned know about this thread and the 720p thread, their questions are answered.

BTW, AC3 and DTS both would offer the LEAST load on the xbox hardware, since they are passed via SPDIF to the external processor.

Oh, ok... I was confused for a sec Confused Thanks for clearing that up...
find quote
SleepyP Offline
Posting Freak
Posts: 2,284
Joined: Nov 2005
Reputation: 4
Location: Portland, Oregon
Post: #363
OK guys, here's the deal: I recently went on a "check to make sure all your stuff is up to date" kick. Found that about 10 days a new SVN build of Handbrake was released on Windows. "Looks nice" I thought. Then I discovered the developers have straight up REMOVED support for Xvid entirely. They're basically saying "Xvid is old and H.264 is the new thing, its better!" Cue "research mode" and here I am. My goal is to figure out how to encode from DVD to H.264 using the latest Handbrake. It looks like they have much improved the control over the H.264 encoder, check out this screen cap:
[Image: LatestHandbrake.JPG]

Since I have a pretty decent quad core system and a pile of already-ripped DVDs here, I'm gonna try to build an equivalent preset for this new-fangled Handbrake.

Catchy Signature Here
find quote
SleepyP Offline
Posting Freak
Posts: 2,284
Joined: Nov 2005
Reputation: 4
Location: Portland, Oregon
Post: #364
This is kinda strange, but I adapted the settings from the wiki into the format Handbrake uses, which looks like this:
Code:
keyint=240:min-keyint=24:ref=8:mixed-refs:no-fast-pskip:bframes=6:b-adapt=2:b-pyramid:
weightb:no-cabac:subme=7:partitions=p8x8,b8x8,i4x4,i8x8:8x8dct:ratetol=4.0:qcomp=0.5:merang​e=32:me=umh:
Encoding that into an MKV container causes the encoder to crash almost immediately, but encoding to MP4 is working right now. Its extremely slow even on my quad core, so I won't know any results until later today, but at least its working Smile

Catchy Signature Here
find quote
SleepyP Offline
Posting Freak
Posts: 2,284
Joined: Nov 2005
Reputation: 4
Location: Portland, Oregon
Post: #365
So far I have hit some bumps in the road, but have successfully turned out some encodes that play with zero dropped frames.
The trickiest bit is that there are some settings available within the Handbrake GUI that it lets you set up but that cause the encoder to completely crash as soon as you start the encoding job. I am still figuring out which settings cause crashes, as I believe its just dumb stuff like having the audio bitrate setting too high.

I have a bunch of stuff to encode today and I'll report back results, but so far its looking good.
Here is my preset XML:
Code:
<?xml version="1.0"?>
<ArrayOfPreset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Preset>
    <Level>0</Level>
    <Name>Xbox H264-From DVD 704x400-Ogg 160</Name>
    <Query> -f mp4 -w 704 -l 400 -e x264 -b 1362 -2  -a 1 -E vorbis -6 stereo -R Auto -B 160 -D 4 -x keyint=240:min-keyint=24:ref=8:mixed-refs=1:no-fast-pskip=1:bframes=6:b-adapt=2:b-pyramid=1:weightb=1:no-cabac=1:subq=7:analyse=p8x8,b8x8,i4x4,i8x8:8x8dct=1:ratetol=4.0:qcomp=0.5:me=umh​:merange=32 -C 4  -v 1</Query>
    <PictureSettings>true</PictureSettings>
    <Version>svn2592</Version>
  </Preset>
</ArrayOfPreset>

Also here's a link to the latest Handbrake SVN, the "new one" which I am using:
http://forum.handbrake.fr/viewtopic.php?f=11&t=11201

Catchy Signature Here
find quote
badbob001 Offline
Junior Member
Posts: 8
Joined: Mar 2009
Reputation: 0
Post: #366
If h.264 videos are stuttering, one thing to try is playback with the dvdplayer instead of the default mplayer. This is done via xbmc's 'Playing using...' menu option. I have some 480p x264 videos that would slideshow at some scenes using mplayer but play much more smoothly with dvdplayer. Not sure why dvdplayer is smoother, but perhaps it's due to it being custom made for the xbox. This may be useful for those with videos that are just borderline, which saves you a re-encode.

I'm assuming the encoding test here are using the default mplayer. May be interesting (or a nightmare) to see how the dvdplayer performs.

There does seem to be compatibility issues with the dvdplayer. It just would freeze the whole system when trying to play some files. I suspect it may be an issue with files larger than 1GB.

Update: dvdplayer is fine and works great. It just needs a lot more ram than mplayer and when you don't have enough, the system will just freeze. With mplayer, I could run everything at 1080i on the xtv skin and 384x384 dvd covers. With dvdplayer, I had to reduce my covers to the default 192x192 and run at 720p. Now I have dvdplayer set to be the default player.
(This post was last modified: 2009-07-17 23:12 by badbob001.)
find quote
gavo Offline
Senior Member
Posts: 140
Joined: Apr 2009
Reputation: 0
Post: #367
that template isnt working with ripbot264.exe does anyone have a megui for xbmc h264 or another progrm that does work ripbot264 update most of stopped it from working.
find quote
zimdba Offline
Junior Member
Posts: 19
Joined: Jun 2006
Reputation: 0
Post: #368
SleepyP Wrote:So far I have hit some bumps in the road, but have successfully turned out some encodes that play with zero dropped frames.
The trickiest bit is that there are some settings available within the Handbrake GUI that it lets you set up but that cause the encoder to completely crash as soon as you start the encoding job. I am still figuring out which settings cause crashes, as I believe its just dumb stuff like having the audio bitrate setting too high.

I have a bunch of stuff to encode today and I'll report back results, but so far its looking good.

So how are your results? I'm only using AC3 Pass-through so I'm not really worried about the audio bitrate or CPU on the xbox required to process it.

Also, is the 1362 average bitrate, or constant bitrate? I encoded a test dvd clip and MediaInfo reported this:
Bit rate : 1 069 Kbps
Nominal bit rate : 1 362 Kbps

Thanks.
find quote
Gamzarme Offline
Junior Member
Posts: 3
Joined: Aug 2008
Reputation: 0
Post: #369
What sort of video file sizes are you guys getting with your encodes using the settings posted here in the first post? The reason I am curious is because I am attempting to adapt the settings to another h.264 encoder front-end. On a two hour movie (2:02:43, to be exact) with a bit rate around the 1300kbps (as measured in VLC) the resulting video is 1.1 GB total.

The reason I am excluding the entire *.mkv file in my question is because the audio codecs we choose to encode in vary, thus affecting file size. For instance I am using AC3/DTS to keep the processing down on the Xbox CPU. This audio format, along with two audio tracks and two subtitle tracks total, yields a total size of 1.7 GB for the entire file.

One more thing, I am using a quantizer of 2, as opposed to the less quality quantizer of 3. This allows for nearly flawelss playback and only drops frames maybe once or twice per movie. Of course this is only in areas of the film where there is much movement. What quantizers are you guys out there using?
find quote
zimdba Offline
Junior Member
Posts: 19
Joined: Jun 2006
Reputation: 0
Post: #370
I'm using my Monsters Inc DVD for testing encodings with Handbrake - as I find it's GUI the easiest to use thus far. However, I've had to manually play with the aspect ratio to get drop-free encodings. Additionally, it takes about 4 hours on my E8500 as opposed to about 2 hours using Divx or Xvid.

Since the source video is 2.35:1, I had to manually override the aspect ratio (it showed 1.78:1) to 720x304 and a bitrate of 1682 as suggested in the matrix. The Anamorphic setting didn't help one bit. So manually figuring out the bitrate & aspect ratio was a bit of a pain, but a drop-free encoding of 1.4GB as opposed to the source 4.17GB made it worth it. There is zero loss of detail that I can see on my 61" DLP. So hopefully I've found my solution. Now on to reencode the library . . .
find quote
Post Reply