Cast for two

Saturday, October 06, 2007

Convert muxed MPEG-1 to MOV or MPEG-4

A lot of Sony digital picture camera's also capture video. Some store the captured video files into muxed MPEG-1 files and have extension .MPG. To check if your Sony camera does this, proceed as follows. Open up the "Window" menu in Quicktime and select "Show Filminfo". It reports the structure of the file as "MPEG1 Muxed, 640x480 pixels" (other sizes are possible). Those files can be played back by Quicktime but when exporting to another videoformat or saving as mov, the audio does not come along. Importing such files into Imovie '08 or Final Cut Pro 2 also do not work propely. (Read iMovie does not work with muxed MPEG-1 and MPEG-2 clips about that and written by Apple).

To get rid of those pesky muxed mpeg-1 files, I now describe a procedure that does not need recoding of the captured original file. Instead, it allows to losslessly transforms the muxed mpeg-1 file into a Quicktime mov file without any convertion loss nor lengthy encodings. You only need one freeware tool that you can download from Apple's side.

To get rid of the muxed MPEG-1 files you need MPEG Streamclip. (MPEG Streamclip for windows). I tested this with a movie file captured by a Sony Cybershot DSC-W1. First, I started MPEG Streamclip:

Next, I dragged the MPEG movie movXXXXX.mpg to the application (XXXXX is the number of your movie, in the test case it is mov01249.mpg):

Then, select from the File menu, "Demux to M2V and AIFF":

Specify where the two new files must be saved and click Save.
Now, double click on the new movXXXXX.m2v file to open up Quicktime Pro. If you now export the movie or save as mov, the audio will be in it. This is because if movXXXXX.aiff is in the same directory as where movXXXXX.m2v is stored, Quicktime Pro will automatically load the video with extension .m2v and the audio file with extension .aiff together. (as explained by Heny Kautz). You can now save as a movXXXXX.mov file for editing or export to another format (for exmple MPEG-4). This is the resulting file in MPEG-4 format mov01249.mp4. You can download that file, play it with Quicktime and try to import it into Imovie '08 or Final Cut Pro 2. It should work. Succes.

30 comments:

Anonymous said...

I think this will only work if you purchase the MPEG2 qt plugin from Apple.

Jenny said...

