Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st June 2006, 12:26   #1  |  Link
jestem
Registered User
 
Join Date: Mar 2006
Posts: 7
how to merge sound with video?

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?
jestem is offline   Reply With Quote
Old 1st June 2006, 14:51   #2  |  Link
Tripx
Registered User
 
Join Date: Jul 2005
Posts: 13
How much longer? Are there sync problems between the audio and video?
Tripx is offline   Reply With Quote
Old 1st June 2006, 16:23   #3  |  Link
jestem
Registered User
 
Join Date: Mar 2006
Posts: 7
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.
jestem is offline   Reply With Quote
Old 1st June 2006, 16:48   #4  |  Link
drcl
Registered User
 
Join Date: May 2004
Posts: 163
ind out how many frames "vid.avi" has in virtual dub information.


Code:
video=SegmentedAVISource("vid.avi")
audio=WavSource("audio.wav")
AudioDub(video, audio)
ConvertToYV12()

trim(0,frames-1)

Last edited by drcl; 1st June 2006 at 16:56.
drcl is offline   Reply With Quote
Old 2nd June 2006, 07:31   #5  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
You don't need to use VirtualDub to get the framecount; there's a FrameCount() function.
stickboy is offline   Reply With Quote
Old 2nd June 2006, 17:05   #6  |  Link
actionman133
Movie buff & shine
 
Join Date: Jan 2004
Location: Logan, the only hole above ground.
Posts: 257
This will do it for you...

Code:
video=SegmentedAVISource("vid.avi")
audio=WavSource("audio.wav")
AudioDub(video, audio)
ConvertToYV12()

Trim (0, 0) # second zero implies 'last video frame'
__________________
I'm a boxer who can Bob () & Weave (). I like to Overlay () punches and Blur () his vision to ShowFiveVersions (). My KO punch will always Pulldown ().TimeStretch () and all he will hear is Tone ().
actionman133 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:15.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.