View Full Version : how to merge sound with video?
jestem
1st June 2006, 12:26
Hello,
I have such a script:
--
video=SegmentedAVISource("vid.avi")
audio=WavSource("audio.wav")
AudioDub(video, audio)
ConvertToYV12()
--
But the sound is longer then video. How can I trim the sound to make the whole clip as long as vid.avi?
Tripx
1st June 2006, 14:51
How much longer? Are there sync problems between the audio and video?
jestem
1st June 2006, 16:23
It is not a sync problem...
vid.avi=vid.01.avi+vid.02.avi+vid.03.avi=29 seconds
audio.wav=49 seconds
The whole avs clip runs for 49 seconds (max length(sound,video), but I want it to run for 29 seconds (min length(sound,video), because after that 29 seconds the sound still plays, but I have only black screen.
I hope you understand now.
ind out how many frames "vid.avi" has in virtual dub information.
video=SegmentedAVISource("vid.avi")
audio=WavSource("audio.wav")
AudioDub(video, audio)
ConvertToYV12()
trim(0,frames-1)
stickboy
2nd June 2006, 07:31
You don't need to use VirtualDub to get the framecount; there's a FrameCount() function.
actionman133
2nd June 2006, 17:05
This will do it for you...
video=SegmentedAVISource("vid.avi")
audio=WavSource("audio.wav")
AudioDub(video, audio)
ConvertToYV12()
Trim (0, 0) # second zero implies 'last video frame'
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.