PDA

View Full Version : AssumeFPS() , rounding bug...


esby
7th March 2003, 13:09
Well i just tried something like that:


#'missing function in avs 2.5'
function isYv12(clip) {
return !(clip.isRGB() || clip.isYuY2()) #edited ; replaced && by ||
}
#AutoColorSpace Function
function convertToColorSpace(clip1,clip2) {
clip1 = (clip2.isRGB32() && !clip1.isRGB32()) ? clip1.convertToRGB32(): clip1
clip1 = (clip2.isRGB24() && !clip1.isRGB24()) ? clip1.convertToRGB24(): clip1
clip1 = (clip2.isYUY2() && !clip1.isYUY2()) ? clip1.convertToYuy2(): clip1
clip1 = (clip2.isYV12() && !clip1.isYV12()) ? clip1.convertToYv12(): clip1
return clip1
}

#for replacing a specifical frame with a bmp
function ReplaceFrameFromBmp(clip,pos,bmpSrc) {
return clip.trim(0,pos) \ #.assumeFPS(clip.Framerate())
+ ImageSequence(bmpSrc,0,0,24).assumeFPS(clip.Framerate()).convertToColorSpace(clip) \
+ clip.trim(pos+2,0) #.assumeFPS(clip.Framerate())

}



The main problem is the following;
Without assumeFPS(clip.Framerate())the splice fails, saying the video are not compatibles...
If i add clip.assumeFPS(clip.Framerate()), it works :angry:

This means there is a bug somewhere in avs rounding the fps.

But i'm wondering if we could not have a spliceCompatibility parameter too:

Having it set to 0 will mean strict compatibility (actual settings)

Having it set to 1 will mean extended compatibility, meaning the fps will be given by the first clip, and we could do clip = clip.AssumeFps(24) + clip2 where clip2 could be 23.99 etc.

And maybe having it set to 2 for the future possibility of assembling clip of different fps...

esby

esby
7th March 2003, 15:28
I found another bug...

src = mpeg2source("....vob.d2v") # vob is ntsc anime , 29.97 fps
# src is now in yv12 state
src2 = src.convertTORGB24() # src2 is now rgb24
src2 = src2.convertToyv12() # src2 back to yv12
src = src + src2 # src is yv12 , src2 is yv12 too, but there are not compatible --

of course src = src return a working clip
and src = src2 do the same...

I don't know if the framerate bug i found was really a framerate bug,
i'm going to check if it was not this last bug...

esby

esby
7th March 2003, 17:21
apparently all bugs gone with the last build ^^

esby

sh0dan
7th March 2003, 17:48
I was just about to ask :)