# mediatomb and mkv (h264) transcoding



## wonslung (Jun 29, 2009)

hello, i just installed mediatomb on my box and so far it's working well for a lot of stuff but i'm having trouble getting mkv transcoding working.  All my mkv files are h264 videos and i'd like to be able to play them on the ps3.  I followed some guides i found online but i keep getting "data is corrupted" error on the ps3.  I was able to do transcoding before on linux with a different program but i haven't been able to get it working on freebsd yet.  If anyone knows how to do this please let me know.

edit:

ok, i've got transcoding working with this script:

```
#!/usr/local/bin/bash

FFMPEG_PATH="/usr/local/bin/ffmpeg"
INPUT="$1"
OUTPUT="$2"
VIDEO_CODEC="mpeg2video"
VIDEO_BITRATE="4096k"
VIDEO_FRAMERATE="25"
AUDIO_CODEC="mp2"
AUDIO_BITRATE="192k"
AUDIO_SAMPLERATE="48000"
AUDIO_CHANNELS="2"
FORMAT="dvd"

exec "${FFMPEG_PATH}" -i "${INPUT}" -vcodec ${VIDEO_CODEC} -b ${VIDEO_BITRATE} \
-r ${VIDEO_FRAMERATE} -acodec ${AUDIO_CODEC} -ab ${AUDIO_BITRATE} -ar ${AUDIO_SAMPLERATE} \
-ac ${AUDIO_CHANNELS} -f ${FORMAT} - > "${OUTPUT}" 2>/dev/null
```

but i have anopther problem now, maybe someone else can help:
i can't pause, fast forward or rewind.


----------



## mecano (Oct 12, 2009)

unability to rewind/forward/pause is an known issue when transcoding.
Did you tried to change your config for matroska? Something like that

```
<map from="mkv" to="video/x-mkv"/>
```
note that you may have to try to link to several other mime types depending on your hardware (for example some people having trouble with avi did had success by mapping them to mpeg on some hardware).


----------



## wonslung (Oct 12, 2009)

i ended up building htpc's with mini-itx ion boards.

This ended up working much better....


----------



## mecano (Oct 12, 2009)

interesting, which OS did you use? Why multiple mobos?


----------



## wonslung (Oct 13, 2009)

i used the 9 MB mini.iso for ubuntu.  It's basically the net install disk.

The only reason i went with linux is VDPAU support.  I can get perfect 1080p video with an ion platform, which is GREAT for power consumption and noise.  Those little boards will do 1080p cooled with a REALLY small quiet fan, and some people have even cooled them passively....personally i didn't like it running at 60 degrees but it's supposed to be safe.

I got multiple motherboards because i needed one htpc per tv.  They are tiny motherboards.  the media itself is on a FreeBSD 7.2 box, using ZFS.

3 raidz vdevs of 4 1 tb drives...it's nice


----------

