VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    I have OTA recordings (WTV--> MPG) which are then converted to avi that are out of sync (DGIndex confirms that the mpg audio has a positive delay).
    VLC and MPC bring it into sync using a positive value of 250.
    There is a method of syncing using a command line in ffmpeg that seems to work when the delay is negative.

    http://alien.slackbook.org/blog/fixing-audio-sync-with-ffmpeg/

    ffmpeg -i bbt.avi -itsoffset 0.25 -i bbt.avi -map 0:v -map 1:a -vcodec copy -acodec copy insync.avi
    It doesn't seem to work for positive delays.
    Any ideas?
    Quote Quote  
  2. try negative offset
    Quote Quote  
  3. How are you converting the MPG to AVI? Maybe there's a chance to remove the delay at that step?

    Otherwise try remuxing using AVI Mux GUI or try a different output container (e.g. mkv).
    Quote Quote  
  4. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    @pandy, if I change the .25 to -.25, the result when played back with MPC is that I have to give it a positive delay of 500m/s.

    @sneaker, A batch file using Staxrip is used to convert the mpg files (I think it uses information from DGIndex, so would it expect it to know that the delay was positive? - in any case it's the same settings for other mpg files that have negative delays and they play ok when converted).
    I take it you mean take the avi file with the positive delay and put it in an mkv container then try the command line.
    I'll try it.
    Quote Quote  
  5. Delays in AVI can be a bit problematic and I don't think ffmpeg will do them in a good way (or at all?) while in copy mode. Hence my suggestions.

    Originally Posted by sambat View Post
    I take it you mean take the avi file with the positive delay and put it in an mkv container then try the command line.
    No, I meant outputting to mkv from ffmpeg.

    I cannot say much about StaxRip, at least not without a complete log. But to me it would make more sense to fix it there, if only to avoid the hassle of doing additional post-processing in e.g. ffmpeg. In an AviSynth based process it would be easiest to either add Trim() to the video script or DelayAudio() to the audio script before the encoding happens.

    What AVI Mux GUI can do to some extend is fix borked AVI delays by replacing the "delay" by real silence encoded in the audio format. There are similar softwares to do that like delaycut. But if ffmpeg does not apply delay to avi in copy mode at all this is futile anyway.
    Luckily, AVI Mux GUI can (properly) delay the audio by itself so you don't need ffmpeg at all.
    Quote Quote  
  6. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    ffmpeg chokes trying to output to mkv.
    If I convert the avi to mkv using MKVGui then use ffmpeg on the mkv source it also fails with the same message.

    This problem only shows up with The Big Bang Theory and I don't want to get into rewriting the bat file for this particular run of recordings so I will just continually to do them individually in VirtualDub.
    Thanks to you both for the suggestions.
    Cheers.


    ffmpeg -i bbt.avi -itsoffset 0.25 -i bbt.avi -map 0:v -map 1:a -vcodec copy -acodec copy insync.mkv
    [matroska @ 0517df20] Timestamps are unset in a packet for stream 0. This is dep
    recated and will stop working in the future. Fix your code to set the timestamps
    properly
    [matroska @ 0517df20] Can't write packet with unknown timestamp
    av_interleaved_write_frame(): Invalid argument
    Quote Quote  



Similar Threads

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