Posts: 645
Threads: 75
Joined: 2015 Feb
Thanks: 1143
Given 406 thank(s) in 227 post(s)
Country:
(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?
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?
Posts: 1,554
Threads: 60
Joined: 2015 Jan
Thanks: 229
Given 627 thank(s) in 372 post(s)
Country:
(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:
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.
Posts: 645
Threads: 75
Joined: 2015 Feb
Thanks: 1143
Given 406 thank(s) in 227 post(s)
Country:
2020-09-11, 09:03 PM
(This post was last modified: 2020-09-11, 09:11 PM by NeonBible.)
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
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.
Posts: 1,554
Threads: 60
Joined: 2015 Jan
Thanks: 229
Given 627 thank(s) in 372 post(s)
Country:
(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.
Posts: 645
Threads: 75
Joined: 2015 Feb
Thanks: 1143
Given 406 thank(s) in 227 post(s)
Country:
(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.
Posts: 1,554
Threads: 60
Joined: 2015 Jan
Thanks: 229
Given 627 thank(s) in 372 post(s)
Country:
~120 edits for 10mins is indeed insane. I hope that there's no underlying frame-rate issue. Did you have any problems with IVTC?
Posts: 645
Threads: 75
Joined: 2015 Feb
Thanks: 1143
Given 406 thank(s) in 227 post(s)
Country:
Both the VCD and DVD are 25fps progressive. Is there something I needed to have done beforehand?
Posts: 1,554
Threads: 60
Joined: 2015 Jan
Thanks: 229
Given 627 thank(s) in 372 post(s)
Country:
No. I just guessed that at least one of your sources would be NTSC.
Posts: 1,225
Threads: 51
Joined: 2019 Oct
Thanks: 943
Given 654 thank(s) in 384 post(s)
Country:
2020-10-08, 08:32 PM
(This post was last modified: 2020-10-08, 08:34 PM by pipefan413.)
(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.
Posts: 7,153
Threads: 601
Joined: 2015 Jan
Thanks: 1081
Given 1466 thank(s) in 963 post(s)
Country:
(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!
|