Best settings for XBMC? Need help with compressing

HandBrake for Mac support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
cknyckny
Posts: 15
Joined: Wed Feb 28, 2007 12:48 am

Best settings for XBMC? Need help with compressing

Post by cknyckny »

Hello everyone.

I'm finally ready to convert my dvd collection of about 200 dvd's to a digital format. I'm using the newest media fork release. I've been doing some testing and wondering if anyone has any suggestion for use with an xbox and xbox media center. This will be my primary player for a while. Most DVD's have already been backed up from the originals so they're somewhat compressed or main movie only at about 4.3-4.7 GB. Not all are though.

I have ready that the best format to use is .avi and I want to keep the 5 channel sound since it's playing through my HT so I am looking at xvid codec, .avi/ac-3.

My problem is that I can't figure out how to get the best compression from my dvd's. I've tried file size of 1.3gb and constant quality of 60-70%. Some movies will look good, some will look pretty poor. Considering the encoding time I don't want to waste any time on re-rips so my question is... does anyone have good settings to share for the above usage? I'm not that concerned with storage space - I am concerned with quality. Use target size or avg bitrate?

Any pointers would be awesome.

Thanks!
Chris
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

You're not going to get good quality. You need uncompressed sources for that. So your uncompressed main title backups? Great. The ones that have been shrunk? Bad.

.avi is the worst container to use. Ever. You just don't have a choice, since you want 5.1 and I don't think the XBMC can play .mkv. (Not that HandBrake muxes to .mkv, but I digress...)

You should use x264, not XviD, unless you're dealing with a really grainy or noisy film (and I'd say even then...but that's for another thread).

Never use target size or average bitrate if you're not concerned with storage space and are concerned with quality. Especially if time is of the essence too. There were too many negatives in the first sentence of this paragraph so I'll rephrase it: Only use target size or average bitrate when storage space is a concern and quality isn't, or when you already know with certainty the bitrate a given movie needs for a given quality level and are willing to wait for a 2-pass encode.

