Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Our Archives > General Archives > Digital Video & Audio Archives > Why is .mpg --> .mov such a pain with QT?? Have to jump thru hoops to preserve audio.

 
Why is .mpg --> .mov such a pain with QT?? Have to jump thru hoops to preserve audio.
Thread Tools
Posting Junkie
Join Date: Jun 2003
Location: Dangling something in the water… of the Arabian Sea
Status: Offline
Mar 23, 2004, 08:29 AM
 
To get files off of DVD-VR discs I'm still ripping on my PC to .mpg. (I record TV clips to DVD-VR on DVD-RAM every once in a while.)

And to convert them to QuickTime MPEG-4 files it seems it's still most reliable to demux the .mpgs into separate .m2v vidio and .mp2 audio files and recombine them in iMovie or something.

If I do a direct conversion from .mpg to .mov I always lose the audio. Just why is QuickTime so problematic with audio??????? This has been a problem for about as long as I can remember. Is this intentional, am I missing something, or is QT just braindead?

What software do you use to do this?
     
Nap
Junior Member
Join Date: Oct 2002
Status: Offline
Mar 23, 2004, 10:36 AM
 
Apple has chosen to not fully demultiplex mpeg files into separate audio and video tracks. They have never explained why but since other Mac apps are able to demux mpegs (BBDemux is one) it clearly is not a technical reason. Perhaps it is a licensing issue. Here is the Apple statement on the matter but it really doesn't deal with the reason:
http://docs.info.apple.com/article.html?artnum=61608
Note also that this lack of support for audio export from mpeg extends to the mpeg-2 component they sell:
http://www.apple.com/quicktime/produ...yback/faq.html
     
Posting Junkie
Join Date: Jun 2003
Location: Dangling something in the water… of the Arabian Sea
Status: Offline
Mar 24, 2004, 08:58 PM
 
What are people using to do .mpg --> .mov? I've getting audio sync issues using MPEG2 Works to demux and then recombining in iMovie.
     
Fresh-Faced Recruit
Join Date: Jan 2004
Status: Offline
Mar 24, 2004, 10:07 PM
 
this is driving me crazy as well
     
Addicted to MacNN
Join Date: Jun 1999
Location: Las Vegas, NV, USA
Status: Offline
Mar 24, 2004, 10:57 PM
 
I got this to work using Mpeg Audio Encoder (http://www.biermann.org/philipp/mad/)

The instructions are in the ReadMe and go like this:

- demux the movie with bbdemux
- open the video in Quicktime-Player
- export as a suitable format (DV or MPEG4)
- use madplay to encode the audio to aiff
- open both the video and the audio file in Quicktime-Player
- in the audio file, press CMD-A, CMD-C
- switch to the video
- choose "add-scaled" from the edit menu
- Save as, "allowing dependecies" will be ok for most applications"

Chris
     
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status: Offline
Mar 25, 2004, 01:04 AM
 
if that's in the read-me Philipp should get a dope slap.

NEVER scale the audio. The reasons for this are many, and none of them apply to the video. And there should be no discrepancy anyway, so first try Add (NOT scaled).

the reasons: scaling the audio changes the pitch. scaling the audio changes the sample rate to one not supported by the sound card, so the cpu must resample on the fly during playback in order to feed the sound card at a supported sample rate (this resampling takes more power than you would think, and that power should be going to the video decoder). In QuickTime, scaling the audio can lead to "soft sync" problems, which are impossible to fix (this is where a movie drifts out of sync while playing, but snaps back in sync when you pause and resume).

Anyway, none of these problems apply to scaled video, so if you must scale, scale the VIDEO to the AUDIO, NOT vice versa. Or use the app I wrote for this purpose: Sync-Hole

as for the original post, you might try OpenShiiva, though it's MPEG-1 support is pretty flakey
     
Posting Junkie
Join Date: Jun 2003
Location: Dangling something in the water… of the Arabian Sea
Status: Offline
Mar 25, 2004, 07:36 AM
 
Hmmm... The video was from a TV source, and changing the frame rate from 15 fps to 14.985 fps (29.97/2) but still using QT seemed to correct the sync problem...

Can it be that simple, or is it because I've changed the front end and some of the software at the same time? (MPEG2 Works before for demuxing and then iMovie, vs. ExportToQT.)
     
Addicted to MacNN
Join Date: Jun 1999
Location: Las Vegas, NV, USA
Status: Offline
Mar 25, 2004, 07:40 AM
 
NEVER scale the audio
I agree. You should never scale the audio...BUT...since the demuxed audio and video are the same length, the audio really is not getting scaled. All that you're doing is telling Quicktime to put the start of the audio at the start of the video, and the end of the audio at the end of the video. It works great, really.

Chris
     
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status: Offline
Mar 25, 2004, 10:28 AM
 
well, if it really doesn't change the length, then you're less likely to encounter some of the problems I listed, but on the other hand if it really doesn't change the length why no just use Add instead of Add Scaled? Then you don't have to check whether or not it changed the length. Another reason I'm so uptight about this little pet peeve is I read in some apple mailing that using ScaleTrackSegment (which is the only public QT API function I've ever found that could be used to implement Add Scaled) reduces the precision of the movie's (or maybe the track's) time scale from a double to a float, which in longer movies could cause sync problems.
     
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status: Offline
Mar 25, 2004, 10:32 AM
 
