VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    To this pont I've struggled for the last two days, trying to use ffmegX (on an Intel iMac) to convert two sets of files (avi + idx + sub) into mpg files or VIDEO_TS files, which I plan to subsequently Toast onto a DVD that will play in a standard DVD-player.

    The problem is loss of audio-video sync in the output files.
    Notes: The source avi files play in sync. Also, the subtitles in all the various output files I ended up producing appear to be fine.

    As per instructions in the ffmpegX "How To", "HOW TO MAKE A DVD WITH SELECTABLE SUBTITLES ON MAC OSX WITH FFMPEGX", I started my attempts with the mpeg2enc video encoder.

    The audio-video offset is of the order of a second or two - sometimes approximately constant and sometimes progressive, depending on the conversion settings I use in ffmpegX.

    Subsequently, I tried as many variations of settings in ffmpegX as I could glean ideas from posts/responses by other people in this forum and other forums.
    At one point, changing the decoder to QuickTime merely resulted in different loss of audio-video sync.
    At one point I re-set the audio bit rate for the output files to equal that in the input files. [The audio sampling rates were already set equal.]

    There is offset (loss of sync) in the (intermediate output) mpg files, and also of course in the (final) VIDEO_TS files.
    The offset is sometimes different for the two output files (that correspond to the two sets of source files).
    For some conversion-settings of ffmpegX the audio-video offset is progressive with the time into the outputted video.

    At another point I experimented with converting from avi to Xvid, andanother time to DivX instead of to mpg or VIDEO_TS - following a compromise idea of at least burning the subtitles into the two output files and then using the ffmpegX tool to join the two output files into one. Even then there was comparable loss/offset of audio-video sync in the outputted files.

    I haven't been able to shake off the loss of audio-video sync; and I'd really appreciate detailed guidance to success. I am a bit more advanced than a complete newbie - but video is an occasional and easily misremembered activity for me. Also, I don't have money to spend on other software; and I don't have much useful access to PCs.
    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Thread moved to mac forum where you can get more help.
    I think,therefore i am a hamster.
    Quote Quote  
  3. Member PBear's Avatar
    Join Date
    Sep 2002
    Location
    San Francisco Bay Area
    Search Comp PM
    I haven't had a lot of experience converting videos with Mac platform tools, but I do know from years of re-encoding video files on the PC that audio sync problems, when converting from AVI container files, can almost always be attributed to AVIs that have been encoded with variable bitrate (VBR) audio (a practice that should be actively discouraged for any type of video encoding).

    The problem can usually be corrected by extracting the audio stream from the AVI container, re-encoding it with MP3 or AC3 compression using a constant bitrate (CBR) setting and using the resulting file as the audio source for the target video you wish to make. If the tool you're using to create your final video doesn't do audio passthrough (i.e., it insists on re-encoding the audio even if it's already properly encoded), then you can try just extracting the audio from the AVI to a raw WAV file, without the interim re-encode step, and use that WAV file as the input audio for your final MPEG2 file, remembering to use CBR audio compression for the final encode.

    Don't know what tools are available to do these things on the Mac but, if you can find them, this may solve your problem.

    Regards.
    Quote Quote  
  4. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    I haven't had a lot of experience converting videos with Mac platform tools, but I do know from years of re-encoding video files on the PC that audio sync problems, when converting from AVI container files, can almost always be attributed to AVIs that have been encoded with variable bitrate (VBR) audio (a practice that should be actively discouraged for any type of video encoding).

    The problem can usually be corrected by extracting the audio stream from the AVI container, re-encoding it with MP3 or AC3 compression using a constant bitrate (CBR) setting and using the resulting file as the audio source for the target video you wish to make. If the tool you're using to create your final video doesn't do audio passthrough (i.e., it insists on re-encoding the audio even if it's already properly encoded), then you can try just extracting the audio from the AVI to a raw WAV file, without the interim re-encode step, and use that WAV file as the input audio for your final MPEG2 file, remembering to use CBR audio compression for the final encode.

    Don't know what tools are available to do these things on the Mac but, if you can find them, this may solve your problem.
    Based on a preliminary look, I believe you're correct. Many thanks!!
    Some specifics: Currently, I have ffmpegX (which is a great and free-to-use Mac utility) set to use the mpeg2enc encoder; and under the ffmpegX/Options_tab, under mpeg2enc options, there is a check box for Constant Bit Rate.
    With the default settings, that box is unchecked.
    After I did check that box, and ran a test conversion starting from the aforementioned avi files, there appears to be better/manageable audio-video sync in the outputted mpg files.
    Specifically, the remaining small "fly in the ointment" is that: In both outputted mpg files, the the video lags the audio by approximately half a second.
    Handily, under the ffmpegX/Options_tab there is a field for entering a Sync offset setting for the conversion (+/-).

    I ran the test conversion with a setting of -500 ms in the Sync field; and the audio-video sync is fairly close throughout the entire outputted mpg videos. Even so, lip sync is still noticeably off.

    Now, can anyone help me find a free-to-use Mac tool/utility that will display the audio waveform in a useful way that will enable me to accurately measure the audio-video offset when I play the outputted mpg movies (for example in VLC Media Player), please?
    [Note: The several optional audio displays in VLC Media Player (for Mac) are more pretty than useful for measuring/timing/etc.]
    That way, I could run a final conversion using and accurate Sync correction.
    Quote Quote  
  5. Member terryj's Avatar
    Join Date
    Sep 2002
    Location
    N35°25.24068, W097°34.204
    Search Comp PM
    first, ffmpegx isn't free. it costs $15. I'd wish people would stop saying that.
    I'm all for Major, it's creator getting paid for his hard work. You should be also.


    Now to your issue:
    With Perian installed, what I would first try in Quicktime Player 7 Pro to open the
    .avi file, with Perian installed, and export the file out as DV Stream file with the audio locked.
    Simply File-->Export to DV Stream, choose your flavor ( NTSC/ PAL) and make sure
    you check the lock box on the audio. When that is done, play back the DV stream file
    and see if everything is in sync. IF so then good, proceed to build the DVD in ffmpegx,
    using the newly created DV Stream file.


    If that doesn't work, then I would try second is in Quicktime Pro Player 7, is to separate the audio
    and video into two separate files as suggested by PBear.
    Simply open the file in QTP7P, and File-Export Audio to AIFF , 48khz, 16bit, 2 channel stereo.
    Then once that is done, go back to the avi file and this point Export--> File to Movie to Quicktime movie,
    no audio, Compression set to None.

    Then using those files, proceed to build the DVD in ffmpegx. You could convert the audio then in ffmpegx to a cbr mp3 file,
    and then use that in place of the AIFF file, that would save you a step in ffmpegx's conversion.

    As for what you want with "viewing the waveform as it plays to measure where it drops out of sync" I can do this all day long in
    Final Cut Pro, I don't know anything else that would allow it, sorry.
    "Everyone has to learn, so that they can one day teach."
    ------------------------------------------------------
    When I'm not here, Where can I be found?
    Urban Mac User
    Quote Quote  
  6. Member
    Join Date
    Jun 2003
    Location
    United States
    Search Comp PM
    QTSync does a great job of re-syncing bad A/V. You may then use whatever app(s) you wish to author/burn.
    Quote Quote  
  7. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Originally Posted by bonespur View Post
    I ran the test conversion with a setting of -500 ms in the Sync field; and the audio-video sync is fairly close throughout the entire outputted mpg videos. Even so, lip sync is still noticeably off.

    Now, can anyone help me find a free-to-use Mac tool/utility that will display the audio waveform in a useful way that will enable me to accurately measure the audio-video offset when I play the outputted mpg movies (for example in VLC Media Player), please?
    Even better, you can sync audio 'live' in VLC using the 'f' and 'g' keys, in steps of 50 milliseconds (very close to a frame duration of 42 ms). When you have good sync, the On Screen Display will tell you the amount.
    If I remember correctly, the numbers are reversed (plus vs. minus) between VLC and ffmpegX, so adjust for that.
    Last edited by Case; 26th Feb 2011 at 21:02.
    Quote Quote  



Similar Threads

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