PDA

View Full Version : Quick and dirty method for mkv/x264 on XBMC


jollyrogr
1st March 2007, 20:38
I have a nice x264 encoded video (720p) with AC3 audio track all wrapped up in mkv, and when I went to play it on my xbox with XBMC, it just choked on it.

So, I set out to find a way to convert it to a format usable by XBMC. Here's what I found.

Tools: ffdshow_rev918, haali's media splitter, virtualdubmod, mkvtoolnix, koepi's xvid, avisynth, and avidemux.

Process is pretty straightforward. Create an avs script that looks something like this:

DirectShowSource("filename.mkv", fps=23.976)
LanczosResize(960,540)

Then open the .avs with virtualdubmod. Under video, select fast recompress. Then you can save the video as an avi and select your XVID encoder settings. I just used a quick one-pass and it worked great.

In the resulting avi file the audio turned into PCM, so I extracted the original AC3 track from the .mkv using mkvextract.exe.

I then muxed the AC3 into my xvid encoded avi using avidemux.

Thats it. Plays great on XBMC.

giandrea
2nd March 2007, 03:15
Thats it. Plays great on XBMC.

Even if it is a Variable Frame Rate mkv file?

ilovejedd
2nd March 2007, 04:38
Even if it is a Variable Frame Rate mkv file?

DirectShowSource("filename.mkv",fps=119.880,convertfps=true)
LanczosResize(960,540)
convertfps(23.976) # or changefps(23.976)

Not too sure where I read it but it was recommended to use the least common multiple for DirectShowSource fps and just change the fps afterwards. Although you could probably do this directly:
DirectShowSource("filename.mkv",fps=23.976,convertfps=true)
LanczosResize(960,540)

edogawaconan
4th March 2007, 00:28
well that's just converting it to something that less cpu intensive. :)

Adub
4th March 2007, 00:50
And there is nothing wrong with that. Well, usually anyways, sometimes you don't care about CPU, just quality.

@jollyrogr
You didn't actually find a "workaround", you just ended up re-encoding the file to something that XBMC could handle. Just to be accurate.

jollyrogr
6th March 2007, 17:47
Right. Actually XBMC can handle x264 encoded mkv...but the xbox processor cant. The re-encode to xvid and dropping the resolution to 960x540 reduces the CPU load far enough that it's playable which is what I was after.

I just thought I'd share what I found in case there was anyone else in the same boat, so to speak.

ilovejedd
6th March 2007, 18:11
I think I saw a discussion in another forum before regarding maximum x264 settings that the Xbox can handle. Would anyone happen to have that info?

faquino
6th March 2007, 18:45
@ilovejedd:
You can find about what the xbox can handle at XBMC's online manual:
http://www.xboxmediacenter.com/wiki/index.php?title=XBMC_Features_and_Supported_Formats/Codecs#Supported_video_formats_and_resolutions

Basically, no CABAC and no deblocking, at least not if you want fluid framerates

jhutch
9th March 2007, 23:16
I've found that everything I've encoded in x264 that plays on a video iPod also plays on the XBMC.

For instance, use megui with the iPod settings and you'll work on XMBX no problem.

JHutch

DaMeista
4th May 2009, 20:41
Hi, I've been using this nice method for a while, but now I've been having problems...
Every mkv I try to convert into an avi has incredibly slow sound, no matter where or with what I try to play it. The sound is so slow you can't even make out anything anymore.
I have to say I always followed the complete instructions, except for extracting the audio track. I've always used the file as it came out of Virtualdub.
The only thing that has changed about my system is that I have renamed my Windows profile (and generated a new one). I have reinstalled all the needed apps, but no success.

Can anyone help me out?