Hello guest, if you like this forum, why don't you register? https://fanrestore.com/member.php?action=register (December 14, 2021) x


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Beginners Guide To Syncing Audio
#21
(2017-04-23, 11:27 PM)spoRv Wrote: OK, I should warn everyone: avisynth is a nightmare, for a beginner!!!

Said so, luckily this task is one of the easiest to make with it, so any absolute beginner, with a bit of patience, would be able (in theory) to put a soundtrack in sync with video; it's just a matter of "trim" commands, that's all... easy, huh? Wink

Example:

trackA is the main one, trackB is the one to put in sync

trackA video |01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|
trackA audio |01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|
trackB video |01|02|03|04|05|XX|XX|06|07|08|09|__|11|12|13|14|__|16|17|18|19|20|
trackB audio |01|02|03|04|05|XX|XX|06|07|08|09|__|11|12|13|14|__|16|17|18|19|20|

XX are frames not present in the trackA, while __ are missing frames... so, you have to remove XX frames, and replace __ frames from trackA; when in sync, they will be as following

trackA video |01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|
trackA audio |01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|
trackB video |01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|
trackB audio |01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|

got the point?

I usually use this method, and going with Audacity when something more to the audio should be made.

I started looking at Avisynth last night. Interesting stuff!

I've now managed to load two movies side by side as a test.

So trims are clips you want to keep. I've been making trims to "trackB video" and adding the result and playing alongside the source "trackA video". Now the question is how do I keep track of which frame(s) to cut from the original source of trackB? Should I open the original in another virtualdub2 instance? Or is there a smarter math formula to use?

For videos, I converting them to .d2v and using mpeg2source to load them. Whats the best way to load audio and have them playback in virtualdub?

And once I've got the video in sync, how do I apply those cuts to the audio?
Reply
Thanks given by:
#22
(2020-09-11, 10:48 AM)NeonBible Wrote: Now the question is how do I keep track of which frame(s) to cut from the original source of trackB?

Use ShowFrameNumber(scroll=true), for example:

Code:
Mpeg2Source("whatever.d2v")
ShowFrameNumber(scroll=true)

Now, the frame-numbers that you see printed on the video in VirtualDub2 will be locked to the original frames and won't change as a result of any edits that you make.

(2020-09-11, 10:48 AM)NeonBible Wrote: Whats the best way to load audio and have them playback in virtualdub?

Use AudioDub().

Code:
video= Mpeg2Source("whatever.d2v")

audio=WavSource("whatever.wav")

dub=AudioDub(video,audio)

return dub

(2020-09-11, 10:48 AM)NeonBible Wrote: And once I've got the video in sync, how do I apply those cuts to the audio?

After you've called AudioDub(), any cuts that you make to the video will be made to the audio.  So, for the example that I gave above, apply Trim() to dub rather than video, for example:

Code:
Trim(dub,1000,0)

Bear in mind that simply cutting out frames might sound jarring, so you might want to smooth the transition with Dissolve(), FadeIn0(), FadeOut0(), and so on.
Reply
Thanks given by: NeonBible
#23
That has done the trick. Thank you Chewie!

The track I'm trying to sync has missing frames at the end of every scene change. This is going to be fun Sad

The problem I have now is dialogue which is being spoken between scene changes where those extra frames are occurring. As you say sounds jarring. Not sure Dissolve and Fades will help but will give it a go. I guess I can cut it x frames later to let the dialogue finish first, which means visually there will be jump. But ultimately I only care about the audio.
Reply
Thanks given by:
#24
(2020-09-11, 09:03 PM)NeonBible Wrote: I guess I can cut it x frames later to let the dialogue finish first, which means visually there will be jump.

Yes, you can choose to make an edit after the dialog, crossfading a section of the track back on itself. As you say, visual oddities in the track that you are editing don't matter, because only audio is rendered. It does sound as if you are having to make quite a high number of edits though. Usually, I have to make edits at reel-changes, and here and there at points in between.
Reply
Thanks given by:
#25
(2020-09-11, 11:05 PM)Chewtobacca Wrote: It does sound as if you are having to make quite a high number of edits though.  Usually, I have to make edits at reel-changes, and here and there at points in between.

