Fun with media files

It has to be said, mplayer is an amazing piece of software.

It can play ISO files as though they were DVDs. First, mount the image;
$ sudo mount -oloop /path/to/dvd_image.iso /media/dvd
Then to play the first programme from the disc;
$ mplayer -dvd-device /media/dvd dvd://1/

Now, the discs created on my standalone DVD+R/RW recorder are a bit weird, in that the .vob files on the disc don’t correspond with the recorded programmes. So I can’t save an individual programme just by copying its .vob file; meaning, if I wanted to keep a whole series together, I would have to record all the episodes on the same disc.

But mplayer has an option, -dumpstream which simply extracts the MPEG data from the source and saves it to a file. The default filename is stream.dump but you can specify an alternative filename with -dumpfile /path/to/somewhere. And without having to display anything, it isn’t constrained by the frame rate. Don’t be alarmed by the “Core dumped ;) ” message — that’s just hacker humour.

So we can extract the second programme from a disc (or a mounted ISO image), and save it as an MPEG file, with a command like the following;
$ mplayer -dumpstream -dumpfile /path/to/saved_file.mpg -dvd-device /media/dvd dvd://2/
Remember, this is the actual MPEG data from the disc, so it’s already a DVD-like MPEG2 file; and therefore suitable for burning to disc with your favourite DVD authoring application. Or just saving onto one of those USB external hard drives with a built-in media player.

Don’t forget also the excellent ffmpeg, which can convert nearly any media file format to nearly any other media file format.

6 Responses to “Fun with media files”

  1. Clothing says:

    Doesnt seem to be working on my IE7. Just thrashes incessantly, refreshing the address bar non-stop. View source shows about 6 lines of curious JavaScript. I can be from may laptop but the page its ok on Mozila, i cant undestend someting im on alexa now and your rank is verry big, i found you blog on second page of google .Andrei from Italy

  2. AJS says:

    Doesnt seem to be working on my IE7.

    Then use a different browser.

    This site works fine in Firefox and Konqueror, and that’s really all I give a s#!t about. I don’t have a system capable of running Internet Explorer. You, on the other hand, do have a system capable of running Mozilla Firefox.

  3. remonty warszawa says:

    Hello! Sorry that I am asking here – what cms is this? WordPress, Movabletype? Cant discover information anywhere.

  4. AJS says:

    Hello! Sorry that I am asking here what cms is this? WordPress, Movabletype? Cant discover information anywhere.

    Try pressing the ******* “page down” key a few times, you stupid twat. See at the bottom where it says “proudly powered by” ?

    Arsehole.

  5. Coy Mykins says:

    wassup, im seriously feeling your site but i cant click on the other links. You might wanna check your site in IE 8 cuz you know that browser acts up sometimes.:)

  6. AJS says:

    You might wanna check your site in IE 8 cuz you know that browser acts up sometimes.:)

    NMFP, pal.

    As a non-Windows user, I can’t run IE8. You, on the other hand, can run Firefox.