VideoHelp Forum
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. Member
    Join Date
    Aug 2006
    Location
    United Kingdom
    Search Comp PM
    As I'm the only one in the family with a modicum of computer knowledge I have been given a very old home video that has been digitised and the audio which has also been digitised - unfortunately approximately the first 2 minutes of the audio are missing so I'm going to have to leave the first two minutes of the video silent which isn't a major problem.

    I currently have the video in an .MP4 file (this is how the owner supplied it) and the audio is just a .aac file. They seem like strange file format selections to me - I would have assumed that they would be .avi and .mp3, but I have to work with what I've got!

    Is there a simple to use (and free!) tool (which works under Windows 7) out there which will allow me to manually sync the audio to the video? Something which will allow me to view/hear both simultaneously and perhaps move a few sliders/timer settings to manually sync them up? Then of course I need to dump them to one file (.mp4, .avi, whatever).

    Thanks for any help anyone can offer - I'm a total 'noob' at this kind of thing.
    Last edited by CompVid; 24th May 2013 at 10:34.
    Quote Quote  
  2. Member hech54's Avatar
    Join Date
    Jul 2001
    Location
    Yank in Europe
    Search PM
    If the audio and video are just s few seconds off and the difference between the two is constant throughout the video....someone may be able to help you further.
    Quote Quote  
  3. Member
    Join Date
    Aug 2006
    Location
    United Kingdom
    Search Comp PM
    I'm afraid it's more than a few seconds as apparently the original audio tape was mangled, so there's over 2 minutes missing from the start of the digital file that was created from what remained.
    Quote Quote  
  4. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Yes, if it's just an offset problem most basic editors can do what you need. The job is made easier in an editor that can display an expanded audio waveform, which makes it possible to visually match up video and audio events. Free tools I know from experience that can do this are Movie Maker 2.x and 6.0 (there are downloads for the latter on the Internet). I haven't used Movie Maker Live at all. VideoPad can also do this I suspect, and there will definitely be others.

    To prevent generational quality loss try to have your editor copy video and audio to the output without re-encoding. In this respect the Movie Maker versions above aren't suitable, since they do not support MPEG4 and AAC output as far as I recall.

    Cheers,
    Francois
    Quote Quote  
  5. Member
    Join Date
    Aug 2006
    Location
    United Kingdom
    Search Comp PM
    Thanks very much, I'll give those a shot.
    Quote Quote  
  6. Member hech54's Avatar
    Join Date
    Jul 2001
    Location
    Yank in Europe
    Search PM
    Originally Posted by CompVid View Post
    I'm afraid it's more than a few seconds as apparently the original audio tape was mangled, so there's over 2 minutes missing from the start of the digital file that was created from what remained.
    There is no easy way to fix that. It's not difficult for people like me who do this stuff quite often....but you will encounter a learning curve.
    And Windows Movie Maker is a STUPID idea.
    Quote Quote  
  7. Just remux with a ~120000 ms audio delay. You can do it with MMG (part of MkvToolNix) if you can live with an MKV file.
    Last edited by jagabo; 24th May 2013 at 11:54.
    Quote Quote  
  8. Download a free trial of a basic NLE like Vegas movie studio. Add in your clips and line them up on the timeline. Nudge them back and forth for frame accuracy.. If you can do it in less than 30 days it won't cost you anything.

    MP4 and AAC are very, very common these days.
    Quote Quote  
  9. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Originally Posted by jagabo View Post
    Just remux with a ~120000 ms audio delay. You can do it with MMG (part of MkvToolNix) if you can live with an MKV file.
    You chose your words well. There was a recent thread (here or on doom9.org) that concluded as I recall that most players don't (properly) obey timestamp offsets in the MP4 container format. I quickly tried an offset MP4 remux with ffmpeg now and not one of my players respected the offset.

    So the solution (as from that thread) is to mux in a delay in a container format like MKV, or when outputing to MP4 to physically move audio on the timeline, effectively padding with silence. I suspect ffmpeg can do the latter in a single command line because it provides a null audio source filter, but my experience of its use doesn't extend to timeline editing. If an ffmpeg fundi could confirm this it would be great.

    EDIT: It turns out that my ffmpeg command line for delaying audio doesn't work for MKV either, so I'm probably doing something wrong. I'll ask on the ffmpeg email list, but in the meantime here's another option that will work:

    1. In an audio editor, add 2s of silence to the beginning of your .aac file, taking care to output in the same format as your input to minimise quality loss
    2. Remux with ffmpeg:
    Code:
    ffmpeg -i video.mp4 -i audio.aac -codec:v copy -codec:a copy output.mp4
    Cheers,
    Francois
    Last edited by fvisagie; 25th May 2013 at 04:45.
    Quote Quote  
  10. Member
    Join Date
    Aug 2006
    Location
    United Kingdom
    Search Comp PM
    Thanks very much for the all of the suggestions - will have a good play this weekend.
    Quote Quote  
  11. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Originally Posted by jagabo View Post
    Just remux with a ~120000 ms audio delay. You can do it with MMG (part of MkvToolNix) if you can live with an MKV file.
    At least that part (MKV) works very well with ffmpeg:

    Code:
    ffmpeg -i invideo.mp4 -itsoffset 00:00:02.000 -i inaudio.aac -codec:v copy -codec:a copy out.mkv
    The -itsoffset option must appear before the input being delayed, the audio in this case.
    Quote Quote  
  12. Originally Posted by fvisagie View Post
    Originally Posted by jagabo View Post
    Just remux with a ~120000 ms audio delay. You can do it with MMG (part of MkvToolNix) if you can live with an MKV file.
    At least that part (MKV) works very well with ffmpeg:

    Code:
    ffmpeg -i invideo.mp4 -itsoffset 00:00:02.000 -i inaudio.aac -codec:v copy -codec:a copy out.mkv
    The -itsoffset option must appear before the input being delayed, the audio in this case.
    Yes. And every player I tried handled it properly.

    I would first apply the estimated 2 minute (or whatever you've estimated it to be) offset, then watch the result to more accurately determine the exact offset. Many media players have ability to shift the sound during playback -- that will help you out. Then go back and remux with the newly calculated offset. Fine tune again if necessary.
    Quote Quote  
  13. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Here's how to delay audio by 2s in the MP4 container. It involves re-encoding audio:
    Code:
    ffmpeg -i invideo.mp4 -i inaudio.aac -codec:v copy -codec:a libvo_aacenc -af aresample=resampler=swr:first_pts=96000 out.mp4
    The number following 'first_pts=' is the number of samples to delay by, 2s x 48000 s/s = 96000 samples in this example.

    From the ffmpeg mailing list there is a way of pre/appending audio without re-encoding, but for the faint-at-heart it's even more daunting than any of the options suggested to date! For completeness' sake:

    To generate silence with ffmpeg, use the aevalsrc audio filter

    http://ffmpeg.org/ffmpeg-all.html#aevalsrc

    Then, you can use either the concat demuxer (for which you'll have to generate the sound separately, ad then prepend it to your existing audio in two distinct commands) or the concat filter (requires re-encoding, but will allow you to work with a single ffmpeg command).

    ffmpeg -filter_complex 'aevalsrc=0:d=2' silence.aac ffmpeg -f concat -i <(for f in silence.aac audio.aac; do echo file "'$f'"; done) -c copy out-audio.aac

    OR:

    ffmpeg -i audio.aac -filter_complex
    'aevalsrc=0:d=2[slug];[slug][0]concat=n=2:v=0:a=1[out]' -map '[out]'
    -c:a libfdk_aac -vbr 3 out-audio.aac

    (change depending on the AAC encoder you have)

    http://ffmpeg.org/trac/ffmpeg/wiki/How to concatenate (join, merge) media files
    The command line examples seem intended for Linux/Unix.
    Quote Quote  
  14. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Originally Posted by fvisagie View Post
    Here's how to delay audio by 2s in the MP4 container. It involves re-encoding audio:
    Code:
    ffmpeg -i invideo.mp4 -i inaudio.aac -codec:v copy -codec:a libvo_aacenc -af aresample=resampler=swr:first_pts=96000 out.mp4
    The number following 'first_pts=' is the number of samples to delay by, 2s x 48000 s/s = 96000 samples in this example.
    However, from ffmpeg-resampler.html:
    Code:
    ‘flags, swr_flags’
        Set flags used by the converter. Default value is 0. 
             It supports the following individual flags: 
             ‘res’
                     force resampling, this flag forces resampling to be used even when the input and output sample rates match.
    Therefore I take it that when 1) input and output sample rates match (or remain unchanged as in this example), and 2) the 'res' flag is NOT specified, commands like the one above simply repack input samples into the output unchanged (= "not re-encoded") except for the modified timestamps.

    Perhaps someone handy with audio metrics can confirm this for us?
    Quote Quote  
  15. Member Sartori's Avatar
    Join Date
    Nov 2002
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by smrpix View Post
    Download a free trial of a basic NLE like Vegas movie studio. Add in your clips and line them up on the timeline. Nudge them back and forth for frame accuracy.. If you can do it in less than 30 days it won't cost you anything.

    MP4 and AAC are very, very common these days.
    +1 for above , as fun as command line editing is & unarguably powerful , jesu on a bike its time consumingly making hard work of it (unless you do it all the time) . The advantage of the trial version method is that you`ll see (and can measure and modify) any additional stretch of the audio over the length of the audio . The methods above won`t modify any stretch .

    Personally , I`d import it into a NLE , move the audio (as smrpix) suggests to align audio/video , get two datum points - one at the start and one right at the end , measure the exact offset required at the start , scrub to the end of the video and ensure the audio is still aligned * and then import the audio into an audio editor , add the offset time and save as aac (but that is my workflow which I`m very used to now) .

    * If the audio is out at the end of the video , you work out the time difference (by moving the audio again) , select the waveform between the 2 datum points and shrink or stretch by that difference , add the 2minutes(ish) and then save as aac . Then remux .

    I`ve redubbed 3 music concerts this way and countless old music videos with mono sounds from the ealry 80s .
    Your 2 minutes is only approximate , a few tenths of a second shows as out of sync , if you use the methods above to determine the exact offset , you`ll be there a good while longer .

    If you are very conversant with command line as methods noted above , then use that method .
    Llamas are for life , not just for christmas
    Quote Quote  
  16. Member hech54's Avatar
    Join Date
    Jul 2001
    Location
    Yank in Europe
    Search PM
    I don't even know how you could go about creating a video file with audio 2 minutes shorter that the video.
    Quote Quote  
  17. Member Sartori's Avatar
    Join Date
    Nov 2002
    Location
    United Kingdom
    Search Comp PM
    You don`t touch the video , you just add silence of (in this case) 2 minutesish of silence to the front of the audio and then remux it to the original video . The audio won`t be shorter then , it`ll just be 2 minutes of silence - you can recreate the effect by shooting a home video and every just mimes for the first 2 minutes .
    Llamas are for life , not just for christmas
    Quote Quote  



Similar Threads

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