PDA

View Full Version : Video formats don't match - help!


wayback
1st July 2009, 04:56
Here's the avs script:

a=ImageSource("Club209.bmp", end=240, fps = 29.97). fadeio(28)
d=directshowsource("e:\liveart\timelapse.avi")
a+d

VDubMod says video formats don't match.

a is a 640x480, 24-bit, bmp image.
d is a 640x480, 29.97, progressive Camstudio lossless codec avi file, with no audio.

So it looks like the frame rate and frame size are the same. Both a and d work fine when played alone.

Is this a colorspace problem? How would I fix it?

Nightshiver
1st July 2009, 05:10
lol, what are you talking about? You have an IMAGE, .bmp is an image, not a video file. How could you match a .bmp and an .avi?

Keiyakusha
1st July 2009, 05:19
Try this:
a=ImageSource("Club209.bmp", end=240, fps = 29.97).fadeio(28).ConvertToYV12()
d=DirectShowSource("e:\liveart\timelapse.avi")
a+d

EDIT: well i don't actually know wich colorspace Camstudio uses. Run this simple script:
directshowsource("e:\liveart\timelapse.avi").Info()
Look for colorspace info there and then use appropriate Convertto___() function in your main script

wayback
1st July 2009, 06:34
Thanks for the suggestions. It looks like this works:

a=ImageSource("Club209.bmp", end=240, fps = 29.97). fadeio(28). converttoRGB32
d=directshowsource("e:\liveart\timelapse.avi", fps=29.97)
a+d

ImageSource outputs RGB24, but the Camstudio codec outputs RGB32.

However, after making everything RGB32, I still got a framerate mismatch error. This was true even though both show 29.97 when played alone. Adding the framerate specifier to the video fixed it, and now everything works fine. My guess is there's something about Camstudio, or perhaps DirectshowSource, that mis-reports the framerate in some way, so you have to specify what it actually is.

Anyway, this method works really well to add titles or end credits to videos, with nice fade transitions.

Gavino
1st July 2009, 10:54
Most probably, the frame rate of your video is not exactly 29.97, but 30000/1001, the standard NTSC rate. To match an image to a video, the most reliable way is like this:

d=directshowsource("e:\liveart\timelapse.avi")
a=ImageSource("Club209.bmp", end=240, fps=Framerate(d), pixel_type="RGB32").fadeio(28)
a+d

As shown, you can also specify the RGB32 directly in the ImageSource rather than converting afterwards.

wayback
2nd July 2009, 05:23
Most probably, the frame rate of your video is not exactly 29.97, but 30000/1001, the standard NTSC rate. To match an image to a video, the most reliable way is like this:

d=directshowsource("e:\liveart\timelapse.avi")
a=ImageSource("Club209.bmp", end=240, fps=Framerate(d), pixel_type="RGB32").fadeio(28)
a+d

As shown, you can also specify the RGB32 directly in the ImageSource rather than converting afterwards.

Thanks. Using framerate(d) works fine. But specifying pixel_type that way doesn't work for me. I still get the video format mismatch. Even without using the fadeio. But converting it after does work. I don't know why pixel_type doesn't work. It should.