• 1
  • 5
  • 6
  • 7(current)
  • 8
  • 9
  • 25
[XBOX] HOW-TO encode videos in H.264 to be able to achieve playback on the Xbox
#91
u11241897135181 Wrote:Greeetings! I need to add a beginners type of question... Hope you guys won't mind.

I have handbrake. 0.9.2 build 2008021900. I understand where to paste the extra settings in the advanced box. My only worry is really about the default presets and settings. I'm after something as close to the actual dvd as possible quality wise.

1) Which preset should I use when pasting these settings into the advanced box.
2) Can i use denoise/deinterlace and those types of filters under picture settings?
3) Under video settings, do i change anything there at all? avg bitrate for example? or do i use constant quality 100% ??
3) does one make any changes under "audio and subtitles"? well except for the language and the subtitles.
4) Should the output settings be set to H.264 and AAC?

Well, those were the questions. Hope you guys can help me out. I'm rather daft when it comes to this stuff. Btw... (can't believe i'm asking this) This IS better than xvid right? I hope so, I want it to be, but I just don't know Smile

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...

http://www.wikihow.com/Properly-Encode-H...nning-Xbmc
Reply
#92
JPSiemer Wrote:There is also a Wiki in which we have created on this subject...

http://www.wikihow.com/Properly-Encode-H...nning-Xbmc
May I recommend that you also write an "HOW-TO encode H.264 videos compatible with XBMC for Xbox" article directly in our wiki as then you can edit it as you go along:
http://wiki.xbmc.org/?title=XBMC_Online_Manual
Probabably belongs here:
http://wiki.xbmc.org/?title=Tips_And_Tricks