Originally posted by Eug Wanker:

Can it be that simple, or is it because I've changed the front end and some of the software at the same time?
I'm not exactly sure what you're asking, but it souds vaguely related to this, from the QTMutator readme:

QT Mutator allows you to change both a tracks duration and it's offset. Both of these values are stored with the track in the movies time scale. Changing these values has no effect on the track's media, they only change the way in which QuickTime will interperet the data. However, because most applications use QuickTime to access movie data, it is not usually nescessary to change the actual movie data.
if that is not helpful in answering your question, please rephrase it
     
Addicted to MacNN
Join Date: Jun 1999
Location: Las Vegas, NV, USA
Status: Offline
Mar 25, 2004, 10:58 AM
 
why no just use Add instead of Add Scaled?
That does make more sense, but Add Scaled is probably more foolproof, since Add inserts the track at the playhead. Therefore, if I were writing the instruction and they had to work for novice users, I might tell them to use Add Scaled also.

Chris
     
Nap
Junior Member
Join Date: Oct 2002
Status: Offline
Mar 25, 2004, 11:18 AM
 
Assuming you have already converted the mpeg tracks to QT formats you can just as easily and quickly copy the video track to the clipboard and then Add Scaled to the audio track. It is quick because the data is not really copied to the clipboard, only references to the video track. I have done it many times with 8 or 10 gig video tracks and it happens much much too fast to involve actually copying all the video data to the clipboard. Really, there is no excuse for trying to scale the audio to the video.
     
Posting Junkie
Join Date: Jun 2003
Location: Dangling something in the water… of the Arabian Sea
Status: Offline
Mar 25, 2004, 04:51 PM
 
if that is not helpful in answering your question, please rephrase it
Original source is video and I'm assuming at 29.97 fps.

I think I had set the video for 15 fps for the final file and I'm wondering if perhaps whatever software I was using at the time just did the equivalent of deleting half the frames of this 29.97 fps video, but paced it as if it were originally 30 fps.

If that happened, the 5.5 video would be sped up a little under half a second by the end.

Now that I think about it, that doesn't make sense either though, considering what I did.

1) MPEG2 Works used to demux original .mpg file --> .m2v and .mp2
2) Used QT to convert .m2v to .dv
3) Used iTunes to convert .mp2 to .aif
4) Imported both into iMovie. However, the audio was slightly longer than the video.
5) Exported the movie at 15 fps.

Looking at this again, it seems the error occurs BEFORE the 15 fps export, but I'm not sure why.

