Convert DVD for PS3 with 5.1 under Ubuntu

There are many, many questions on how to convert video to be suitable for streaming to the PS3 – and as many solutions. Some of the issues I ran into are due to the configuration of my home theater, and others were because I was trying to accomplish this under Linux.

My setup for playback is a PS3 connected wirelessly (but wired will work fine) to my home network. The PS3 outputs the video over HDMI, and the sound over TOSLink. I run XBMC on my Ubuntu desktop to serve up the video content stored there.

The first, and most obvious path to success is to use HandBrake – it is available across platforms and is simple to use. More recent versions have dumped the specific PS3 encoding options, but the iPod/iPad encoding settings seem to create videos that work just fine in my experience. Where Handbrake fell down for me was that the default encoding settings change the audio into stereo. I’ve got a 5.1 setup and wanted to keep the surround from the DVD.

HandBrake will let you create an AAC 6 channel encoding if you poke around a little in the configuration. Sadly for me, the TOSLink connection does not have enough bandwidth to handle 6 channel PCM, so the PS3 re-encodes the 6 channel mix into a 2 channel mix. This was a bit of a downer after a 2hr encode. If you have your audio going over HDMI, or don’t care about 5.1 then HandBrake may be the perfect solution.

It is also worth mentioning that ps3mediaserver can handily deal with .iso files (and lots more) and re-encode on the fly. I specifically didn’t want to go this route, for no reason other than I didn’t want to be bothered to set it up as I already had XMBC handy. I’ll assume there are others out there as stubborn as I am and they may find this useful.

My path to success turned out to be using k9copy to create an .avi file from the DVD that contained only the movie and the AC3 5.1 sound track. Then I used ffmpeg to convert that .avi file into a VOB format file that the PS3 would accept for streaming.

ffmpeg -i video.avi -acodec copy -vcodec copy -r 23.976 -f vob video.mpg

Once done (and it was fast as there is no actual re-encoding happening in the ffmpeg step) the resulting file streamed just fine from XMBC to my PS3 over wireless. As with most solutions, I spent plenty of time banging my head on more complicated paths until arriving at this very simple solution. I do have to give credit to a blog post that helped me reach the ah-hah moment. What I really like about this solution is the video and audio are exactly what appears on the DVD, only the wrapper they are stored in has changed: k9copy extracted the bits from the DVD that I wanted to have, and ffmpeg fiddled the container around to make the PS3 happy.

I’m still a huge fan of HandBrake and will continue to use this for converting video for portability (Android phone, iPhone, etc). However, k9copy has earned a place in my video conversion toolbox.

3 thoughts on “Convert DVD for PS3 with 5.1 under Ubuntu”

  1. Recently I downloaded the Timescape trailers [highly recommended].

    Trailer 2 – Timescapes 4k is in a PS3 friendly format already, I do recommend copying it onto the PS3 hard drive for smooth playback (reading from a CD wasn’t).

    Trailer 1 – Rapture is in .mov format. It turned out to be very easy to fiddle the container into a PS3 friendly one resulting in a lossless conversion.

    $ ffmpeg -i -acodec copy -vcodec copy -f mp4 Rapture.mp4

    As we’re not converting anything other than the container, it only takes a minute or so to complete.

  2. Consider using a static build if you have trouble:
    (I was getting “pts < dts in stream 0") Then this handy script allowed me to convert a whole bunch of .mkv files into .mp4 that the PS3 would be happy with for f in *.mkv do g="${f%.*}" ~/Downloads/ffmpeg -i "$f" -vcodec copy -acodec copy "$g.mp4" done

  3. The PS3 documented media types

    Memory Stick Video Format
    – MPEG-4 SP (AAC LC)
    – H.264/MPEG-4 AVC High Profile (AAC LC)
    – MPEG-2 TS(H.264/MPEG-4 AVC, AAC LC)
    MP4 file format
    – H.264/MPEG-4 AVC High Profile (AAC LC)
    MPEG-1 (MPEG Audio Layer 2)
    MPEG-2 PS (MPEG2 Audio Layer 2, AAC LC, AC3(Dolby Digital), LPCM)
    MPEG-2 TS(MPEG2 Audio Layer 2, AC3(Dolby Digital), AAC LC)
    MPEG-2 TS(H.264/MPEG-4 AVC, AAC LC)
    – Motion JPEG (Linear PCM)
    – Motion JPEG (μ-Law)
    AVCHD (.m2ts / .mts)
    – VC-1(WMA Standard V2)

Leave a Reply

Your email address will not be published. Required fields are marked *