The world of Transcoding

Spent some time early this week trying to figure out how to get my NTSC DVD’s ripped and transcoded into a format I could store and play on my PS3. My main goal was to keep the AC3 audio intact and use the best video codec possible and at the same time have it working on the PS3. After some trial and error I learned that MPEG PS was the only way to combine AC3 audio and H264 video into a file and have the PS3 be able to read it.

None of the various Linux rippers seemed to support this combination however and trying to use gst-launch I discovered that the mpeg ps muxer from gst-ffmpeg did not seem to work to well.

As part of this process I got reminded of a couple of things. The first being that we really need an relatively commonly used application using GStreamer to test and make sure our muxers and encoders keep working. Pitivi would fit that role, but its a complex application which I think is still some way away from being a tool for everyone. A simple transcoder application would probably be a better choice to get us started. That said looking at the current rippers out there the either are very targeted at a specific target (like Thoggen) or have a GUI which I think is unnecessarily complex for the average user (dvd::rip). I do not consider myself a multimedia novice, but I still only had a vague idea what the various options exposed in dvd::rip would accomplish. I am not saying dvd::rip sucks though, it was in fact the only application I was able to find for Linux which produced files that my PS3 actually recognized (although I had to use ac3 and mpeg4 part 2 in avi to make it happen.) Tried another application called Handbrake, which was fairly easy to operate although only being command line for linux, but the only files it could make that worked was h264 and aac in mp4 which meant I lost surround sound output due to my PS3 being connected by s/pdif to my amplifier.

Mockup of gstreamer transcoder

So thinking about what kind of GUI I thought a transcoder should/could have I took a screenshot of dvd::rip and started modifying it in the Gimp. The result you see above. The idea would be that you select your input source at the top and then choose your target container format. Based on which container you choose the codecs which are supported by that container get ungreyed, while the remaining ones stay grey (unselectable). One are able to query muxers for the codecs they can mux so with the aid of pbutils one should be able to ungrey the codecs dynamically (which is an advantage as muxers could have new mappings added as time goes on.)

Once we have managed to stabilize/improve the muxers and encoders in GStreamer due to this application being tested and bugreported upon we could move this page into a ‘advanced’ tab. The new default view should then be a list of presets for various devices like N810, PS3, PSP, iPod and so on. These presets could then of course in addition to the codec choices also include resizing based on target device.

While there are use cases where one might still want/need a more advanced GUI which need all the options exposed by something like dvd::rip I think for the vast majority of us this application would do the job.

So if anyone out there would be interested in trying to hack up this application using gst-python for instance that would be really cool :)

18 thoughts on “The world of Transcoding

  1. I totally agree that an application like this would be useful. I’ve been fighting with transcoding my DVD’s for sometime, and have yet to find a truly good solution. Quite often I either get poor video quality, or the audio is out of sync. I think I’m using the same settings from one run to the next, but I can never be sure it will work! I know other people must be producing good quality results with these tools (thoggen and dvd::rip), but I just can’t seem to get it done consistently. Until this application you describe exists, I’m curious what settings you used in dvd::rip to do yours. I assume that using H264 it looked good, but did the audio stay synced up?

  2. Hey, how is it going in Cambridge? :)

    Funny that you blogged about that because I was actually considering writing something like that. When I rip a DVD on linux I always have to use obscure scripts to do so, and it’s the same when I want to convert a movie to my Nokia N95. I think I’ll have a look this week-end.

  3. Looks a lot like Handbrake’s gui. :)

    It currently ties the choice of audio and video codec together. I don’t know if that’s just convenience, or to avoid the kind of support holes you’ve found with various containers. Note that you want presets pretty quick with all those options, especially once you and downsampling for mobile devices.

    I agree this would be great. ffmpeg2theora is nice, but a gui would be a lot more accessible.

  4. You can have a look on OGMRip. The SVN version supports profiles and I’m working on per-codec options. Once this is done, OGMRip should be able to provide profiles for PSP and iPod.

  5. Hi,

    To transcode media in Conduit I currently use ffmpeg and/or mencoder. If you can provide me with a command line app with a sane CLI for transcoding videos then I will switch to it in a second, and probbably buy you a pony

    John

  6. I long for the day the “autorun” like feature offers to backup my DVD I’ve just inserted, or as a right-click option on media files in nautilus. One simple dialog, offering a range of output devices (HD panel, handheld console, mobile phone, web tablet, etc) and an audio selection (stereo, 5.1, 7.1) then a progress dialog (preferably part of mathusalem – whatever did happen to that). Simple, clean and intuitive. I don’t want to know what codec, container, audio configuration, bitrate or scaling is used.

    Ah dreams, if only I had the knowledge to implement :)

  7. Jon that would be great, but not every mobile phone, web tablet, handheld support the same codec. First we need to collect data on what they do support then we can start on something like this.

    We also need to test what is the best codec to use, be it opensource or not.

  8. Hi, perhaps you should take a look at Movic: http://movic.ir/
    It’s still in its beginnings and not based on GStreamer (but ffmpeg). It does a fairly good job for me and the GUI is very intuitive.

  9. Christian- don’t forget about Tivo and Tivo HD, which apparently likes to play transport stream mpeg2. I have a little linksys box with usb and openwrt+optware. With pyTivo I can serve mp3s and photos to the HD Tivo on it, but serving video is too slow because unless I transcode to the native mpeg2 TS format, the tivo won’t like it (from what I understand anyway). I would really love to see someone take the ps2ts code from VLC and add that into a simple transcoder like you’re describing (or make such a muxing option easy to use via gstreamer) so one could select PS or TS for the muxing option. Maybe I’m misinformed and it’s really easier than I think. Anyhow, I look forward to testing your app. Best,

    /djs

  10. For testing purposes, wild scale application test suite for Gstreamer would be very nice. It is rather hard to fit all scenarios in used-every-day-app, but this suite could have references to such apps. For example, video seeking tests could have been taken from Pitivi, DVD ripping and other stuff from Thoggen, etc.

    It would also help app devs to make sure that their stuff won’t broke with next Gstreamer release. I know it would be rather big work in the beginning, but it could definitely help lot of people later.

  11. Useful things you left out is the various bitrates, estimated / target output file size, and quality/speed trade-offs.

    Many devices that you need to transcode for only support a small range of bitrates. Obviously handbrake-like profiles should be bundled that include all known devices.

    If the movie is going to have to fit on your old, spare 256MB SD Card, then target size matters.

    If you are wanting a quick trans-code, while hanging off a wall socket at an airport, waiting for your flight to be called, quality/speed tradeoffs matter.

  12. I’d love this. Love it. FFMpegX for OS X does this, and I’d really like it. I keep sitting down thinking about writing it, and then I remember that I’d have to spend my life thinking about how to build a gst pipeline with audioconverts and that sort of thing in and I give up. It’d be great if someone did this, though.

  13. This would be a great project without a GUI to use with the on-the-fly transcoding option in MediaTomb. Using GStreamer and Python to automatically transcode any source into high quality output for the PS3 (or other target) and optionally use a GUI to create permanent copies as you’ve described.

Comments are closed.