Jan 23, 2009

HOWTO: H.264 YouTube videos in mediatomb (no more transcoding for PS3!)

As you probably know (and as explained on Wikipedia), YouTube supports several video formats. Until then, mediatomb could only stream standard videos based on the H.263 video codec, which required on-the-fly transcoding to be properly played on the Playstation 3. I showed you how to do this in this previous super-popular article ;)

But hey, things have changed and as of revision 1998, mediatomb now supports the H.264 format, which is natively played by the PS3. This means that we no longer need to transcode YouTube videos :)

First of all, you need to check what revision you have:

ubuntu% cd src/mediatomb
ubuntu% svn info
Path: .
URL: https://svn.mediatomb.cc/svnroot/mediatomb/trunk/mediatomb
Repository Root: https://svn.mediatomb.cc/svnroot/mediatomb
Repository UUID: f010a08f-7000-0410-b1fc-cb24403df210
Revision: 2018
Node Kind: directory
Schedule: normal
Last Changed Author: jin_eld
Last Changed Rev: 2018
Last Changed Date: 2009-01-22 19:42:33 +0100 (Thu, 22 Jan 2009)

I'm all set, but if you have a revision older than 1998, you need to update your sources ('svn update') and rebuild mediatomb.

Then, all it takes is changing the YouTube configuration in ~/.mediatomb/config.xml, from:

<YouTube enabled="yes" refresh="28800" update-at-start="yes" purge-after="604800" racy-content="exclude">


<YouTube enabled="yes" format="mp4" hd="no" refresh="28800" update-at-start="yes" purge-after="604800" racy-content="exclude">

Although the videos will now be based on the H.264 codec, they will still have the .flv extension, so you also need to remove any transcoding profile for flv files, i.e. something similar to:

<transcode mimetype="video/x-flv" using="video-generic"/>

Now, restart mediatomb and browse your playlists. As you can see, the videos now appear as AVC (which is another name for H.264):

This is confirmed by displaying the file properties during streaming: 128 Kbit/s stereo AAC audio and H.264 video :)



  1. Hahaha, nice playlist ;)

    Kreator tomorrow!!!

  2. Hum, btw, I was thinking on your settings. Why using mediatomb while watching at YouTube vidz? You can access youtube on the PS3, it s working fine.
    Or is there a mean to push youtube vidz from your laptop to the PS3 (through mediatomb, or other UPnP stuffs like Tversity?)


  3. These mediatomb HOWTO's have been a real help for me, thanks.

    I'm running gentoo and cannot for the life of me get ffmpeg to transcode successfully, i've ended up using mencoder which works fine but seems a little pickier with some input filetypes.

    Have you had any problems with apple trailers getting played successfully? they play for a while with mencoder before getting a load of errors and bombing out.

  4. Hi, nice article. I was just wondering, why you set hd=no in your config. i have it set to yes, and it works fine, if you disregard the fact, that today youtube seems to have problems pushing the data fast enough towards me. i will try this setting for a few days, if it has not gotten better by then, i'll try with hd=no.
    Best regards, keep them good articles coming.

  5. Finally I can now see some Youtube stuff!!

    Why does a lot of it show as "un-supported data"??? My guess is that 50% of the clips show up as un-supported.

    i am pretty new to using mediatomb and streaming although reasonably at home with Linux. I am having God's own trouble trying to get the transcoding to work!!