I helped my boss make a Christmas slideshow for our holiday party, and all we had to do to get the audio and the video to import correctly into iMovie with MPEG Streamclip was File>Export to DV. iMovie accepts DV with audio and video just fine! No need to demux and split everything. (Unfortunately, QuickTime Pro wouldn't allow us to open a .m2v file, giving us an error that it was not a movie file. Last attempt was to do DV, because I had read iMovie was cool with it.)

Thanks for the post.

cast42 said...

Thx for sharing this jenny. Altough using DV might work for your case, in general it requires recoding your digital assets. Recoding means loss of quality and loss of time. The workflow proposed in blogpost just rewraps the audio and video track, hence no decoding/encoding is going on. Unfortunatly, as remarked in the reactions, you probably need to buy the MPEG-2 plugin for Quicktime .

Anonymous said...

I just converted a MPEG1 muxed file into a Quicktime Movie using MPEG Streamclip. Spent a couple hours exploring Quicktime Pro plus other applications. Looking at spending $50 and not sure if it was going to work anyway. This did it flawlessly and you can't beat the price. Thanks for the tip

Jon said...

I just downloaded a Streamclip and tried demux a video file. When I double click on the m2v file after converting it will not open. It says 'it is not a movie file'. Any help?

cast42 said...

@jon : are you on osx or windows ? With what program did you open the .m2v file ? Quicktime or Quicktime Pro or something else ? Do you have Quicktime MPEG-2 plugin installed (it cost 30 dollar or so) ?

Jenny said...

Hi,
Thanks for the good information. Do I need Quicktime Pro for this to work?

eddie said...

Ummm, everything works until I open up the M2V file with Quicktime (I have pro and mpeg 2 plug in). Quicktime does not open the audio file. Do I have a setting right?

Mac OSX, btw. Thanks.

cast42 said...

@eddie Did you try to export after opening the .m2v file ? If so, was the audio included ? If not, is the audio file in the same directory as the .m2v file ?

eddie said...

Yes, when I open in quicktime pro, the sound is not there. When I open with streamclip, the sound is there even if I am only opening the m2v file. I can then export it to mpeg-4. I can only "save as" from streamclip to a mpeg file, which will be soundless.

Very helpful anyway.....my concern is the loss of quality you pointed out in the "export" process. Any thoughts?

Thanks

greentub said...

Thanks for the tip. I don't have QuickTime Pro. I simply used the MPEG Streamclip and exported to QuickTime (mov). I then imported into iMovie without a problem.

-- greentub

joe said...

Yea, Works good, except that the sound is muffled! Sounds like crap! I make music video DvD's to be played in cars with systems and this is gonna sound like shit when you play it through high end equipment made for sound quality. I don't know maybe it will work, I guess I'll just have to try and find out. Thanks for the tip!

cast42 said...

@joe I don't understand why you think it will sound bad. There's no sound compression going on. The procedure explained here give's you a Quicktime .mov file with the unaltered video and audio track retrieved from the original. Only if the orginal is bad qualtiy, the resulting Quicktime .mov file will sound bad. Let us know what your experiences are. Looking forward to hear from you.

Anonymous said...

I had a MPEG-1 muxed video (from a Sony camera) that I wanted to save on my ipod. Using MPEG Streamclip, I opened the movie and saved it as a Quick Time video (using "apple video" as the compression) with a .mov extension. I then opened Quick Time Pro and exported that file as an ipod movie (with a .m4v extension). I then opened itunes and imported the m4v file and now I have both audio and video.

cast42 said...

@Anonymous : glad to hear you accomplished what you wanted. The difference with the procedure in the blogpost is that no reencoding is going on. Of course, if you movie must be played onto an Ipod you have to reencode from the muxed MPEG-1 to a ipod flavor of MPEG-4. If you have only one piece then your way of working is perfectly ok. If you have several bits that you want the edit together in your nonlinear editor (like iMovie or Final Cut), you may want to preserve the original MPEG-1 until your montage is done. In that case, MPEG streamclip and Quicktime Pro are there to rescue. However, in the last Quicktime update (7.5.0 version 816), I've read Apple changed something that may affect it capabilities of processing muxed MPEG-1.

jon said...

big ups mate. perfect to get mpeg-1 to play on my appleTV.

Anonymous said...

I just spent a week trying to figure out how to get an MPEG1 file to play in a program called PsychToolbox inside Matlab on a Mac and this was the ultimate solution. Thanks.

Maria said...

Thank you so much!!! I have spent two weeks trying to figure out how to convert a Sony camera mpg video of my daughter singing to share with family members. My level of frustration was indescribable until I stumbled across your page! It still took me a few tries, but I was successful in converting the video clip to share with family and it is now on my iPod! You don't know how much this means to me! Thank you!

cast42 said...

@maria: glad to hear you successfully got the video on the ipod.

淑丽 said...
This comment has been removed by a blog administrator.
davidf01 said...

(1) if streamclip is a native quicktime app, then it should be possible to use the elgato turbo264 to accelerate the demuxing, correct?

it demuxing should be a special case of transcoding, correct?

anyone tried this yet?

NOTE: elgato t/s says that the turbo264 will NOT support /audio-only/ source files! (specifically mp3) :-( ... apparenetly it requires a "movie" container as input (which just another typical example of the incredible overall laziness & general shoddiness at ElGato - but i digress). Hopefully this audio input format limitation wont effect audio demuxing.

(2) since streamclip requires the mpeg2 plugin from apple (~$30), one wonders how difficult it would be to rebuild the existing VLC mpeg2 library as a (free) full-fledged native /quicktime/ plugin?!

alas, the devs who best understand the answer at the VLC (mac) team do not respond to emails about issues like this :-( .... eg getting a turbo264 driver for the h264lib .... so someone from the outside is hoing to have have to provide insight.

davidf01 said...

opps, forgot to turn on the email follow-up option (however blogger should have stored a preference for that!?)

zahadum said...

re acceleration - x86 (openCL) vs ppc (turbo264)

the question about hardware acceleration for streamslip raises the issue about what the plans are for updating the app for snow leopard.

at present, the app is /based/ on jaguar/QT6 api's, and is forward /compatible/ with subsequent versions (10.3, 10.4, 10.5).

however, 10.6 presents a road in the fork for both quicktime api's and for the underlying hardware available for acceleration of transcoding.

firstly, the hardware: modern gpu's are not installed on almost all PPC macs (and only on the newest x86 macs), so openCL (and grand central) would not be of much use, even in snow leopard was ported back to ppc.

which means that the turbo264 is the only practical alternative way 20M ppc macs can hope to get realistic performance from quicktime-based apps such as streamclip.

secondly, the software: quicktimeX will continue the modernization of apple's legacy media platform which has become incredible creaky (in evert respect - performance, codebase, design, innovation, etc).

it is not clear if a carbon-based quicktime-app like streamlink will be forward-compatible with a (supposedly) cocoa media environment like QT/X!?

in other words: it is possible that streamlink users might be stuck with the worst of all possible worlds: no hardware acceleration on PPC with an add-on product like turbo264 /nor/ any 'free' hardware acceleration for x86 from the built-in GPU's.

of course it is insane that there is still all this legacy mpeg1 shit still being produced mostly by cheap PC junk boxes (not to mention the horrendous 20 year-old installed base of all this boneheaded muxing) - nonetheless, this is a fact mac users must endure; so questions about legacy conversion apps are now more crucial than ever as the mac transitions into a new era of hardware acceleration.

Anonymous said...

Hi,

Can anybody explain to me step by step the procedure to Convert sony cameras videos (mpeg1) to a format compatible with iDvd and iMovie09 using MPEG Streamclip without losing the image or sound quality?
I already tried and successfully converted one video to .avi, but don't know if this is the best way to go, also there is plenty of options regarding sound and compression, etc and I AM totally LOST! I'm not really a "techie" I just want to be able to create family iDvds.... please Help!

PS I don't have neither Quicktime Pro neither the plugins MPEG2 or other and would rather not buy them!

Thank you

A desperate woman

Jitender said...

Virtual Studio is the pioneer web cast streaming service provider company in India based out of New Delhi, having web cast for various corporates and multinationals, a number of events of international importance. Starting from being the official webcasters of the ‘Pop John Pall’s visit to India in 1999; they have covered it all from Bill Clinton to Bill Gates. International Events such as Executive Assembly of World Energy Council to Multi Location simulcast of Golden Jublee Celebration of Cardio Thoracic Surgeons. Live Series of Technology Programs for MSN to whole of Cricket series including ICC World Cup 2003 to 2007; T20; Gavaskar Border Series 2008(India vs Australia); ICL; IPL 2009. Dreamspark launch by Bill Gates at IIT Delhi. Live streaming of 10 Channels of World Space satellite radio. And scores of live and on demand streaming web casts in between. For all streaming needs including live streaming services from India, the leading live streaming services provider is also providing on demand streaming services. In fact Virtual Studio is a preferred web cast streaming media company with its head office based in Delhi.

Anonymous said...

i don't care how old this post is... jenny, you are frickin' genius. thanks, josh

Anonymous said...

i ended having the same issue with qt pro that everyone else here posted about. so, i used stream clip instead. after the mpeg was demuxed i opened the m2v file in streamclip. it took a long time to open the demuxed files but there is a progress bar so you no you're not frozen. then i exported to mp4. it did a beautiful job at deinterlacing and there were no sync issues. cheers, josh

Kate said...

great job!!! thank you for sharing this informative post. well, i have a question, does this tool works available in mac osx? i am using a macbook.

Kate

Lode Nachtergaele said...

@Kate all tools are available for mac osx computers

shane Falco said...

Nice topic.

MPEG Streamclip is actually great tool for converting video files.

It seems Handbrake (free) can handle this conversion, right?