
Adding Compressed Music After Black Clip
- Kero777
- Joined: Sun May 06, 2007 9:37 am
Adding Compressed Music After Black Clip
My music starts very suddenly in my video and I realized that I should put in two seconds of black before it begins. I know how to do that, but if I export my music separately from Vegas to re-compress it back to an MP3 to put into my video, how would I set up my Avisynth script so that VirtualDubMod knows that the music now shouldn't start until two seconds in? Is it even possible?
Thanks for reading!

Thanks to: Qyot27, Jaddziadax, BasharOfTheAges, Scintilla, Post-It, Anubisx00, Kariudo and everyone else for helping this Newby out! 
"Hard work is worthless for those that don't believe in themselves." -Naruto Uzumaki

"Hard work is worthless for those that don't believe in themselves." -Naruto Uzumaki
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
1) If you're muxing in already-encoded MP3 audio with VirtualDubMod, your AVISynth script should have no effect on the audio.
2) Here's one thing you can try:
When you're muxing the MP3 in with VirtualDubMod, go to the Streams list, right-click on the MP3 stream, and select "Interleaving...". Then, under "Audio skew correction", input the desired value for "Delay audio track by" (in milliseconds).
I've never tried this before myself, and I have no idea if it actually works, so what I personally would recommend to do is add the two seconds of silence to your audio file first, BEFORE you compress it to MP3 and mux it (any audio editing program can do this).
2) Here's one thing you can try:
When you're muxing the MP3 in with VirtualDubMod, go to the Streams list, right-click on the MP3 stream, and select "Interleaving...". Then, under "Audio skew correction", input the desired value for "Delay audio track by" (in milliseconds).
I've never tried this before myself, and I have no idea if it actually works, so what I personally would recommend to do is add the two seconds of silence to your audio file first, BEFORE you compress it to MP3 and mux it (any audio editing program can do this).
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
A third option would be to create a 2-second long silent MP3, then append the two together. MKVMerge will allow you to do this, then it's just a matter of extracting the audio stream back out with MKVExtract. The results may vary, though, and a click may end up being heard where the two come together. It is worth a shot, though.Scintilla wrote:1) If you're muxing in already-encoded MP3 audio with VirtualDubMod, your AVISynth script should have no effect on the audio.
2) Here's one thing you can try:
When you're muxing the MP3 in with VirtualDubMod, go to the Streams list, right-click on the MP3 stream, and select "Interleaving...". Then, under "Audio skew correction", input the desired value for "Delay audio track by" (in milliseconds).
I've never tried this before myself, and I have no idea if it actually works, so what I personally would recommend to do is add the two seconds of silence to your audio file first, BEFORE you compress it to MP3 and mux it (any audio editing program can do this).
- GloryQuestor
- Moderation Hero
- Joined: Tue Apr 13, 2004 4:59 pm
- Status: Always around, creating more AMVs. :)
Yet another option is that you can export your audio in the editor to WAV format, which will preserve the position of your music in relation to the video and also preserve the frame rate of the exported video.
Then, in VirtualDubMod, add it to the stream list, right-click on it and select Full Processing Mode. Then right-click on it again and select "Compression..." and choose Lame MP3. Then select your quality and bps, and your ready to go.
Then, in VirtualDubMod, add it to the stream list, right-click on it and select Full Processing Mode. Then right-click on it again and select "Compression..." and choose Lame MP3. Then select your quality and bps, and your ready to go.

Website Administrator, AnimeMusicVideos.Org
Samurai Warriors Productions
Pittsburgh Japanese Culture Society Events - AMV Department Head
Middle Tennessee Anime Convention - Main Events Operations Manager
Anime Weekend Atlanta - Section Manager of Programming - Video Art Track
Samurai Warriors Productions
Pittsburgh Japanese Culture Society Events - AMV Department Head
Middle Tennessee Anime Convention - Main Events Operations Manager
Anime Weekend Atlanta - Section Manager of Programming - Video Art Track
- Kero777
- Joined: Sun May 06, 2007 9:37 am
Thanks for all of the replies! There are many ways to do this, it seems. I chose Glory Questor's way, but I ran into a huge problem: The audio doesn't play in Winamp Or Windows Media Player. It does play in Windows Media Player CLASSIC and in VLC player though. Is there a reason for this? *Scratches head*
If there is a script I can use to add in audio with Avisynth, then I might be able to do it. Does anyone know how? I know I will get that yucky clicking noise otherwise.
I'm going to be playing around with this for a bit. Any more replies will help me out a lot. Thanks.
If there is a script I can use to add in audio with Avisynth, then I might be able to do it. Does anyone know how? I know I will get that yucky clicking noise otherwise.

