An MPEG Streamclip bonus

Interesting: MPEG Streamclip lets you get video and sound out of MPEG-1 and MPEG-2 files when exporting to a QuickTime movie. Let me explain why this is a fairly big deal.

MPEG media (and we’re talking -1 and -2 here, not -4, which is a totally different creature) has always been kind of problematic for QuickTime. Most MPEG-1 and MPEG-2 files are muxed, meaning that audio and video samples are in the same stream. No big deal, conceptually… most movie files are distributed that way to make them practical to read off the disk and decode at playback time. The problem is that when you open an MPEG file in QuickTime, it doesn’t demux the video and audio into separate streams; it treats the whole thing as this (arguably half-assed) media type called “MPEG media” (as opposed to “audio media” and “video media”). And it can play that media, but it can’t do much else with it. MPEG media is such a weird special case, that when you use the QuickTime API in an application, instead of looking in your imported movies for audio or video tracks (or more accurately, tracks whose media is of type SoundMediaType or VideoMediaType), you often have to look for media with the VisualMediaCharacteristic or AudioMediaCharacteristic, as MPEG media will match both (more details in a very old technote: TN1087, and in a Google Books page from my QTJ book).

This becomes obvious when you try to export your MPEG-1 or MPEG-2 file to another format, and QuickTime disables the sound portion of the export dialog:

QT pro export dialog for MPEG-1 file

This ends up being really frustrating, because this is the default behavior that you get from MovieExportDoUserDialog.

Somehow, it didn’t really register at first what was so weird about MPEG Streamclip’s export to QuickTime dialog, until I realized that this app is providing its own export dialog:

MPEG Streamclip export dialog for MPEG-1

Aside from some interesting options for deinterlacing, the significant thing here is that you get both video and audio, though not with the complete set of QuickTime audio codecs. Presumably, instead of handing off to QuickTime’s MovieExportToFile function, MPEG Streamclip is reading each source sample, optionally doing some graphics work (zoom, crop, rotate, de-interlace), and then encoding each sample into a new .mov container…

…which is fricking awesome, because now you can get MPEG-1’s onto your iPod with a little work, though at this point I find I’m still making an intermediate movie file and then letting QuickTime Pro do an “export to iPod” (iPod video is a specific set of MPEG-4 bitrates and options [specifically the low-complexity H.264 baseline profile… see the iPod tech specs], one I haven’t tried to duplicate in QT Pro or other encoding apps).

You know what would be even more awesome? If MPEG Streamclip were AppleScript-able, so you could automate conversion of bunch of MPEG files. Still, it’s nice to be able to get these files out of MPEG-1 at all.

Comment (1)

  1. […] with what’s needed by actual users of media software. I also blogged a couple times (1, 2, 3) about how the process of ripping, de-interlacing, and re-encoding the video from DVD was […]

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.