VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member
    Join Date
    Apr 2009
    Location
    United States
    Search Comp PM
    Hi folks! New to the forum, but not to ffmpegx. Just finally stumped. I've been using the "join" tool off and on for a couple years with never any trouble, but now I've come to a dead end.

    I have two halves of a video. One is 699.2meg, the other 700.7meg. When dropped in Source, both are recognized as AVI, mpeg4, yuv420p, 640x272, AC3, 48000 hz, stereo, 192kbps. For both, the audio and video are perfectly in sync. After using the "join" tool, though, the audio ends up almost a full second "early", right from the beginning and straight through to end.

    I've tried using the standard conversion to AVI-DivX that is the ffmpegx default conversion, and both convert perfectly ... but again using join on the newly converted files the result is out of sync.

    Showing the movie properties in Quicktime shows the video and audio tracks on part 1 to be 1:25:58:64 and 1:25:58:66 respectively, and for part 2 to be 1:17:58:12 and 1:17:58:18. The joined file shows 2:43:56:68 and 2:43:56:50. With discrepancies of only a couple hundredths of a second this would not seem to be the problem.

    I thought maybe I'd separate the video and audio, join them separately, and then re-add the audio. So I dropped the first half into source and un-checked "encode audio" on the audio screen ... but the resulting file still had the audio in it ... ??? I tried playing with some of the bit rates, but at this point it seems I'm just shooting in the dark.

    So, any clues as to what I can try next? Seems it shouldn't be this hard just to join two halves into a whole!
    Quote Quote  
  2. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Thanks for your detailed description. It rules out some possible causes. But I'm afraid I do not have a sure fix for this problem.

    If you have QuickTime Pro (/w Perian), you could try joining (pasting the second part at the end of the first part) there. Save as .mov. Then convert the .mov to AVI-DivX. Perhaps the QuickTime architecture does something that keeps the sync.
    Quote Quote  
  3. Member
    Join Date
    Apr 2009
    Location
    United States
    Search Comp PM
    OK, no stranger to QTP or Perian either. Opened the two in QTP, copied #2, pasted at the end of #1, saved as self contained movie. I now have a .mov with the info:
    Video Track ID 1, DivX 4.1.2, duration 2:43:56:97, Frame Rate 25
    Sound Track ID 2, MPEG Layer 3, duration 2:43:57:50
    and it's in sync beginning to end.

    When I dropped this resulting .mov back onto ffmpegx, it showed the video recognized as "mgeg4 yuv420p" and the audio recognized as "mp2 48000 Hz". I ran it through the default AVI DivX encoder and this time the first half of the resulting video is perfectly in sync, but the second half of the resulting .avi has the audio late by about a half second. I checked the left and right sides of the cut point (around 1:20:00:00 and 1:30:00:00) and the sync issue is definitely limited to "part 2" now, even though it is not out of sync in the .mov. I suppose I can just leave it as a .mov.

    For that matter, is there any reason I cannot just change the .mov extension to .avi and leave it at that without re-running it through ffmpegx? I tried it and it still opens happily in Quicktime, mplayer, and VLC. When I pasted Part2.avi at the end of Part1.avi in QTP and saved the resulting file, there did not seem to be any "conversion" or "flattening" that took place. QTP just saved it with a .mov in the normal amount of time it would take to File->Duplicate something 1.3gig in size. What's in a "shell" if the interior is still DivX and MP3? Is the .move extension just a Quicktime placebo? Anyone know?
    Quote Quote  
  4. Member
    Join Date
    Aug 2005
    Location
    Palo Alto, California USA
    Search Comp PM
    Both AVI and MOV are "container" formats (essentially file specifications). Within these containers can reside media encoded with a wide variety of different video and audio codecs. So, what's the difference? It's actually Windows vs. Mac, essentially. These container formats achieve similar ends, but they are not the same. It's like Word vs. WordPerfect. Similar things targeted to solve similar problems, but not the same.

    Just because VLC can recognize a file means very little, actually, since VLC is written to be very tolerant of errors, Frankenstein hybrid formats, etc. So, playability in VLC should not be taken as any sort of proof of compatibility, say, or standards compliance.

    That said, here's something to try in order to solve your problem. Since QT seems to get the sync right, be sure to select "decode with QT" in your conversion. If you've already done so, and still get a sync error, then I'm confused, but post back, and someone can walk you through a troubleshooting/solution procedure.
    Quote Quote  
  5. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Originally Posted by RedDwarph
    I ran it through the default AVI DivX encoder
    ffmpegX has two AVI DivX encoders (mencoder and ffmpeg) and two AVI XviD encoders (again mencoder and ffmpeg), all of which are pretty similar from a playback point of view. The ffmpeg encoders allow for 'Decoding with QuickTime' (in the Options tab), which may help keeping sync at the transition point.

    Originally Posted by RedDwarph
    For that matter, is there any reason I cannot just change the .mov extension to .avi and leave it at that without re-running it through ffmpegx? I tried it and it still opens happily in Quicktime, mplayer, and VLC.
    AVI and MOV are both container formats with several elements in common, but they are not the same. You can fool some software some of the time, but not all software all of the time. In the end, you may loose track of the true identity of the file after a while.

    Originally Posted by RedDwarph
    When I pasted Part2.avi at the end of Part1.avi in QTP and saved the resulting file, there did not seem to be any "conversion" or "flattening" that took place. QTP just saved it with a .mov in the normal amount of time it would take to [duplicate].
    One of the benefits of the QuickTime file format, if you will. It doesn't need to change much in this operation.

    Originally Posted by RedDwarph
    What's in a "shell" if the interior is still DivX and MP3? Is the .move extension just a Quicktime placebo? Anyone know?
    Short (but incomplete) answer: the shell also holds ordered meta-data. There are some large technical documents on these containers formats, many of them freely available on the web. DYOH.
    Quote Quote  
  6. First, you can try with D-Vision which offers two different joining methods (avimerge and mencoder).

    You may also have a look to avidemux which can append .avi files one to another, then export the resulting file to a new .avi with audio/video direct stream copy.

    If you have Quicktime Pro, instead of exporting as a ".mov" file as case suggested, you may try the free "Save as .avi" component provided with MPEGStreamclip, which alloaws .avi audio/video stream copy with Quicktime.
    Quote Quote  
  7. Member
    Join Date
    Feb 2009
    Location
    United States
    Search Comp PM
    The trouble with the join is that there is probably a audio delay
    in the 2nd half of the movie. This is getting to be pretty regular
    now. I usually drop my files into avi mux and click on the audio
    to find out if there is a delay and most of the time there ia a delay
    in the 2nd clip. You'll need to use an audio editor, extract the
    audio file add x amount of silence x being the ms delay avi mux
    shows you then mux it back into the file.
    Quote Quote  
  8. Member
    Join Date
    Apr 2009
    Location
    United States
    Search Comp PM
    Originally Posted by tomlee59
    Since QT seems to get the sync right, be sure to select "decode with QT" in your conversion.
    Originally Posted by case
    The ffmpeg encoders allow for 'Decoding with QuickTime' (in the Options tab), which may help keeping sync at the transition point.
    Well, I got a chance to try this today. I took my .mov which had been correctly joined by QTP and dropped it on a fresh launch of ffmpegx. It was recognized as MOV, mpeg4 yuv420p 640x272, mp2 4800 Hz stereo. I switched to the Video tab and changed the Codec from the default MPEG4 [.AVI] (mencoder) to MPEG4 [.AVI] (ffmpeg). Then I went to the options tab and selected Decode with QT and left Letterbox checked as it was automatically. After encoding, the resulting file is 7.04gig (from the original 1.38gig) and trying to open it Quicktime locks up and has to be forced-quit, even though I'm running a 2ghz MacBook with 2 gig of ram. So, that obviously is not going to be my solution, although I'm grateful for you all pointing out that ffmpeg and mencode have different options. I was unaware of that as I've been very pleased with the results of the "default choice" up until this point.

    I'll try a couple other ffmpeg codecs that include the decode with QT option first, then jpschuck's suggestions next and see how that turns out.

    fastman: I have Audacity and was prepared to go this route, but was hoping first that I was missing something obvious to more experienced user (e.g. "tick the encode with quicktime box"). Most of my experience is with audio, so I know how to pad, stretch, and shrink if needed.

    Thank you all for being so friendly and helpful. I will post again as soon as I have tried a couple more things.
    Quote Quote  
  9. Member
    Join Date
    Apr 2009
    Location
    United States
    Search Comp PM
    Originally Posted by jpschuck
    you may try the free "Save as .avi" component provided with MPEGStreamclip, which alloaws .avi audio/video stream copy with Quicktime.
    It appears this one did the trick! After putting the "Save As .avi" component into the Quicktime library, I opened my joined .mov in QTP and used Export->"Movie to Save as AVI" (tip to others, do not confuse this with "Movie to AVI"!). It only took a couple minutes to save, and the resulting file was the same 1.38gig size and the audio was still perfectly in sync when I spot-checked a half dozen different places in each half. Dropping it on ffmpegx it is recognized as an avi with the same characteristics as my original two halves.

    Originally Posted by jpschuck
    you can try with D-Vision which offers two different joining methods
    This one also worked perfectly, using "avimerge" to join the original two halves the resulting whole was again the same size, recognized with the same characteristics, perfectly in sync, and overall was much faster. Thanks a million for pointing me toward this tool. For others, I was at first confused that nothing seemed to be happening and it was just "waiting", until I then realized I had to select "launch queue" to get the task processing. This will be my "first next step" should I run into a similar sync issue. I think I'll also drop major a note letting him know - if D-Vision's avimerge is open source it would be great to add this to ffmpegx's tool kit!

    Originally Posted by jpschuck
    You may also have a look to avidemux
    I'll be sure to check out this tool at some point as well, but as my puzzle is currently solved it'll be back burner. Again, a big thank you to Case, tomlee59, jpschuck, and fastman for your responses. I have learned a little something from each of you and will be sure to pay it forward. The world becomes a better place each time we help another. Consider this puzzle solved!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!