However, this works:

Simply used ExportToQT to convert from .mpg directly to MPEG-4 .mov file.

Actually, ExportToQT seems to pretty much do the same thing much of the way. ie. Demux, and then convert using QT, and then remux, except now audio is sync'd.

BTW, I had been using these front ends to the open source apps mainly because I don't quite understand all the settings for each of the apps. Time to read up more on this stuff I guess.
     
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status: Offline
Mar 25, 2004, 05:35 PM
 
the only open-source app you might be talking about is BBDemux, and it couldn't be more simple. there's no settings or controls, you just drag your mpeg to the window that says "drag mpeg file here", select output files for the streams it finds, and wait.

Anyway, I don't know what was wrong with your process, and I didn't know that ConvertToQT has somehow worked around the fact that QT refuses to demux or convert mpeg audio (if that's indeed what you're saying), but here's my theory. Your movie started out at an odd framerate, not exactly 29.97 fps, probably because of dropped frames during capture or maybe because of incompetent authoring by whoever captured it (maybe THEY scaled the audio!). When you exported to DV-NTSC, it demands that the framerate be exactly 29.97, and if it's not careful it will just change the duration of every frame to meet that demand, and that's where the problem began. But maybe it was theis MPEG2Works thing, I don't know what that is. Also, iMovie was not intended to edit existing digital media, only for importing and creating new media. The file-importing it does is really half-assed, and any time you try to use iMovie for movies you didn't get from your camcorder, you're asking for trouble. IMO
     
Posting Junkie
Join Date: Jun 2003
Location: Dangling something in the water… of the Arabian Sea
Status: Offline
Mar 25, 2004, 11:01 PM
 
Originally posted by Uncle Skeleton:
Anyway, I don't know what was wrong with your process, and I didn't know that ConvertToQT has somehow worked around the fact that QT refuses to demux or convert mpeg audio (if that's indeed what you're saying), but here's my theory. Your movie started out at an odd framerate, not exactly 29.97 fps, probably because of dropped frames during capture or maybe because of incompetent authoring by whoever captured it (maybe THEY scaled the audio!). When you exported to DV-NTSC, it demands that the framerate be exactly 29.97, and if it's not careful it will just change the duration of every frame to meet that demand, and that's where the problem began. But maybe it was theis MPEG2Works thing, I don't know what that is.
The video was recorded with a Panasonic DVD-RAM recorder (standalone) off of TV. (It uses UDF 2.0 and DVD-VR.) What frame rate is used? The capture process to .mpg should be exact however, since it was done on a PC using Panasonic's own ripping software to convert DVD-VR to .mpg (which always keeps everything in perfect sync, unlike some DVD-VR -> .mpg software).

Also, iMovie was not intended to edit existing digital media, only for importing and creating new media. The file-importing it does is really half-assed, and any time you try to use iMovie for movies you didn't get from your camcorder, you're asking for trouble. IMO
Yeah, iMovie really isn't built for this.

Of course all this could be avoided if QuickTime wouldn't lose the audio during conversions.

BTW, ExportToQT does NOT bypass QT. It first demuxes, then uses QT to convert, and then remuxes.
     
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status: Offline
Mar 26, 2004, 01:44 AM
 
Originally posted by Eug Wanker:
The video was recorded with a Panasonic DVD-RAM recorder (standalone) off of TV. (It uses UDF 2.0 and DVD-VR.) What frame rate is used? The capture process to .mpg should be exact however, since it was done on a PC using Panasonic's own ripping software to convert DVD-VR to .mpg (which always keeps everything in perfect sync, unlike some DVD-VR -> .mpg software).
mkay, I can't say I know much about that


BTW, ExportToQT does NOT bypass QT. It first demuxes, then uses QT to convert, and then remuxes.
well there must be more than that if it works, because if you just open a demuxed mp2 file in QT it still won't export it (will it? I haven't bothered to try since 6.0 or so).
     
 
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 04:59 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2