VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member
    Join Date
    Jan 2004
    Location
    Earth
    Search Comp PM
    Hi,

    I am trying to merge 3 wmv clips, neither the fps nor the samplerate are constant. So I made this script

    Code:
    v1=DirectShowSource("clip1.wmv", fps=30)
    v2=DirectShowSource("clip2.wmv", fps=30)
    v3=DirectShowSource("clip3.wmv", fps=30)
    source=v1+v2+v3
    
    return ResampleAudio(source, 44100)
    This code does not work, so can you guys show me the best approach to do that??

    Can I remove the "fps=30" from each line and do them all in 1 step?? For instance I want to do it like this "convertfps (source,30)"!!

    Also can I do the resizing in 1 step as well??

    regards,
    Quote Quote  
  2. Member
    Join Date
    Jan 2004
    Location
    Earth
    Search Comp PM
    I think I found the solution to my problem...not all of it though!

    OK

    Code:
    v1=DirectShowSource("clip1.wmv", fps=30) 
    v2=DirectShowSource("clip2.wmv", fps=30) 
    v3=DirectShowSource("clip3.wmv", fps=30) 
    
    source=ResampleAudio(v1,44100)+ResampleAudio(v2,44100)+\
    ResampleAudio(v3,44100)
    
    return source
    This is OK, and works as expected. But the problem I can not use ConvertFPS. I can not add extra line like this

    Code:
    source=ConvertFPS(v1,30)+ConvertFPS(v2,30)+ConvertFPS(v3,30)
    unless if I removed the ResampleAudio code! I know what is causing that, but I do not know if it is possible to do them together!!

    In order to use ResampleAudio or ConvertFPS, all the clips should be compatible. So If I used fps=30, I solved 1 problem and ResampleAudio will work. And if I used audio=false, I can use ConvertFPS since the only problem will be fixing the FPS!! I do not know if it is possible to do them together!!!
    Quote Quote  
  3. Member
    Join Date
    Jan 2004
    Location
    Earth
    Search Comp PM
    I think I sorted it out...

    I tried this

    Code:
    source=ResampleAudio(ConvertFPS(v1,30),44100)\
    +ResampleAudio(ConvertFPS(v2,30),44100)\
    +ResampleAudio(ConvertFPS(v3,30),44100)
    So My final code is like this

    Code:
    v1=DirectShowSource("clip1.wmv") 
    v2=DirectShowSource("clip2.wmv") 
    v3=DirectShowSource("clip3.wmv") 
    
    source=ResampleAudio(ConvertFPS(v1,30),44100)\
    +ResampleAudio(ConvertFPS(v2,30),44100)\
    +ResampleAudio(ConvertFPS(v3,30),44100)
    
    return source
    So if I wanted to resize also, it will be like this

    Code:
    ResampleAudio(ConvertFPS(Lanczos4Resize(v1,640,480),30),44100)
    This is a n00b way if you ask me!! Anyone knows if using subroutines will make it simpler??
    Quote Quote  
  4. Member
    Join Date
    Jan 2004
    Location
    Earth
    Search Comp PM
    Done!!

    Code:
    v1=DirectShowSource("clip1.wmv") 
    v2=DirectShowSource("clip2.wmv") 
    v3=DirectShowSource("clip3.wmv")
    
    source=FinalClip(v1)+FinalClip(v2)+FinalClip(v3)
    
    return source
    
    Function FinalClip(clip v) {
    	return(ResampleAudio(ConvertFPS(v,30),44100))
    }
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!