Yep! That's the most usual case for me too, but this is by far the most insane syncing job I have ever had to tackle. I am trying to sync the audio from a VCD to match a DVD.

I am absolutely loving Avisynth. I started this project last year by comparing waveforms in Audacity, and I got to about 40% through and felt totally burnt out. I managed to get 10mins done yesterday in Avisynth and the results are really great so far. But its already around 120 edits!

Its also a lot nicer to do everything with the keyboard instead of wrangling Audacity with the mouse.
Reply
Thanks given by:
#26
~120 edits for 10mins is indeed insane. I hope that there's no underlying frame-rate issue. Did you have any problems with IVTC?
Reply
Thanks given by:
#27
Both the VCD and DVD are 25fps progressive. Is there something I needed to have done beforehand?
Reply
Thanks given by:
#28
No. I just guessed that at least one of your sources would be NTSC. Smile
Reply
Thanks given by:
#29
(2017-04-25, 12:50 PM)zoidberg Wrote: The important thing to remember when using video reference for syncing is to use 'frame accurate' codecs/source filters. Low-res lossless AVIs are good. Otherwise you run the risk of losing sync as you scrub back and forth on the timeline.
Is reaper still the best program for bit-perfect editing (ie avoiding resampling)?

What source filter / container format would you lot suggest using for H.264 (Blu-ray) content? I've tried a few things but it seems like FFVideoSource / FFMPEGSource2 isn't exactly bulletproof when it comes to frame accuracy so I kinda don't trust it. I've had it go awry a few times so I've shut AvsPmod and deleted the index file then made it re-index again, which gets old fast. For LD caps I'm using AVISource and for DVD MPEG2Source with the indexed d2v file, but that doesn't make much difference if the thing I'm syncing to is coming through FFMPEGSource2 and is inaccurate. I can of course transcode to AVI or similar but then again I don't know whether *that* would be frame-accurate either.
Reply
Thanks given by:
#30
(2020-10-08, 08:32 PM)pipefan413 Wrote: What source filter / container format would you lot suggest using for H.264 (Blu-ray) content? I've tried a few things but it seems like FFVideoSource / FFMPEGSource2 isn't exactly bulletproof when it comes to frame accuracy so I kinda don't trust it.

Trick is to NEVER use .ts and .m2ts files - somehow they do not load properly... so, remux them to .mkv before!
Reply
Thanks given by: pipefan413


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Help] How to apply delay to a whole video file, not just the video or audio streams? Red41804 7 2,142 2024-02-12, 11:03 AM
Last Post: Hitcher
Music [Help] Detect whether 2.0 Audio is Dual Mono or Stereo GjRedo 2 1,248 2023-12-09, 08:35 PM
Last Post: Doctor M
Question [Help] Slow down or speed up Audio for projects bendermac 18 7,149 2023-08-25, 01:59 AM
Last Post: Falcon
  [Help] 2 VHS Audio Captures to remove faults. CSchmidlapp 16 11,284 2023-07-03, 12:15 AM
Last Post: wongfeihung
  [Help] Identify and Repair an Audio Artifact axeyou 2 1,379 2023-06-14, 08:59 AM
Last Post: axeyou
  Beginners Guide to Colour Grading alexpeden2000 26 9,629 2023-02-24, 10:54 AM
Last Post: alexpeden2000
  [Help] Automatically Sync The Audio From Another Source? Endocryne 1 1,762 2022-10-09, 09:47 AM
Last Post: Serums
  Working concept syncing different audio sources SIUse 20 9,681 2022-06-23, 05:08 PM
Last Post: alleycat
  [Help] Audio Delay - What does what bendermac 1 1,632 2021-12-10, 12:37 PM
Last Post: resolution
  Need help choosing audio mixing software. Doctor M 5 3,219 2021-07-19, 03:51 AM
Last Post: Doctor M

Forum Jump:


Users browsing this thread: 11 Guest(s)