PlayStation 3 with MediaTomb on Linux and OpenBSD
I have posted a few journal entries on this subject, but this page is here to be sort of a more general overview. There is some detailed information in these posts if you are interested.
Nat Type 3
I run an OpenBSD router, and some port forwarding needs to be done to make sure that the PlayStation 3 can properly communicate with the internet. I have verified the following works for WarHawk, including voice chat, as well as the PlayStation Store, and the voice chat built into the XMB.
Allow Outbound (only necessary in some cases with extremely restrictive firewall rulesets)
TCP: 80, 443, 5223 and UDP: 3478, 3479.
Port Forward inbound
TCP: 9293 and UDP: 3658
TCP/9293 is the port for Remote Play, and 3658 is for other users to connect to you. If you do not forward 3658 you will get the dreaded NAT Type 3.
Media sharing with MediaTomb
Since MediaTomb is the only Linux UPnP media server that I have found that can do transcoding I have been using it for some time now. It is highly configurable and fairly stable. I tend to track the SVN version fairly closely, but now that 0.11.0 is out the transcoding features are available to anyone. Most of the new transcoding features are really well documented on the MediaTomb site, so I won’t reproduce my entire config here, but my transcoding stuff looks like:
<transcoding enabled="yes">
<mimetype-profile-mappings>
<transcode mimetype="video/quicktime" using="vlc-sh"/>
<transcode mimetype="video/x-matroska" using="vlc-sh"/>
<transcode mimetype="video/mp2p" using="ffmpeg-sh"/>
<transcode mimetype="video/ogg" using="ffmpeg-sh"/>
<transcode mimetype="video/mp4" using="ffmpeg-sh"/>
<transcode mimetype="video/avi" using="ffmpeg-avi"/>
</mimetype-profile-mappings>
<profiles>
<profile name="ffmpeg-sh" enabled="yes" type="external">
<mimetype>video/mpeg</mimetype>
<accept-url>no</accept>
<first-resource>yes</first>
<agent command="/staff/mernisse/bin/ffmpeg-tr" arguments="%in %out"/>
<buffer size="6144000" chunk-size="131072" fill-size="2048000"/>
</agent></profile>
<profile name="ffmpeg-avi" enabled="yes" type="external">
<mimetype>video/mpeg</mimetype>
<accept -url>no</accept>
<first-resource>yes</first>
<agent command="/staff/mernisse/bin/ffmpeg-tr" arguments="%in %out"/>
<buffer size="6144000" chunk-size="131072" fill-size="2048000"/>
<avi-fourcc-list mode="ignore">
<fourcc>XVID</fourcc>
<fourcc>DIVX</fourcc>
<fourcc>DX50</fourcc>
<fourcc>WVC1</fourcc>
</avi>
</agent></profile>
<profile name="vlc-sh" enabled="yes" type="external">
<mimetype>video/mpeg</mimetype>
<accept-url>yes</accept>
<first-resource>yes</first>
<agent command="/staff/mernisse/bin/vlc-tr" arguments="%in %out"/>
<buffer size="6144000" chunk-size="131072" fill-size="2048000"/>
</profile>
</profiles>
</transcoding>
Some notes about that config:
- I transcode MP4 – You may not have to if your MP4 files are all playable on the PS3, I would try it out without first and then transcode if necessary. I have more files that don’t work than files that do.
- Audio transcoding doesn’t work right now on the PS3 – A number of weird things that the PS3 does is keeping this from working, hopefully the MediaTomb guys will nail it and make it work, it sounds like the on the horizon ‘built in transcoding’ might fix this issue, but that is still a bit off.
Tags: games, PlayStation 3, technology
What does your ffmpeg-tr script look like?
It looks like:
exec /usr/bin/ffmpeg -i “$1″ -f mpegts -sameq -ac 2 -ar 44100 -threads 2 – > “$2″
Hiya
Could you post the other scripts you call for transcoding as well? having trouble getting it going on mkvs
thanks
Hi Sorry if this has been posted twice, but it doesnt seem to be accepted the first time (unless its moderated)
Can you post the vlc-sh, im having trouble transcoding mkvs.
Thanks
mgk
Do you have the newer Dattebayo fansubs transcoding to your PS3 via mediatomb? I can’t get any of the ones that they’ve encoded with h264 to play on my PS3. I’m trying to use ffmpeg to transcode the video on the fly based on what I’ve read in the mediatomb docs and other sources on the web (including your blog). I see the videos on on my PS3 via mediatomb but when I click on one of the go h264 ones it tells me that it’s unsupprted data.
Any ideas where to start?
Thanks!
-FlypSyde
I am transcoding the Dattebayo releases. The same script that I use (ffmpeg-tr) to transcode everything else works fine for me. You may want to ensure ffmpeg is making a good output stream, you can try the tips in http://mediatomb.cc/pages/transcoding#id2487774 (eg: make a fifo, and run your transcoder manually, then run vlc or mplayer w/ the fifo as a source and see if what comes out is playable).
Also make sure that your profile is in fact transcoding them to mpeg2ts and not just passing the h264 through.
( pressing Triangle on the file and select information should show MPEG2 as the codec )
Thanks mernisse! I got the transcoding to work, but there’s still something wrong in my config.xml. I basically used your ffmpeg-tr script and the transcoding profile settings for ffmpeg-avi from your config.xml, but the only way this works for me is if I comment out the entry which it says to uncomment for PS3 support. At this point all my AVI’s show up as mimetype=x-msvideo in the mediatomb web interface and all the divx encoded files show up as unsupported on my PS3. The h264 encoded files show up as MPEG2 on my PS3 and play fine. This is the exact opposite now of my original configuration :-)
The transcoding works now so I’m confident that ffmpeg and the transcoding entries are fine. My problem has to be somewhere else in the config.xml, probably in the mappings or mime-types. Could you post your entire config.xml somewhere so I could take a look at it?
Thanks again for your help!
-FlypSyde
Sorry, WordPress left out part of my post.
I commented out the “map from=avi to=video/divx” entry to make the transcoding work.
Thanks again!
-FlypSyde
Fixed it.
What worked for was to make sure that all my references to AVI videos in my config.xml were for the divx mimetype.
Ex.
Thanks for your help though!
You probably had the mimetype set for your avi files to video/divx during your initial scan, so all your movies in the database were mimetype video/divx.
For what it’s worth, I use video/avi as my mimetype, the PS3 doesn’t care which you use, but it all must line up for it to work in Mediatomb.
Could you please post your vlc-tr script?
It is a copy and paste from the vlc configuration found here:
http://mediatomb.cc/pages/transcoding#id2487323
There are a few errors in your above xml. When I run the latest mediatomb I get errors due to the following,
video/mpeg
no
yes
The accept-url needs a space on it or the tag is malformed. The /agent is not required since you close the agent tag on the same line it is opened. There may be more than this, but I just needed the ffmpeg-sh section to get my transcoding going.
Dunno if this helps anyone but here’s my transcoding section
audio/L16
no
yes
no
video/mpeg
yes
yes
yes
Ahhh. Maybe not.