Use constant quality in CRF mode (see the preferences--it's only available with x264). Try a sample chapter encode at a quality setting of 72%. That's a compression rate factor of 14.28, which should be more than enough for most movies out there. If it looks good, then start lowering the quality until it doesn't. I know you already did this with constant quality, but that was in the default mode, CQP, which works a little differently. (See: http://handbrake.m0k.org/forum/viewtopic.php?p=1607 )
cknyckny
Posts: 15
Joined: Wed Feb 28, 2007 12:48 am

Post by cknyckny »

your post was a big help, thank you. I guess I'll have to dig up all the originals from the attic.

I don't seem to have x264 as an option - only ffmpeg and xvid. I'll have to search for it.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

cknyckny wrote:I don't seem to have x264 as an option - only ffmpeg and xvid. I'll have to search for it.
Sorry, it's a little hidden. A long-time flaw of HB's user interface.

In output settings, see the Codecs dropdown menu? For x264, you want to set it to "AVC/H.264 Video / AAC Audio."

It defaults to "MPEG-4 Video / AAC Audio" with only ffmpeg and XviD available as encoders. Which is kind of confusing, especially as AVC/H.264 is technically a form of MPEG-4 video, so you'd think it'd be included there too...
one01
Posts: 7
Joined: Thu Jan 11, 2007 3:18 am

Post by one01 »

I would recommend you use MPEG-4 with ffmpeg as XBox Media Center does not have very good H.264 support. From what I can gather this is because the XBox hardware is not powerful enough for H.264.

I've converted a few movies into H.264 using the iPod compatible format and none would play using XBox Media Center. The movie would start to play, then the picture would freeze but the audio would keep going.

Recently I converted "The Departed" from DVD using MPEG-4 with ffmpeg and the movie plays fine on the XBox.
cknyckny
Posts: 15
Joined: Wed Feb 28, 2007 12:48 am

Post by cknyckny »

Well - i tried with x264 and it looks great. Thanks for the settings. Of course, this won't help me if xbmc won't play it. I'm still waiting for the xbox to arrive so one01: what settings would you recommend using ffmpeg?

It seems that with a constant quality encode at 70% using ffmpeg I still get a crappy encode.
MySchizoBuddy
Posts: 30
Joined: Thu Feb 15, 2007 3:51 pm

Post by MySchizoBuddy »

Doesn't XBOX stream content from media center. As long as u have on the fly transcoding u can play anything on xbox.
The reason x264 doesn't work on xbox is because media center doesn't know how to transcode it.

U need a plugin called TVersity (http://tversity.com/screenshots/). that will convert ur files to something xbox can understand (wmv). It will do on the fly transcoding so it will be totally transparent. U select ur movies in x264 or xvid and it will play on xbox. It might take like 10 sec to start playing, but that depends on the settings u use.

I won't advice u to go the Mpeg 4 or x264 route. since they are going to be converted to wmv anyway. why not code all ur movies in wmv from the start. DVD -> WMV rather than DVD->x264->wmv
nite
Posts: 5
Joined: Mon Mar 05, 2007 9:09 pm

Post by nite »

no u don't need TVersity thats ony needed for xbox360. An xbox w/ xbmc (modded obviously) plays anything MPlayer does , and over a network. very nicely.
one01
Posts: 7
Joined: Thu Jan 11, 2007 3:18 am

Post by one01 »

From Wikipedia article at http://en.wikipedia.org/wiki/XBMC,
Again with its 733 MHz Intel Pentium III Celeron and 64MB shared memory, the Xbox does not have enough hardware-resources (not fast enough CPU nor large enough RAM-memory) to play MPEG-4 AVC (H.264) encoded videos with Cabac and Deblocking if the video-resolution is higher than 352x288 pixels. Workaround: If you encode your MPEG-4 AVC (H.264) videos without Cabac and Deblocking then the Xbox hardware can handle up to 720x576 pixels video-resolution. It is best to encode your videos to MPEG-4 ASP (like DivX or XviD) instead, as then that video's native-resolution can be anything up to 960x540 pixels (a.k.a. HRHD resolution).
tehjr
Posts: 2
Joined: Fri Apr 13, 2007 5:21 pm

Post by tehjr »

does anyone have a preset they use for converting video to play on XBMC?

Also, has anyone tried the new MPlayer.dll for their XBMC?
http://www.xboxmediacenter.com/forum/sh ... hp?t=23969

It claims to have a faster h264 decoder.
chuckyboy81070
Posts: 16
Joined: Fri Feb 23, 2007 11:44 pm

Post by chuckyboy81070 »

tehjr wrote:does anyone have a preset they use for converting video to play on XBMC?

Also, has anyone tried the new MPlayer.dll for their XBMC?
http://www.xboxmediacenter.com/forum/sh ... hp?t=23969

It claims to have a faster h264 decoder.
I've tried it and it seems to work fine with h.264 on XBMC. I've ripped about 100 DVDs to mp4 files using the following settings:

x264b30
framerate = 29.97
bitrate =1600
width =640
tehjr
Posts: 2
Joined: Fri Apr 13, 2007 5:21 pm

Post by tehjr »

I'll give that a shot, thanks for the help.

One more question: what is the b30 in x264b30. I'm guessing it's some sort of beta version?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

tehjr wrote:One more question: what is the b30 in x264b30. I'm guessing it's some sort of beta version?
No, it means baseline profile, level 3.0, cabac=false.
thepeel
Posts: 2
Joined: Mon Apr 16, 2007 5:43 pm

My Settings

Post by thepeel »

It took me a long time to finally settle on something and here's what I came up with.

If you don't care about size the main thing is to set your bitrate.

I usually float between 1500 and 1800. 1500 for movies that don't have a lot of night/dark scenes and 1800 for darker or more action packed movies.

Most people will tell you these are overkill but I disagree.

I also use FFMPEG as it is loads faster than h264 in encode times. If I didn't care about speed I'd use h264.

Definitely check 2-pass encoding.

Originally I was doing everything as an avi with AC3 sound as XBMC will not only handle AC3 sound but will output it through the optical output (If you have the HD cables) to your decoder.

I still use these settings for action movies but for kids movies I use mpeg-4 and aac so I can put them on my iPod if necessary. The iPod can, surprisingly enough, handle 1.5GB+ files without much problem.

Very rarely have I been disappointed with any of these settings.

One caveat however. There seems to be a bug in XBMC where it won't let you skip forward in avi files over 2GB. I recently ripped Blood Diamond at 1800 and it came out at 2.3GB. I was unable to advance through it. After setting the target size to 2.0GB (Bitrate of 1494) I was able to skip through it.

Not sure what that's all about but it's manageable.

Let me know if you have any more questions.

I have two XBMC setups and stream video from my PowerMac Dual 2.5GHz G5.
datatracer
Posts: 1
Joined: Thu May 03, 2007 6:00 am

H264 DOES WORK with XBMC!

Post by datatracer »

I'm so tired of seeing posts about how the original Xbox is an underpowered machine that won't play H264 enconded files. This is FALSE folks! I've encoded a bunch of DVDs in my collection with H264, and I "stream" them across my network from a Linux server using an SMB share with absolutely no problems displaying them on a standard def' TV.

To encode, I use either the CLI interface of HandBrake on my linux machine, as well as the Mac OS X version. I've used both AVI and MP4 containers, and I can't really tell a difference between the two. Lately I've settled on the following settings...

File type: MP4
Video: h264 (base)
Audio: AAC, 96k
Target size between 650-900 MB depending on the length of the movie.
2-Pass Encoding

Sitting on my couch, I rarely see digital artifacts, but you can see them upon close inspection sometimes. I'm assuming the people who are having problems displaying h264 on an Xbox are either trying to display to a HDTV set or are encoding using too high of a bitrate.
broaddd
Posts: 18
Joined: Mon Mar 12, 2007 3:34 am

Post by broaddd »

I have tried both the mplayer.dll etc linked to here, and just installed the latest T3CH XBMC, but neither allows my Xbox to play an h.264 file created in Handbrake with the iPod (baseline) default OSX setting at 1600kbps... just stutters to a halt.

Any tips?

Edit: just tried encoding the same file at 640x374 instead of anamorphic (672x476), and at 1500kbps, and it plays fine. Hmmm.
theJRK
Posts: 2
Joined: Sat Sep 15, 2007 1:43 pm

XBMC settings for GUI

Post by theJRK »

I've had the best luck using jbrjake's h.264 recommendation + no-fast-pskip. From the GUI that would be

level=30:cabac=0:no-fast-pskip=1

You could spend days messing with data rates for each video. 1600 has worked fine in all applications -- might be overkill for some or not pushing it on others, but perfectly fine for viewing on my 42" plasma from 10 feet.

In 0.9.0 anyway the presets mess up containers and generally complicate things where Windows HB and XBMC settings are concerned. For instance, choosing iPod presets after choosing the destination will reset the video container to m4v, checking PAR and other settings. Those may conflict with h.264 settings causing app death on my machine during muxing. That may have been the case in 0.85 as well (and may be documented somewhere) but I'm not looking back.
Post Reply