Thanks to: Qyot27, Jaddziadax, BasharOfTheAges, Scintilla, Post-It, Anubisx00, Kariudo and everyone else for helping this Newby out! 
"Hard work is worthless for those that don't believe in themselves." -Naruto Uzumaki

"Hard work is worthless for those that don't believe in themselves." -Naruto Uzumaki
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
What bitrate did you choose? WMP tends to have problems with MP3s sometimes if the bitrate is at or over 224kbps. It might also be because you're encoding it through VDub and it isn't getting muxed in correctly. I always encode the audio stream in a standalone program like dBPowerAMP Music Converter*, oggdropXPd, or iTunes and then mux it in after the video is done encoding in XviD, H.264, or whatever (note: I'm not referring to doing H.264 in VDub - that's a no-no - but just muxing audio and video together after encoding the final).Kero777 wrote:Thanks for all of the replies! There are many ways to do this, it seems. I chose Glory Questor's way, but I ran into a huge problem: The audio doesn't play in Winamp Or Windows Media Player. It does play in Windows Media Player CLASSIC and in VLC player though. Is there a reason for this? *Scratches head*
If there is a script I can use to add in audio with Avisynth, then I might be able to do it. Does anyone know how? I know I will get that yucky clicking noise otherwise.I'm going to be playing around with this for a bit. Any more replies will help me out a lot. Thanks.
*Newer versions have crippled MP3 encoding support unless you purchase a license. I never upgraded. You can find other apps to do it that use LAME, though.
AviSynth can't mux compressed audio AFAIK, but it can join two pieces together with the corresponding video files. For example:
Code: Select all
video = BlankClip(60).BilinearResize(848,480)
audio = WAVSource("mute.wav")#.SSRC(48000,fast=false)
AudioDub(video,audio).AssumeFPS(29.97,sync_audio=true).SSRC(48000,fast=false)
A) the framerate of the main video is at 29.97
B) the target audio sample rate is 48kHz
C) the target video resolution is something other than 640x480 (which is BlankClip's default)
D) any resizing mode will do, since it's just a black screen. I chose Bilinear because it'll be the fastest without going down to a PointResize or something - not that I think that would affect anything either, but I'm just being cautious.
E) the script may throw an error saying the audio can't be resampled. The commented-out additional resampling on the audio line is to correct that if it happens. On a rare occasion you may have to raise that one's new sample rate to something non-standard like 50000 or something.
F) you need to create a silent, stereo file beforehand because apparently, BlankClip only generates mono audio, and there isn't a cut-and-dried solution like a DuplicateChannels plugin to convert from mono to stereo by just copying over the same signal into both left and right channels.
In the main video's script, you can use this to add in the audio:
Code: Select all
video = AVISource("whatever.avi")
audio = WAVSource("whatever.wav")
AudioDub(video,audio)
Finally, you can do the join operation:
Code: Select all
Import("blankclip.avs") ++ Import("mainvideo.avs")
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
Gah, I forgot to say that if that indeed happens, you'll need to delete the pound sign, since that keeps the additional resample operation from working.Qyot27 wrote:E) the script may throw an error saying the audio can't be resampled. The commented-out additional resampling on the audio line is to correct that if it happens. On a rare occasion you may have to raise that one's new sample rate to something non-standard like 50000 or something.
- Kero777
- Joined: Sun May 06, 2007 9:37 am
Wow, thanks Qyot27! I'm going to have to try that. I really appreciate all that information you gave me.Qyot27 wrote:Gah, I forgot to say that if that indeed happens, you'll need to delete the pound sign, since that keeps the additional resample operation from working.Qyot27 wrote:E) the script may throw an error saying the audio can't be resampled. The commented-out additional resampling on the audio line is to correct that if it happens. On a rare occasion you may have to raise that one's new sample rate to something non-standard like 50000 or something.

Thanks to: Qyot27, Jaddziadax, BasharOfTheAges, Scintilla, Post-It, Anubisx00, Kariudo and everyone else for helping this Newby out! 
"Hard work is worthless for those that don't believe in themselves." -Naruto Uzumaki

"Hard work is worthless for those that don't believe in themselves." -Naruto Uzumaki