stream .iso files from mediatomb to ps3

  • Torbjørn Sandvik

    I have som copys of my own dvd's on my server thats run mediatomb.
    But what do i have to do to get it working ?

    I have read here on the internett but cant find, how to do it.
    There are some people that says they've done it, but they dont say how.

    So can someone please help me ?

    • Jin

      Jin - 2008-09-01

      This feature is being worked on and is most likely to appear in 0.12, so right now I would simply wait :)

      It's also not yet usable in SVN, but I will post something when I feel that it's good enough for testing.

      Kind regards,

      • Stephen

        Stephen - 2008-09-02

        Alternative to a built-in solution, I setup transcoding using VLC...

        The MIME type (at least on my machine) was completely useless, so I added the following line to the mappings/extension-mimetype section of the config file:
           <map from="iso" to="video/dvd-iso"/>

        Then added a transcoding rule to the transcoding/mimetype-profile-mappings section:
           <transcode mimetype="video/dvd-iso" using="vlcimage"/>

        And finally, the actual transcoding profile:
           <profile name="vlcimage" enabled="yes" type="external">
             <agent command="vlc" arguments="-I dummy dvdsimple://%in :sout=#transcode{venc=ffmpeg,vcodec=mp2v,vb=4096,fps=25,aenc=ffmpeg,acodec=mpga,ab=192,samplerate=44100,channels=2}:standard{access=file,mux=ps,dst=%out} vlc:quit"/>
             <buffer size="14400000" chunk-size="512000" fill-size="120000"/>

        The actual output options (the #transcode{} part) can be changed to fit your network configuration (I happened to be experimenting with wireless, so these settings are not all that great).  I think on a wired network it's possible to not transcode the DVD at all and just have VLC stream the original bits.

        If someone would like to add this to the wiki, feel free, unfortunately I don't have a lot of time to do so (or would have already).


    • Jeremiah Gilbert

      I modified your vlc iso streaming idea a bit:

      <profile name="vlcimage" enabled="yes" type="external">
              <agent command="vlc" arguments="-I dummy dvdsimple://%in :sout=#duplicate{dst=std{access=file,mux=ps,dst=%out}}} vlc:quit"/>
              <buffer size="14400000" chunk-size="512000" fill-size="120000"/>

      This way it doesn't actually transcode the data, it just sends it straight out to the fifo, which plays fine on the PS3  (or at least, so far in my testing).

    • Dieter_be

      Dieter_be - 2008-09-07

      Interesting guys!
      jagilbertvt, I tried your transcode profile (along with the extension-mimetype mapping and transcode mimetype from scbash), but my PS3 keeps telling my iso's are "damaged" (even after removing all my files from the library and adding them back).

      I also tried putting it in an external script like this (and re-importing my stuff):

             <profile name="vlcimage" enabled="yes" type="external">
                      <agent command="mediatomb-transcode-iso" arguments="%in %out"/>
                      <buffer size="14400000" chunk-size="512000" fill-size="120000"/>

      vlc -I dummy dvdsimple://"${INPUT}" --sout '#duplicate{dst=std{access=file,mux=ps,dst='$OUTPUT'}}}' vlc:quit >/dev/null 2> /var/log/mediatomb.log

      The only stuff I'm getting in my logfile is this:2008-09-07 16:08:31    INFO: Arguments: -i %in -o %out -s 128
      2008-09-07 16:08:31    INFO: Arguments: -i %in -o %out -s 128
      2008-09-07 16:08:32    INFO: Arguments: %in %out
      2008-09-07 16:08:34    INFO: Arguments: %in %out
      2008-09-07 16:08:34   ERROR: process terminated early
      2008-09-07 16:08:35    INFO: Arguments: -i %in -o %out -s 128

      My ps3 tells me 'the directory is deleted on the server' o_O

      any ideas?

    • Dieter_be

      Dieter_be - 2008-09-07

      Aha,catching vlc's output is useful.  I'll investigate further in this
      VLC media player 0.8.6i Janus
      [00000208] dummy interface: using the dummy interface module...
      [00000212] main private error: no sout stream module matched "duplicate"
      [00000211] main stream output error: stream chain failed for `duplicate{dst=std{access=file,mux=ps,dst=/tmp//mt_transcode_RJH9GU}}}'
      [00000209] main input error: cannot start stream output instance, aborting
      [00000217] dummy demuxer: command `quit'
      [00000205] main playlist: stopping playback
      [00000001] main private error: could not create /dev/null/.vlc (Not a directory)
      [00000001] main private error: could not create /dev/null/.vlc/cache (Not a directory)

      PS: I don't get the 'directory is deleted' anymore, it's also 'damaged data' now

      • Stephen

        Stephen - 2008-09-07

        Playing around on the command line a bit I found the following worked for me:

           vlc -I dummy dvdsimple://%in

        (lines split for readability)  I haven't experimented with this in mediatomb though since my network doesn't support full bitrate streaming.


    • Dieter_be

      Dieter_be - 2008-09-07

      Okay, I got it working.  My vlc was compiled without support for dvd. (I'm using Gentoo)
      These are my useflags (could be useful for someone):  dvd flac matroska mp3 mpeg musepack ncurses ogg png stream theora vorbis win32codecs x264 xml

      I just used the same script I pasted earlier (which basically does the same as jagilbertvt's command anyway)
      Too bad things like seeking, menu support etc don't work. (will 0.12 be able to do that? that would be neat :-)

    • Jeremiah Gilbert

      Yeah, lack of seeking is unfortunate. I don't believe you'd actually be able to use the dvd's built-in menus over uPnP, but

      I've been looking at the svn code. There is some dvd support in there, but it's incomplete at the moment (unuseable in it's current state).

      I've been fooling around w/ trying to enable the telnet interface w/ vlc, but it seems that when you seek in vlc while it's transcoding, the a/v desyncs and seems to corrupt the video stream, so I dont think that's too viable for being able to fastforward/rewind.

      It also seems that (at least for some of the dvd iso's I've tried) that vlc will start playing correctly, but ends up jum

      • Dieter_be

        Dieter_be - 2008-09-08

        @ "I've been looking at the svn code. There is some dvd support in there, but it's incomplete at the moment (unuseable in it's current state)"

        Look at post 2 of this thread ;) Jin is working on support for 0.12

        I've asked him about it on irc and this is what he said:
        17:15:41 < Jin^eLD> Dieterbe: menu? no, how would you do that? menu is interactive, thats not possible via upnp
        17:15:56 < Jin^eLD> Dieterbe: it will only allow to select tracks/chapters/audio tracks
        17:16:04 < Jin^eLD> Dieterbe: seeking - hopefully

    • Jeremiah Gilbert

      Sorry, posting from my laptop and accidently clicked post while typing, heh.


      It also seems that (at least for some of the dvd iso's I've tried) that vlc will start playing correctly, but ends up jumping to the wrong vob. Not quite sure why.

    • Jeremiah Gilbert

      Sorry for my incomplete post earlier. Anyways, I realize that dvd support is being worked on (though, I dont think there have been any recent changes committed to the svn).

      Dunno if anyone has tried using vlc dvdsimple to playback a dvd iso completely in mediatomb. I'm not sure why it's selecting the wrong vob's during playback for me (I know I've never had a problem playing dvd iso's in vlc before).

      Just more food for thought. I would like to be able to use the seek functionality in vlc, but it seems to totally mess up the stream (either when transcoding an avi or when just duplicating a dvd to the fifo). I might do some more playing around w/ that.

    • Jin

      Jin - 2008-09-10

      I commited the first (hopefully working) code yesterday.

      What you need is:
      compile MediaTomb with libdvdread support (I use libdvdread-0.9.7 which is the latest official release, not the forked one), use the --enable-libdvdread parameter for configure.

      disable storage caching i.e.: <storage caching="no"> (just add the caching attribute to the existing storage tag).

      Add a mimetype to content type mapping for the DVD: <treat mimetype="application/x-iso9660" as="dvd"/>

      Make sure you are using builtin virtual layout: <virtual-layout type="builtin"> (I did not have the time to add this functionality to the import script feature yet)

      Then, start MediaTomb and simply try to add some DVD iso image; look in the Video/DVD container - the image should get expanded there.

      The feature is still in the dev phase, so it's possible that you will hit some bugs.

      Let me know how it worked out :>

    • Jeremiah Gilbert

      I'm using the forked version of libdvdread (4.1.2) included with Fedora 9. I had to comment out the DVDInit/DVDFinish calls as these don't exist in the forked version (and there are no equivelant calls).

      Also, I had to use:

      <treat mimetype="application/x-iso9660-image" as="dvd"/>

      as that's the default mimetype on fedora 9 (though, I could've added a new extension to mimetype mapping, as well.)

      But, yeah it seems to be working (once I switched to the builtin virtual layout :)).

      I haven't actually tried playing anything, yet. Hopefully I'll get a chance to try that tonight (I'm just looking at the web interface and browsing the uPnP side w/ Cidero)

      I might take a look at adding the import.js functionality.

    • Andras Kok

      Andras Kok - 2008-09-10


      I'm still using the 0.11.05 version of Mediatomb having the "external" way configured with pure bit-streaming idea of jagilbertvt.
      (have and ASUS wl500g router with Openwrt).

      Video streams fine but have no sound on PS3. Have anybody experienced this before?
      Also if I just take the VIDEO_TS directory of an extracted DVD ISO some of the VOBs have sound some not (same DVD image). Might not relate to this but FYI.

      Any idea?

    • Pascal Pochol

      Pascal Pochol - 2008-09-10


      A couple of questions about DVD streaming:

      - What's the best way to make an iso of the DVD? What tool?
      - Does it need to be  decrypted (no css)?
      - Is it less taxing on the server if it is decrypted already?
      - What will be available from the PS3? fast forward/rewind? Next/Previous chapter?
      - Title selection (for when choosing widescreen/fullframe?
      - What about DVDs with episodes?
      - What about subtitles? Can they be turned on? changed while streaming?

      Just curious at this point. I'm in the process of converting my cartoon DVDs for my kid to mp4 using handbrake. I guess it would be easier to just use an iso. I would need a much bigger HD though.



    • Jeremiah Gilbert

      You may want to check the ISO and see what Audio codecs are used. I believe it'll need an AC3 stream to work (I dont recall if it'll support DTS, but I think the answer is no). 

      If it only has a DTS stream, you may want to try using:


      this should leave the video intact while transcoding the audio to a supported format. You can also try acodec=a52 (which is ac3).


    • Jin

      Jin - 2008-09-10

      > - What's the best way to make an iso of the DVD? What tool? 

      No clue, I do not have any DVD's, well, actually I got one and I used dd if=/dev/cdrom of=dvd.iso to dump it, I guess it was not an encrypted one. Anyway, I think you will find the answer to that question elsewhere, there are lots of dedicated sites to that matter.

      > - Does it need to be decrypted (no css)? 

      I am not sure, but I do not think so, as far as I understand libdvdread should be able to decrypt it on the fly using other css libraries.

      > - Is it less taxing on the server if it is decrypted already?

      Probably? I guess you are asking the wrong person, my DVD knoweldge is almost zero :) I just managed to add this feature somehow, hehe

      > - What will be available from the PS3? fast forward/rewind? Next/Previous chapter?

      On the PS3 - probably nothing :) Our first tests indicate that the resulting MPEG PES is not accepted by the PS3 (don't ask me why, it's always the same with this damn thing).

      On other players you will be able to start playback from a particular chapter of a particular title and you will be able to select playback by audio track or language. I hope that I will be able to add seeking support as well, currently it is not yet available.

      > - Title selection (for when choosing widescreen/fullframe? 

      What's that? Well, I just parse the DVD by titles and chapters and offer them for playback. Whatever data is in the particular title - I will serve it out to the player. The modification to the MPEG PES is only done in regard to audio (we blend away all audio tracks except for the one that the user has selected).

      > - What about DVDs with episodes?

      What episodes? To my knowledge you only have titles and one or more chapters inside a title; that's what I parse.

      > - What about subtitles? Can they be turned on? changed while streaming?

      Only if your player understands subtitles that are embedded in the MPEG PES, we do not touch them. We also do not do any video processing on the MPEG so we can not blend them in (usually this is done by the DVD player). You could probably use transcoding for that (i.e. telling the transcoder to copy the video stream but blend in the subs, like with the soverlay option in vlc).

      So, we will not be able to reach the quality of a DVD player due to  technical limitations, but it's surely better than nothing and so far probably the most advanced implementation that allows to stream DVDs via UPnP (at least I am not aware of any others ;)

      Kind regards,

    • Jeremiah Gilbert

      Just wanted to let other PS3 users know that I quickly tested this with my PS3 and it gives me a network error. I haven't had a chance to try diagnosing it, though.

    • Jin

      Jin - 2008-09-11

      Tests from PS3 users indicate, that the PS3 refuses to play the MPEG PES stream which we are serving from the DVD. It works fine on my DSM-510 with AC3 tracks, streams with DTS audio crash the player; but the playback by chapter/audio track is working fine. I think someone also tried copying that MPEG PES to the PS3 and playing it from the harddisk, but it also does not work, so I fear PS3 folks will not be able to use this feature.

      Regarding network error, I commited some additional things yesterday, there was indeed a bug where serving the content did not work, but thats fixed now. Unfortunately it does not change the fact that the PS3 can not handle the served MPEG PES...

    • Jeremiah Gilbert

      Interestingly, I was able to get one chapter to play (repeatedly), however it was playing without sound (ac3 audio track). Nor did any of the other chapters work (the typical corrupt data message). I think the network error I was having was caused by the iso it was trying to load (it causes mediatomb to crash). I think the iso is a bit messed up, because I can't get vlc in linux to play it correctly (though it works fine in windows).

    • BT

      BT - 2008-09-12

      I noticed that when copying the MPEG PES file to the PS3's hard disk, the length and the audio codec could not be identified via the Information dialog. After re-muxing the stream to MPEG PS with ffmpeg -i /path/to/input.mpeg -acodec copy -vcodec copy -f dvd /path/to/output.mpeg , the PS3 was able to identify the length and audio codec. I believe the issue is that the PS3 just doesn't support MPEG PES streams, only MPEG PS and TS.

    • Jin

      Jin - 2008-09-12

      Hmm.. too bad.

      I will see that I add the possibility to use transcoding in combination with the DVD feature, of course then you will lose pause/seek (in case I manage to add it to the regular feature), but it's probably still better than nothing.

      Anoter possibility: if someone is good with formats/codecs and could contribute code for converting the MPEG stream on the fly, then we could also try it.

    • Jeremiah Gilbert

      I'm hoping to take a look at that, actually. Though, I don't have a ton of free time, so it may be awhile. However, I would think that libavformat/libavcodec (from ffmpeg) would probably work for this.

      It'll definitely take some research to see if that is indeed the case. In fact, it might be worth looking at those for transcoding in general, as it apparently supports seeking. Unfortunately, I'm not sure how much documentation there is for these libraries.


    • Jin

      Jin - 2008-09-12


      let's put it that way: my original plan was to do the audio stream selection via ffmpeg. I failed miserably :)

      I looked at ffmpeg code and it seemed like it is extremely complicated to do even just a simple stream copy.

      After talking to various people we came to the conclusion that it is easier to implement audio track selection ourselves, actually, I also failed at that :) This codec stuff is really not my thing, heh, however we received a code contribution for the PES IO Handler read() function which does what we want.

      The idea is actually simple, we take the MPEG PES which we get from libdvdread, we look for audio tracks in the stream that we want to blend out, and we replace those audio data with padding bytes.

      This way the size of the MPEG does not change (which makes things a lot easier for adding seeking support), however the unneeded audio tracks are removed, this seems to work quite, I tested it on my DSM-510 and it has also been tested on the Popcorn Hour device.

      So that's what is happening now.

      It may be worth to have a look at gstreamer which seems to have a much nicer API and a good documentation; if you know the ffmpeg API well - I don't mind using ffmpeg for this, but as I said - I could not figure it out.

      Kind regards,


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks