Log in

View Full Version : Convert all input to same # of audio channels


Starduster
22nd September 2010, 16:29
I'm merging a number of audio/video clips with AVIsynth and ran into an error:

Splice: the number of audio channels doesn't match

I don't really care how many channels so I'd like to know how to make them all the same. I'm using the following code:

vd = DirectShowSource("2.flv", fps = 15, convertfps = True)
fv = SWFSource("slide2.swf").flipVertical.AssumeFPS(vd).Loop.Trim(0,vd.FrameCount)
sld2 = AudioDub(fv,vd)
sld2 = sld2.ConvertToRGB32().Spline36Resize(640,480)

sld4 = DirectShowSource("4.wmv", fps = 15, convertfps = True)
sld4 = sld4.ConvertToRGB32().Spline36Resize(640, 480).SSRC(8000, fast = True)
sld2 ++ sld4

The example is only using 2 sources, but in reality there will be more. How do I make each sldx the same number of channels?

Starduster
22nd September 2010, 16:37
Sorry... I went back to look at what I'd done and realized that if you play the .avs from the above example it plays fine. What I didn't include in the above is that I'm converting the .avs to .mp4 with ffmpeg using the following statement:

ffmpeg -i 0.avs -acodec libfaac -ac 2 -vcodec mpeg4 -r 15 -s 640x480 -b 256kb -ab 96kb -ar 8000 -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 0.mp4

So, I guess the real question is, do I do something different in the .avs or is there something I need to add to the ffmpeg command?