Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st July 2009, 03:56   #1  |  Link
wayback
Registered User
 
Join Date: Jun 2007
Posts: 21
Video formats don't match - help!

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?
wayback is offline   Reply With Quote
Old 1st July 2009, 04:10   #2  |  Link
Nightshiver
Quality Freak
 
Join Date: Jun 2007
Location: Area 52
Posts: 597
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?
Nightshiver is offline   Reply With Quote
Old 1st July 2009, 04:19   #3  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,578
Try this:
PHP Code:
a=ImageSource("Club209.bmp"end=240fps 29.97).fadeio(28).ConvertToYV12()
d=DirectShowSource("e:\liveart\timelapse.avi")
a+
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

Last edited by Keiyakusha; 1st July 2009 at 04:38.
Keiyakusha is offline   Reply With Quote
Old 1st July 2009, 05:34   #4  |  Link
wayback
Registered User
 
Join Date: Jun 2007
Posts: 21
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.
wayback is offline   Reply With Quote
Old 1st July 2009, 09:54   #5  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,412
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.
Gavino is offline   Reply With Quote
Old 2nd July 2009, 04:23   #6  |  Link
wayback
Registered User
 
Join Date: Jun 2007
Posts: 21
Quote:
Originally Posted by Gavino View Post
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.
wayback is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.