wrybread
25th February 2011, 02:53
I'm trying to play 4 videos in a 2x2 grid. Everything works great, except that I lose audio syncing when I introduce more than 2 videos.
Here's my code for a 2 video grid, which works:
# load the clips
a = DirectShowSource("D:\AVISynth\000119.mov")
b = DirectShowSource("D:\AVISynth\000120.mov")
# convert to rgb32
a = a.ConvertToRGB32()
b = b.ConvertToRGB32()
# this version is a 2x1 stack, and audio sync works
stack = StackHorizontal(a, b)
# blend the audio
audio = MixAudio(a, b, 1, 1)
stack = AudioDub(stack, audio)
return stack
However, when I do a 2x2 grid, I lose audio sync. Here's my code for that:
# load the clips
a = DirectShowSource("D:\AVISynth\000119.mov")
b = DirectShowSource("D:\AVISynth\000120.mov")
c = DirectShowSource("D:\AVISynth\000121.mov")
d = DirectShowSource("D:\AVISynth\000122.mov")
# convert to rgb32
a = a.ConvertToRGB32()
b = b.ConvertToRGB32()
c = c.ConvertToRGB32()
d = d.ConvertToRGB32()
# resizing doesn't seem to help
#a = a.BilinearResize(320,240)
#b = b.BilinearResize(320,240)
#c = c.BilinearResize(320,240)
#d = d.BilinearResize(320,240)
# this version is a 2x2 stack, and audio syncing is lost
stack = StackVertical(StackHorizontal(a, b), StackHorizontal(c, d))
# blend the audio
audio = MixAudio(a, b, 1, 1)
stack = AudioDub(stack, audio)
return stack
If anyone wants to try with the actual videos, here they are:
http://sinkingsensation.com/dropbox/vids.zip
They're each 640x480, 60fps. I tried changing their FPS to 30 using ChangeFPS(30), but it didn't seem to make a difference.
I know shooting at 60fps is excessive, but that's how my camera (Canon T2i DSLR) shoots the video, and for this project I can't re-encode them.
Does anyone have any tips on how to improve the audio syncing? Maybe some more efficient way of stacking the videos? Or some other clever suggestion?
Thanks for any tips.
Here's my code for a 2 video grid, which works:
# load the clips
a = DirectShowSource("D:\AVISynth\000119.mov")
b = DirectShowSource("D:\AVISynth\000120.mov")
# convert to rgb32
a = a.ConvertToRGB32()
b = b.ConvertToRGB32()
# this version is a 2x1 stack, and audio sync works
stack = StackHorizontal(a, b)
# blend the audio
audio = MixAudio(a, b, 1, 1)
stack = AudioDub(stack, audio)
return stack
However, when I do a 2x2 grid, I lose audio sync. Here's my code for that:
# load the clips
a = DirectShowSource("D:\AVISynth\000119.mov")
b = DirectShowSource("D:\AVISynth\000120.mov")
c = DirectShowSource("D:\AVISynth\000121.mov")
d = DirectShowSource("D:\AVISynth\000122.mov")
# convert to rgb32
a = a.ConvertToRGB32()
b = b.ConvertToRGB32()
c = c.ConvertToRGB32()
d = d.ConvertToRGB32()
# resizing doesn't seem to help
#a = a.BilinearResize(320,240)
#b = b.BilinearResize(320,240)
#c = c.BilinearResize(320,240)
#d = d.BilinearResize(320,240)
# this version is a 2x2 stack, and audio syncing is lost
stack = StackVertical(StackHorizontal(a, b), StackHorizontal(c, d))
# blend the audio
audio = MixAudio(a, b, 1, 1)
stack = AudioDub(stack, audio)
return stack
If anyone wants to try with the actual videos, here they are:
http://sinkingsensation.com/dropbox/vids.zip
They're each 640x480, 60fps. I tried changing their FPS to 30 using ChangeFPS(30), but it didn't seem to make a difference.
I know shooting at 60fps is excessive, but that's how my camera (Canon T2i DSLR) shoots the video, and for this project I can't re-encode them.
Does anyone have any tips on how to improve the audio syncing? Maybe some more efficient way of stacking the videos? Or some other clever suggestion?
Thanks for any tips.