What I want to do is replace the audio in a certain scene with the audio from a previous point in the clip.
DirectshowSource("HD.wmv", FPS=29.97, ConvertFPS=True)+DirectShowSource("2HD.wmv", FPS=29.97, ConvertFPS=True)
Trim(43733,43799)+Trim(41992,42389)
Yes, I know that those trims are out of order. What I'd like to do is replace the audio in the first clip with the audio in the second, but still have the video play. I'm hoping there is something I can insert in between the trims.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 14 of 14
Thread
-
-
http://avisynth.nl/index.php/AudioDub
FWIW --- FMSS2 is preferable to DirectShowSource when you need to use Trim(), but
if you prefer DSS anyway, at least don't forget to call
http://avisynth.nl/index.php/EnsureVBRMP3Sync -
Using FFVideoSource means I won't have sound though right? And Audiodub means I would have to make a seperate audio file of the entire clip just to have any audio at all. That's the main reason why I use DirectShowSource.
I guess I'm stuck with audiodub then. Thank you for your help. -
You can use MixAudio() to mix the audio from t1 and t2, just specify 0 volume for the audio in t1.
Code:t1=Trim(...) t2=Trim(.) t1=MixAudio(t1,t2,0.0,1.0) # 0.0 parts t1 audio, 1.0 parts t2 audio t1+t2
Last edited by jagabo; 1st Apr 2014 at 21:00.
-
-
MixAudio works good too, thank you.
As for the FFAudioSource, every time I've tried to use that, it cancels out FFVideoSource, and just gives me audio. I cannot use both at the same time. -
Use named streams:
Code:aud=ffAudioSource("filename.ext") # audio first vid=ffVideoSource("filename.ext") # then video AudioDub(vid,aud) # join vid and audio together, if you need to
When you don't specify a name for a stream AviSynth will assume "last". So a sequence like
Code:ffAudioSource("filename.ext") ffVideoSource("filename.ext")
Code:last=ffAudioSource("filename.ext") last=ffVideoSource("filename.ext")
-
Alright, I've been pounding away on this and I almost have it:
AudioDub(FFVideoSource("HD.wmv", fpsnum = 30000, fpsden = 1001), FFAudioSource("HD.wmv"))Trim(0,41988)++AudioDub(FF VideoSource("2HD.wmv", fpsnum = 30000, fpsden = 1001) , FFAudioSource("HD.wmv"))Trim(707,773)
How exactly can I get this to combine? I tried combining the Audiodubs but it only plays that very last short trim, with the alternate audio I wanted.
As for that, I got the video trimmed fine, but the audio isn't synced up with the part I wanted in the first clip. Would I have to specify a trim for the audio as well? -
When using ffVideoSource() and ffAudioSource() on the same file you must call ffAudioSource() first, or you must build an index first.
I'm pretty sure you script will leave you with only 67 frames from HD.WMV. If your intent was to concatenate frames 707-773 of 2HD.WMV onto frames 0-41988 of HD.WMV you should add a . (pipe) between the AudioDub() and Trim() functions. Otherwise that final trim will apply to the joined videos, not only the last video.
As written you script means
Code:AudioDub() Trim() ++ AudioDub() # trim the results of AudioDub1 and add AudioDub2 Trim() # trim the entire joined clip
Code:AudioDub().Trim()++AudioDub().Trim()
-
Ah, okay I fixed that.
AudioDub(FFAudioSource("HD.wmv"), FFVideoSource("HD.wmv", fpsnum = 30000, fpsden = 1001))
#Trim(0,41988)++AudioDub(FFAudioSource("HD.wmv"), FFVideoSource("2HD.wmv", fpsnum = 30000, fpsden = 1001)).Trim(707,773)
Yes, I understand i have only 67 frames or so in that second trim from 2HD.
I was hoping to trim down the audio from HD.wmv so it matches up.
(707,773) is the video trim. However the audio trim from HD2 takes place (41992,42500). I'll trim it down of course. I hope it's possible to place that trim somewhere so it maches up. -
I have no idea what you are trying to do at this point. Your latest script does nothing more than loads all the audio and video from HD.WMV. Maybe you should restate exactly what you are trying to do in plain english.
-
It loads the video from HD.wmv and then goes into 2HD, but plays 2 seconds of the audio from the first clip. However,I want that audio to not be synced up with the trimmed video. I want a completely different section of audio to play. Right now I'm assuming this isn't exactly possible to do, so maybe it's best I should make a wav file and sync it up that way.
-
You need to make two trims of the second video. One with the video you want, the other with the audio you want. Then use MixAudio() to mix the audio of those two trims (0 weighting on one, 1 weighting on the other). Finally, add that the the trim from the first clip. Something like:
Code:hd1=AudioDub(FFmpegSource2"HD.wmv", atrack=2, fpsnum=30000, fpsden=1001) # audio and video from HD.WMV hd2=AudioDub(FFmpegSource2"HD2.wmv", atrack=2, fpsnum=30000, fpsden=1001) # audio and video from HD2.WMV t1=hd2.Trim(707,773) # the video you want from hd2 t2=hd1.Trim(41992,42058) the extra audio you want from hd1 (same length as t1) hd1.Trim(0,41988)++MixAudio(t1, t2, 0, 1)
Last edited by jagabo; 8th Apr 2014 at 15:48.
Similar Threads
-
Directshowsource of Avisynth 2.6 lost first 50 frame for a MP4 file.
By trasit in forum EditingReplies: 2Last Post: 11th Mar 2014, 21:50 -
MadVR's smooth motion in Avisynth for frame-rate conversions?
By Greathelp in forum Video ConversionReplies: 1Last Post: 9th Jun 2013, 11:38 -
avisynth denoise filter applied only from frame x to frame y
By codemaster in forum Video ConversionReplies: 1Last Post: 26th Apr 2012, 12:22 -
vcl file frame serve for avisynth
By norlane in forum Blu-ray RippingReplies: 2Last Post: 5th Feb 2011, 01:20 -
AviSynth smoothers - In proportion to frame size, or is it?
By Gew in forum Newbie / General discussionsReplies: 0Last Post: 22nd Jul 2009, 13:53