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

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Tips, tricks, and step by step guides (https://forum.kodi.tv/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)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25


- Jhcheslik - 2009-01-16

sion28 Wrote:I couldn't figure out how to get the command line to match what's in the wiki guide. So I downloaded the presets .ZIP file posted by the OP. Problem is, even THAT doesn't match EXACTLY what's listed in the wiki guide.

When I load the "Xbox HIRES" preset, here's the command line options I get:

Quote:program --pass 2 --bitrate 1250 --stats ".stats" --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 --vbv-maxrate 1500 --ratetol 4.0 --qcomp 0.5 --me umh --merange 32 --threads auto --thread-input --aud --progress --no-psnr --no-ssim --output "output" "input"

That's strange. I was the one who uploaded it. I had no problem with it (neither did JPSiemer), I'll double check. Thanks for pointing it out.

By the way, for a quick fix. Do this.

Image

I'm not sure about --aud tho. I'll look it up tonight.


- Jhcheslik - 2009-01-16

Rookie Wrote:No he is just saying the better the source the better the picture.Nothing to do with a file already converted.

Are you asking if it would save you some time encoding? The answer is no.

All of the encoding process will be same, depending on how many pixels you are encoding. The more pixels, the longer it'll take.

For example, encoding a 720p movie at 1280*544 would take WAY MUCH longer than at 800*336

Hope that answer your question.

The only reason why this would take less time is because you don't have to rip it from DVD and analyze it if its interlaced or not. (All of the scene release are in progressive mode.)


- JPSiemer - 2009-01-17

Rookie Wrote:JPSiemer .....Would it be easier and less time consuming to take a scene release as such and re-convert a already converted file?(Not sure if it's possible)

Example: Max.Payne.UNRATED.2008.BRRip.DTS.x264-SDxT

SiZE..........: 2.05
ViDEO CODEC...: x264,@ L3-2pass
FRAMERATE.....: 23.97 fps
BiTRATE.......: 1298 Kbps
RESOLUTiON....: 720x304
SUBTITLES.....: ass.Greek /By Doden-English[br]i
AUDiO.........: English DTS 5.1 1.5 mbit
SOURCE........: Max.Payne.UNRATED.2008.BLuray

Since that BRRip is already down-converted to Standard Defintion, it should take about the same amount of time that it takes to rip a DVD.

To be honest tho, I don't know why you would want to reconvert this file... Being a BRRip means that it was ripped from a BluRay disc at full rez/full bitrate, reencoded once by a scene group to 4000-8000KBps at half its original rez, then reencoded a second time by SDxT to 1298KBps at half of that rez, and now you want to reencode it a third time... Leave the poor movie alone -- it's already been through enough!


- reydecopas - 2009-01-17

Hi all men!!

I am trying to find a KISS way to get re-code 720p x264 mkv tv shows (like Heroes :http://thepiratebay.org/torrent/4409805/Heroes.S03E01.720p.HDTV.X264-DIMENSION.mkv)
for playing nicely on xbmc on xbox.

I've been trying mapping options from wiki h264 GoodQuality to mencoder

mencoder -nosound -of rawvideo -ovc x264 \
-x264encopts turbo=1: pass=1:bitrate=1250:keyint=250:keyint_min=25:frameref=8:mixed_refs:nofast_pskip:bframes=6:b_adapt:b_pyramid:weightb:nodeblockConfusedubq=7:trellis=2: partitions=p8x8,b8x8,i4x4,i8x8:8x8dct:ratetol=4.0:qcomp=0.5:me=umh:me_range=32:threads=auto:nossim:nopsnr\
-noskip \
"INPUTMKV" -o /dev/null

mencoder -nosound -of rawvideo -ovc x264 \
-x264encopts pass=2:bitrate=1250:keyint=250:keyint_min=25:frameref=8:mixed_refs:nofast_pskip:bframes=6:b_adapt:b_pyramid:weightb:nodeblockConfusedubq=7:trellis=2: partitions=p8x8,b8x8,i4x4,i8x8:8x8dct:ratetol=4.0:qcomp=0.5:me=umh:me_range=32:threads=auto:nossim:nopsnr\
-noskip \
"INPUTMKV" -o movie.264

and then
mp4creator -c movie.264 -rate 25 movie.mp4
mkvmerge -o $NAME.mkv -A movie.mp4 sound-track.ac3

The XBOX hangs while mplayer in PC plays well

Can anyone recommend other way/tool?
Which tool do you use for transcoding: x264 cli, mencoder, ffmpeg?

Thanks


- Rookie - 2009-01-17

Thanks JPSiemer for the reply.

@ reydecopas...I have heard people say Tversity transcoded videos for them through their network.It has not worked for me but some people claim it does.Look around the forums I remember seeing some posts about the settings Tversity uses.Maybe somebody here can give you a link.


- Jhcheslik - 2009-01-18

Jhcheslik Wrote:I'm not sure about --aud tho. I'll look it up tonight.

Ah ha. Just updated the MeGUI to 0.3.1.1010 and figured it out was the MeGUI itself.

I checked the changelog.

Quote:- (kurtnoise) [x264Encoder] restrict --aud command to raw avc output files.

But I still don't know exactly what --aud is for though.

Update: I downloaded the profile from the link on first post, and imported it to MeGUI and it was fine to me. I'm not sure why you got --vbv-maxrate 1500 at all.


- sion28 - 2009-01-19

Jhcheslik Wrote:Ah ha. Just updated the MeGUI to 0.3.1.1010 and figured it out was the MeGUI itself.

I checked the changelog.



But I still don't know exactly what --aud is for though.

Update: I downloaded the profile from the link on first post, and imported it to MeGUI and it was fine to me. I'm not sure why you got --vbv-maxrate 1500 at all.

I think it must have got checked somehow when I was messing around, then when I imported the profile, it remained checked. Don't know why, but that's all I can think of. I still can't get the --aud switch to go away though.

And I'm still getting an error when I hit autoencode. Sad


- djenyc - 2009-01-19

So, is anyone using 1-pass constant quality mode, instead of target bitrate?

- I've had good results with Q=22 and deblocking/cabac, about 50% reduction in size compared to 2-pass 1280 kbps with no visible compression artifacts, and since it's done in one pass, it goes much quicker.


fatal error from MeGUI - sion28 - 2009-01-19

So as stated earlier, I keep getting a fatal error when I get to step 16 in the wiki guide. (edit: the error happens when I click the "autoencode" button in step 16) Here's a screen shot of the error:

Image

I have no idea what's causing this. The input and output paths for the AC3 audio are identical. Any help would be greatly appreciated.

I was able to follow the wiki guide EXACTLY this time. (even the --aud switch was not present, so my command line was exactly as shown in the wiki guide).

Thanks ...


- Jhcheslik - 2009-01-19

sion28 Wrote:So as stated earlier, I keep getting a fatal error when I get to step 16 in the wiki guide. (edit: the error happens when I click the "autoencode" button in step 16) Here's a screen shot of the error:

Screenshot

I have no idea what's causing this. The input and output paths for the AC3 audio are identical. Any help would be greatly appreciated.

I was able to follow the wiki guide EXACTLY this time. (even the --aud switch was not present, so my command line was exactly as shown in the wiki guide).

Thanks ...

Why would you have input and output paths for AC3 audio identical?

That's probably the reason of the error. I tested it myself. Change the output to different name, like Sound.ac3 or whatever.

The reason why it wouldn't work is because when you encode an audio, it'll overwrite the original one at same time... so its like, you don't have any audio to encode at all. Oo

Let me check the Wiki. It probably need some updating.


- Jhcheslik - 2009-01-19

djenyc Wrote:So, is anyone using 1-pass constant quality mode, instead of target bitrate?

- I've had good results with Q=22 and deblocking/cabac, about 50% reduction in size compared to 2-pass 1280 kbps with no visible compression artifacts, and since it's done in one pass, it goes much quicker.

Hmm. That's interesting. Can you upload a sample clip? 2 minutes is long enough.

By the way I sometimes use CQ 1 pass. For most of the Bluray rip so that way I could keep resolution high and still have nice looking video. I don't give a crap what filesize I get at end. I'm just glad with quality I will be getting. (Not only that, but it's also faster too, just like you stated.)

I think I should figure out what bitrate each CQ number would spit out.


- Jhcheslik - 2009-01-19

Sorry for triple post.

Hey JPSiemer, I'm starting to thinking about how VBV Maximum Bitrate would help eliminate the choppy part in video ever farther.

Like for example, if I was to stream a video over to my friend, and I know I have upload cap of 600 kb/s, then I would set my VBV Maximum Bitrate cap to 550 or something so the video will NEVER go above 600 bitrate.

Same case with encoding movies. At some point it will be 600 bitrate, but then when complex scene come up then they'll do insane high bitrate, but at end, it'll all be averaged out at target bitrate.

Just a thought.


- djenyc - 2009-01-19

Jhcheslik Wrote:Hmm. That's interesting. Can you upload a sample clip? 2 minutes is long enough.

By the way I sometimes use CQ 1 pass. For most of the Bluray rip so that way I could keep resolution high and still have nice looking video. I don't give a crap what filesize I get at end. I'm just glad with quality I will be getting. (Not only that, but it's also faster too, just like you stated.)

I think I should figure out what bitrate each CQ number would spit out.

Yes, I think Average Bitrate (2pass) is for burning discs, where as Constant Quality is more appropriate for a media server where you don't need to hit an exact file size. In addition to faster encodes, Constant Quality will use bitrate appropriate to each file (e.g. high motion action material will get more, talking heads in front of a wall will get less) and also take video resolution in to account.

I've uploaded a zip file with several samples at different quality settings here:
http://www.sendspace.com/file/o20ueu

They are only 10 seconds long, but hopefully will give at least some idea on what to expect:

For file size vs quality, for the 10 second clip with no sound:
Q20 - 1967kb
1278kbps (2pass) - 1600kb
Q21 - 1426kb
Q22 - 1015kb
Q23 - 728kb
Q24 - 540kb

A 1:28 movie encoded with x264/Q22 and AC3/6ch@224kbps ended up at 600mb. Originally I encoded it with x264/2pass 1278kbps and AC3/6ch@448kbps and it was ~1250mb.

I've seen several people recommend Q22 for high quality encoding, while others were using Q24-Q26. I found no difference between Q26 and Q24 while watching movie on 27" CRT TV, but could see slight difference between Q24 and Q22 when watching it on a notebook screen (Q26 was bad), so I decided on Q22.

For sound - I agree with the guide - AC3 is the only way to go. I tried Nero AAC-LC first, and while it provided excellent compression, decoding was using up 20% of XBOX CPU and caused major frame dropping. Where as, I got no dropped frames with 6ch AC3 (75-95% cpu utilization total).


- Jhcheslik - 2009-01-19

Yeah.

I would definitely go for Q22 on the recommended green/yellow square in the chart. It got the right bitrate and everything. I think that's just crazy that there's no difference between Q26 and Q24 for 27 inches CRT!! (Kinda of nice too!)

In my case, high complex scene, Q22 would get up to about 95 percent of CPU usage, where Q21 would cause the XBOX to crap out. (Lot of dropped frames)

Nice info you got there.


- djenyc - 2009-01-20

>> That's just crazy that there's no difference between Q26 and Q24 for 27 inches CRT!! (Kinda of nice too!)

Just goes to show how crappy my tv is Smile

I did some more testing with lower quality levels, with video clips re-sized for PocketPC (320x240) resolution - can also be useful for people with 14" TVs:

File sizes in KB for 100 seconds video clip (mp4, no sound):
q22 2,650
q24 1,991
q26 1,523
q28 1,175
q30 920
q32 733
q34 594
q36 489
q38 409
q40 343

Subjective observations:
q26 - No visible degradation
q30 - Ok, with some compression artifacts
q40 - Fills the screen with funny boxes and rectangles, but can make out the picture after staring at it for a while. With Nero AAC-HE Q.05 soundtrack, now I can fit a five minute music video on a standard 1.44mb floppy Smile

All samples from Q22 to Q40 can be downloaded here:
http://www.sendspace.com/file/h8hqg7