Mediatomb is a great UPnP server that generally works with the PS3. Regular AVIs seem to work but MKV support out of the box is not very good.
Here’s how I got MKVs transcoding in real time to the PS3 (with 5.1 passthrough!) on Ubuntu 8.10 Intrepid Ibex.
- Install Mediatomb
- Install ffmpeg
- Make sure you are using the *-unstripped libs as dependencies for ffmpeg (See here for details)
- Follow the instructions here and here to setup basic support for the PS3.
Edit /usr/bin/mediatomb-transcode-video with your favorite text editor. This is the script that I am using:
#!/bin/bash
FFMPEG_PATH="/usr/bin/ffmpeg" INPUT="$1" OUTPUT="$2" VIDEO_CODEC="mpeg2video" VIDEO_BITRATE="4096k" VIDEO_FRAMERATE="25" AUDIO_CODEC="copy" FORMAT="mpegts"
exec "${FFMPEG_PATH}" -i "${INPUT}" -vcodec ${VIDEO_CODEC} -b ${VIDEO_BITRATE} \
-r ${VIDEO_FRAMERATE} -acodec ${AUDIO_CODEC} -f ${FORMAT} - > "${OUTPUT}"
Notes:
- The audio codec is set to “copy”. This simply forwards whatever audio stream is present. This successfully forward Dolby Digital 5.1 to the PS3, through the TV and out to the speakers!
- The format can one of several things. It was originally set to “dvd” but that caused buffer underflow errors to spew forth during transcoding. “mpegts” seems to maintain compatibility but without the errors.
- I’m not sure if the framerate is truly neccessary.
- I tried using 8192k as the bitrate but it didn’t seem to make a big difference.
12 Responses to “Streaming mkv in Mediatomb to PS3”
Leave a Reply
Search
Recent Entries
Listening to...

Your settings are what finally got my mkvs to work properly. Thanks
Thanks very much for this. This got me up and working.
One point however, you talk about making sure you use the unstripped dependencies for ffmpeg, the following address points out how to install those (working in Intrepid)
http://ubuntuforums.org/showthread.php?t=986534
Cheers
/Matt
Glad to be of help.
I’ve found PS3MediaServer (http://code.google.com/p/ps3mediaserver/) to be quite good too as a quick solution. No setup needed provided you have the required libraries it needs.
hi there, i was just wondering if you still want to use the url soowei.blogspot.com ? if you do not want to use it, can i have it instead? please do let me know ya… thank you so much!
Thank you,
Worked for me.
Additionally, I have worked out a way to get mediatomb to server movie posters to the PS3.
http://www.dedmeet.com/software-projects-mainmenu-12/mediatomb-movie-posters.html
Hi,
just found your article. Streaming mostly works…but I can’t scan or pause the playback.
Andy idea?
and second: it seems to crash on large mkv-files.
Like an 8GB 1080p File.
sorry, hit the button too early. This is the error in the logfile:
Duration: 00:01:18.66, start: 0.000000, bitrate: N/A
Stream #0.0(eng): Video: h264, yuv420p, 1280×720, PAR 1:1 DAR 16:9, 23.98 tbr, 1k tbn, 47.95 tbc
Stream #0.1: Audio: dca, 48000 Hz, 5.1, s16
Output #0, mpegts, to ‘pipe:’:
Stream #0.0(eng): Video: mpeg2video, yuv420p, 1280×720 [PAR 1:1 DAR 16:9], q=2-31, 4096 kb/s, 90k tbn, 25 tbc
Stream #0.1: Audio: 0×0000, 48000 Hz, 5.1, s16
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[NULL @ 0x8b9e780]error, non monotone timestamps 4320 >= 4320
av_interleaved_write_frame(): Error while opening file
Scannig and pausing won’t work, as ffmpeg is transcoding on the fly in the background. There is no way for it to scan back and forth for you.
I haven’t seen any issues with running large files, although I have not tried a 8GB file. I find ffmpeg is a bit flaky with newer MKVs, I have a whole bunch that don’t work and just spit out that error you mentioned.
Ok, so we have to wait to get a fix in ffmpeg for this error?
And the reason why pause/scan won’t work hit me yesterday after posting
I gave up and used Handbrake to convert them to .mpg.
Transcoding on the fly? Ouch. My little file server weaps.