Log in

View Full Version : Join two clips with different aspect ratio


stormy1777
22nd March 2004, 08:20
I have join.avs:


LoadPlugin("C:\mpeg2dec3.dll")

src1 = mpeg2source("c:\test43.d2v")

src2 = mpeg2source("c:\test169.d2v")

src1 + src2


but when I play it I get an error message on the player:

Splice: Video framerate doesn't match...

any idea how I can combine any two clips?? best would be without any extra thought process, i.e. something that always works...

thanks.

stickboy
22nd March 2004, 08:36
Your thread title talks about aspect ratios, but your message talks about frame-rates...

To splice two clips together, the two clips must have identical video properties (frame-rates, frame dimensions, colorspaces, ...) and audio properties (audio sampling rates, bits per sample, number of audio channels, ...)
any idea how I can combine any two clips?? best would be without any extra thought process, i.e. something that always works...Unfortunately, it's dependent on the situation and what you want to do. You need to provide more details. What are the frame-rates of the two clips? What are the dimensions? What's the source material? What's do you ultimately plan to do with the output video?

For example, if the first clip is 23.976 fps and the second is 29.97 fps, you could telecine the first to match the frame rate of the second. Alternatively, if the second is originally from a film source, you could inverse telecine that.

stormy1777
22nd March 2004, 10:13
ok.. I get it.. a bit too complex for me I guess...

in my case I got a lot of clips I get from users.. they can be any size/frame rate.. I need to join two of them together and send it back in email or ftp.. maybe dating service.. not sure.. All I get is lots of 2 minute clips, from unknown sources, i.e. size, frame rate, codec.. I need to pass it through a black box.. and output is on AVI in any format I choose that combines these two inputs..

I think I'll just play it on the monitor and record with a camcorder :-)

thanks..

Mug Funky
22nd March 2004, 12:28
how about:

[code]
clip1 = avisource("c:\blah\clip1.avi").changefps(24).bicubicresize(320,240,0,.5).converttoyv12()
clip2 = avisource("c:\blah\clip2.avi").changefps(24).bicubicresize(320,240,0,.5).converttoyv12()
clip3 = avisource("c:\blah\clip3.avi").changefps(24).bicubicresize(320,240,0,.5).converttoyv12()
clip4 = avisource("c:\blah\clip4.avi").changefps(24).bicubicresize(320,240,0,.5).converttoyv12()

clip1+clip2+clip3+clip4

this should do the trick... of course you'll have jerky output if the framerates are all different, and there's still the problem of different audio channels, samplerates and bit depths, but there's things you can stick on the ends of the filterchains to handle that stuff.

sh0dan
22nd March 2004, 12:59
function unify(clip c) {
c
changefps(24)
bicubicresize(320,240,0,.5)
converttoyv12()
converttomono()
ssrc(44100)
normalize(0.98)
return last
}

Add this to the top of the script.

Use like this:
src1 = mpeg2source("c:\test43.d2v").unify()
src2 = mpeg2source("c:\test169.d2v").unify()

src1 ++ src2

stormy1777
22nd March 2004, 21:27
function unify(clip c) {
c
changefps(24)
bicubicresize(320,240,0,.5)
converttoyv12()
converttomono()
ssrc(44100)
normalize(0.98)
return last
}


I get: there is no function named ssrc when I run this.. It does the job on the video part, nice tricks.. quality is not of huge concern at first.. I guess this is just the audio part? I took it out and it seems to work for now.. but I guess with two different audio samples it would barf..

Richard Berg
22nd March 2004, 23:45
SSRC is the new sample rate converter. Try updating your Avisynth version.