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
#'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