PS! Tip is to register an user account on the wiki (if you don't already have one) then PM pike and ask for "ninja" access to that account, (note that anyone can do this, 'ninja' access means write rights).
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#93
Not sure how I managed to miss the wiki link. Found it the other day while browsing the thread for hints. Got it working now, many thanks!
Reply
#94
Aparker Wrote:Hey idahoxj,
I would like to test these settings of yours in handbrake. What are the other settings you use. I'm guessing you use an MKV container? Do you use average bit rate or what? If so what are the bitrates you use? Can you just post all the settings you set before encoding in handbrake, thanks man!

I use the mkv container, I use automatic cropping. On wide screen material I set the resolution to the sources cropped size, for full screen stuff I set the resolution at 640x416 because it seems to work better for now but I'm working on better full screen settings. I don't check any of the boxes on the picture tab.

Under the video tab I check 2 pass encoding and turbo first ppass (you can leave that unchecked but it takes less time and I haven't noticed a quality or compatibility issue) and I set the framerate to 23.976. I set the avg bitrate based on JPsiemers' last recomendations.

For the audio I usually just leave it on automatic selections and set the bitrate to 160 and the sample rate at 48. I select the subs if I need them and then I just paste my settings into the advanced window and start the encode.

Then I mux the file through mkvmerge gui when its done. I'm having no issues at all with this process and it is way better than the xvids I used to do. Dark scenes are so much better now, and my files are smaller.
Reply
#95
Thanks a lot, idahoxj!

That is exactly what I needed. I will these settings when I get home from work.
Reply
#96
Working on some new settings... Looks like I am getting equal quality with ~50% less skipped frames (from 77 on the previous settings to 36 on these new settings). That is my result for just one test video, so further testing needs to be done...

Settings For MeGUI (Using MeGUI Development Build v0.3.0.1010 & x264 Revision 891):

--pass 2 --bitrate Huh? --stats ".stats" --keyint 240 --min-keyint 24 --ref 5 --no-fast-pskip --bframes 5 --b-pyramid --b-rdo --bime --weightb --direct auto --nf --subme 7 --trellis 1 --partitions all --8x8dct --qpmin 10 --qpmax 51 --ipratio 2.8 --pbratio 2.6 --vbv-bufsize 1500 --vbv-maxrate 5000 --ratetol 10 --qcomp 0.6 --me umh --merange 16 --threads auto --thread-input --aq-mode 2 --aq-strength 1.0 --cqmfile "C:\CQM\EQM_AVC_HR.cfg" --progress --no-psnr --no-ssim --output "output" "input"

The main changes here are: "--ipratio 2.8 --pbratio 2.6 --ratetol 10 --aq-mode 2 --aq-strength 1.0 --trellis 1"... My first tests with Trellis were incorrect, and Trellis does not seem to be causing much (if any) of the skipped frames.

Some of the other settings are the default settings, but I defined them just to show you exactly what settings I was using. Please note, I am not using the "--mixed-refs" & the "--no-dct-decimate" tags. Also, I set the AVC Profile = "High Profile" & the AVC Level = "Unrestricted"... the reason for this is P4x4 macroblocks are not allowed in level 3 with B-Frames, so that means not all partitions are being looked at.

Get the latest MeGUI Dev Build @ http://sourceforge.net/project/showfiles..._id=156112

Get the latest x264 Revision @ http://mirror01.x264.nl/x264/


Let me know what you guys think...
Reply
#97
I finally have some settings that work well at full screen 720x480 resolutions. I switched from sharktooths matrix to mp4 guys M4G_LRM_V4 matrix because the bitrates get low enough to justify it and after few test encodes, it looks slightly better to me. I am using 941 as the max bit rate for 720x480 and the following settings.

level=40:bframes=3:ref=6Confusedubme=6:me=umh:no-fast-pskip=1:trellis=1:cabac=0:bframes=4:vbv-maxrate=5000:vbv-bufsize=1500:analyse=all:me=umhConfusedubme=6:cqm=.\CQM\M4G_LRM_V4.cfg:nf:keyint=240:min-keyint=24:ratetol=10:mixed-refs=1:brdo=1:b-pyramid=1:8x8dct=1:partitions=all:no-psnr=1:no-ssim=1:ipratio=2.8:pbratio=2.6:aq-mode=2:aq-strength=1.0:bime=1

Cabac is off and there are several other small changes from what I am using on widescreen encodes, I also do not use the turbo first pass option for this because with it on I was getting a small amount of blocking in dark empty space.

Ive only tested these settings on a shorter clips but they seem to hold up very well compared to my other settings that need to be upscaled more. x264 blows xvid away on a large hd display imo.
Reply
#98
idahoxj Wrote:I finally have some settings that work well at full screen 720x480 resolutions. I switched from sharktooths matrix to mp4 guys M4G_LRM_V4 matrix because the bitrates get low enough to justify it and after few test encodes, it looks slightly better to me. I am using 941 as the max bit rate for 720x480 and the following settings.

level=40:bframes=3:ref=6Confusedubme=6:me=umh:no-fast-pskip=1:trellis=1:cabac=0:bframes=4:vbv-maxrate=5000:vbv-bufsize=1500:analyse=all:me=umhConfusedubme=6:cqm=.\CQM\M4G_LRM_V4.cfg:nf:keyint=240:min-keyint=24:ratetol=10:mixed-refs=1:brdo=1:b-pyramid=1:8x8dct=1:partitions=all:no-psnr=1:no-ssim=1:ipratio=2.8:pbratio=2.6:aq-mode=2:aq-strength=1.0:bime=1

Cabac is off and there are several other small changes from what I am using on widescreen encodes, I also do not use the turbo first pass option for this because with it on I was getting a small amount of blocking in dark empty space.

Ive only tested these settings on a shorter clips but they seem to hold up very well compared to my other settings that need to be upscaled more. x264 blows xvid away on a large hd display imo.

Ya, you should definately use M4G_LRM_V4 for lower-to-medium bitrates, EQM AVC-HR Rev.1 for medium-to-high bitrates, and M4G HRM V2: HRM for high-to-very-high bitrates. Sorry if I didn't make this clear from the beginning... I only specified the "EQM AVC-HR" CQM because it is what you should be using for encodes under 720x400, 704x400, 688x416, 672x416, 656x432, & 640x448 with CABAC on. For encodes above these resolutions, use the bitrate-starved "M4G_LRM_V4" CQM and turn CABAC off.

Also, you have some duplications in your commandline... you have "me=umhConfusedubme=6" twice, and you have both "analyse=all" and "partitions=all" -- the analyse command is a synonym for the partitions command, so having both is not neccessary.

I'm still unsure about mixed-refs=1... is this causing any skipping? I read that it makes streaming more difficult and can complicate the decoding process (increasing CPU usage)... Let me know what you guys know about this...
Reply
#99
I have a working settings using cabac, deblocking, and trellis=2 at 720x480. Dropping the bitrate down to 400 allows the xbox to handle every advanced feature, and the quality is amazing for the file size (550MB for a 155 minute movie). I've only done a few test encodes and full length movie so far, the quality is just as good as a scene released xvid (700mb) but the file size is small.

I wouldn't say these are the best settings ever but I wanted to see what you could do with x264 and the xbox cpu. I have to say I'm impressed. Here are a few screens. You can see the cpu usage in a couple, I only had one scene with a small amount of stutturing and the dropped frames were mostly caused by taking the screens in xbmc. Without taking screens I had 32 dropped frames through the whole film.

Image Image
Image Image

And here are the settings I used for the encode.

level=40:bframes=3:ref=6Confusedubme=6:me=umh:no-fast-pskip=1:trellis=2:cabac=1:bframes=4:vbv-maxrate=5000:vbv-bufsize=1500:analyse=all:cqm=.\CQM\M4G_LRM_V4.cfg:keyint=240:min-keyint=24:ratetol=10:mixed-refs=1:brdo=1:b-pyramid=1:8x8dct=1:no-psnr=1:no-ssim=1:ipratio=2.8:pbratio=2.6:aq-mode=2:aq-strength=2.0:bime=1:aq-sensitivity=5:cplxblur=30:deblock=1,2:me-range=28

Let me know what you guys think of these settings.
Reply
idahoxj Wrote:I have a working settings using cabac, deblocking, and trellis=2 at 720x480. Dropping the bitrate down to 400 allows the xbox to handle every advanced feature, and the quality is amazing for the file size (550MB for a 155 minute movie). I've only done a few test encodes and full length movie so far, the quality is just as good as a scene released xvid (700mb) but the file size is small.

I wouldn't say these are the best settings ever but I wanted to see what you could do with x264 and the xbox cpu. I have to say I'm impressed. Here are a few screens. You can see the cpu usage in a couple, I only had one scene with a small amount of stutturing and the dropped frames were mostly caused by taking the screens in xbmc. Without taking screens I had 32 dropped frames through the whole film.

Image Image
Image Image

And here are the settings I used for the encode.

level=40:bframes=3:ref=6Confusedubme=6:me=umh:no-fast-pskip=1:trellis=2:cabac=1:bframes=4:vbv-maxrate=5000:vbv-bufsize=1500:analyse=all:cqm=.\CQM\M4G_LRM_V4.cfg:keyint=240:min-keyint=24:ratetol=10:mixed-refs=1:brdo=1:b-pyramid=1:8x8dct=1:no-psnr=1:no-ssim=1:ipratio=2.8:pbratio=2.6:aq-mode=2:aq-strength=2.0:bime=1:aq-sensitivity=5:cplxblur=30:deblock=1,2:me-range=28

Let me know what you guys think of these settings.

Well, for one... your screens look like scene Xvid releases, except the imperfections have been blurred out by increasing "cplxblur" to "30". If you are going for filesize, then these are good settings -- If you are going for quality, then drop the deblocking and CABAC and increase your bitrate to at least 900. You shouldn't have any skips, and you will have almost lossless quality. -- If you want a mix between optimum filesize and quality, then drop the deblocking (keep CABAC) and increase your bitrate to around 675 - 725.

I'd also like to point out that your "aq-strength=2.0" is a super high number. 0.5 is considered weak, 1.0 is considered standard, and 1.5 is considered to be high.

Also, you have both "bframes=3" and "bframes=4" ?

And your "level=40" isn't really suited for your settings. Either go "Unresrticted" or set it to "30" or "31". Check the Wikipedia page for more information... http://en.wikipedia.org/wiki/H.264

Overall, I like what you are doing and experimenting with different settings so that we all can benefit from what you learn, however, some logic and extensice research needs to be applied to what you are doing. For instance, it is concensus on this thread that deblocking is more harmful to us than any other x264 setting and is best turned off (unless you are encoding something tiny like 320x240).
Reply
I know the blur values are very high, I did that because the bitrate was so low and to smooth out artifacts, Those settings were an experiment to see what I could do and have a watchable result, I doubt I'll use them on any film I want to watch a lot. As far as the double bframe numbers I don't know how I did that but I used 4 on the encode. The odd thing about deblocking is that If you use the High Res Ipod defaults for handbrake, the file will play perfectly and they have deblocking. The resolution is at 640x.... but thats not that small, even if you turn cabac on, they still play 99% of time.
Reply
JPSiemer Wrote:Working on some new settings... Looks like I am getting equal quality with ~50% less skipped frames (from 77 on the previous settings to 36 on these new settings). That is my result for just one test video, so further testing needs to be done...

Settings For MeGUI (Using MeGUI Development Build v0.3.0.1010 & x264 Revision 891):

--pass 2 --bitrate Huh? --stats ".stats" --keyint 240 --min-keyint 24 --ref 5 --no-fast-pskip --bframes 5 --b-pyramid --b-rdo --bime --weightb --direct auto --nf --subme 7 --trellis 1 --partitions all --8x8dct --qpmin 10 --qpmax 51 --ipratio 2.8 --pbratio 2.6 --vbv-bufsize 1500 --vbv-maxrate 5000 --ratetol 10 --qcomp 0.6 --me umh --merange 16 --threads auto --thread-input --aq-mode 2 --aq-strength 1.0 --cqmfile "C:\CQM\EQM_AVC_HR.cfg" --progress --no-psnr --no-ssim --output "output" "input"

The main changes here are: "--ipratio 2.8 --pbratio 2.6 --ratetol 10 --aq-mode 2 --aq-strength 1.0 --trellis 1"... My first tests with Trellis were incorrect, and Trellis does not seem to be causing much (if any) of the skipped frames.

Some of the other settings are the default settings, but I defined them just to show you exactly what settings I was using. Please note, I am not using the "--mixed-refs" & the "--no-dct-decimate" tags. Also, I set the AVC Profile = "High Profile" & the AVC Level = "Unrestricted"... the reason for this is P4x4 macroblocks are not allowed in level 3 with B-Frames, so that means not all partitions are being looked at.

Get the latest MeGUI Dev Build @ http://sourceforge.net/project/showfiles..._id=156112

Get the latest x264 Revision @ http://mirror01.x264.nl/x264/


Let me know what you guys think...

Hey JP Could you put your new settings in a new profile. I am having trouble importing them in Megui. Huh
Reply
Witchdoctor Wrote:Hey JP Could you put your new settings in a new profile. I am having trouble importing them in Megui. Huh

It's pretty simple... All you have to do is look at what settings I used and then create a new profile from scrath using those settings. I don't see how hard this could be... I bet you could get this done in about five minutes...

Of course, I could also be nice and upload a file for you... but I am busy at the moment so I won't be doing one any time soon...
Reply
idahoxj Wrote:The odd thing about deblocking is that If you use the High Res Ipod defaults for handbrake, the file will play perfectly and they have deblocking. The resolution is at 640x.... but thats not that small, even if you turn cabac on, they still play 99% of time.

That's not really that odd. Skipless playback of video on the Xbox has a lot to do with how complex the codec is and how many pixels it has to display at a given bitrate. Since H.264 is the most complex codec we have, if you want skipless video you must reduce the amount of pixels being displayed in relation to how complex the settings you chose are to decode and in relation to the chosen bitrate. Choose no complex settings, you can use higher resolutions. Choose all complex settings, you have to use lower resolutions. Sometimes going down to 640x is all you need.

Let's do a little experiment. Say you have a video that is 720x480 and a video that is 640x480. If you multiply the horizontal res by the vertical res you get the amount of pixels per frame. So 720x480=345600 and 640x480=307200 -- that's a difference of 38400 pixels per frame. If you think about how many frames per second you have and how many overall seconds in a video you have, it starts to add up big time.

So you can probably have deblocking on for the 640x, and off for the 720x -- this is because you are lowering the strain of the CPU in one part of the decoding process and putting it to better use in another part.

This is exactly why I have reccomended settings along with reccomended bitrates, because it is my preference to have top quality at top bitrate. However, everyone has their own preferences too so I encourage experimentation as long as we lay these facts on the table so that everyone has a better understanding of the encoding/decoding process.

So anyways, if you assume that your settings are going to be the same for each encode, but you have two variables (bitrate and resolution), then your encoding job is pretty easy. What I do to find out the bitrate in relation to the resolution is I divide the res by the magical number "328320000" and that gives me the bitrate I use for my encode. Don't ask why, but this number has proven time after time to work. So if your vid is 720x304, then the equation should look like this: 328320000 / (720x304) = 1500. This formula works best when your overall pixel count is under 288000 (720x400). When you go above that resolution you can keep those bitrates, but you need to turn off CABAC. On another note, I also beleive that both CABAC and deblocking can be safely used at resolutions with a pixel count under 215040 (640x336).

Please correct me if I am wrong...
Reply
Hey guys, my hard drive crashed on my main computer.... I guess I was working it to death! But I won't be around here for a while until Seagate RMA's my drive, so good luck on your encoding endeavors and thanks for sharing and contributing to the thread... I think we all have found an awesome way to encode Xbox videos -- so our ultimate goal has been met! Later...
Reply
  • 1
  • 5
  • 6
  • 7(current)
  • 8
  • 9
  • 25

Logout Mark Read Team Forum Stats Members Help
[XBOX] HOW-TO encode videos in H.264 to be able to achieve playback on the Xbox10