madhatter300871
21st October 2010, 13:09
Hi all
I have a very, very simple script that whilst processing video grabs evey 20th frame.
This script here works :-
-------------------------------------------------
cl=DirectShowSource("Z:\VM_shared\Outputs\testclip\Track 1-VC1 video.mkv")
Scriptclip(cl, "current_frame%20==0 ? Screengrab(cl) : cl")
function ScreenGrab(clip cl)
{
ImageWriter(cl, "D:\", Type = "ebmp")
}
--------------------------------------------------
.... and procudes 00000.ebmp (etc) files in the D drive every 20th frame ....
However, this does NOT work :-
-------------------------------------------------
cl=DirectShowSource("Z:\VM_shared\Outputs\testclip\Track 1-VC1 video.mkv")
Scriptclip(cl, "current_frame%20==0 ? Screengrab(cl) : cl")
function ScreenGrab(clip cl)
{
ImageWriter(cl.converttorgb(), "D:\", Type = "jpg")
}
--------------------------------------------------
.... I get the error "ScriptClip: Function does not return a video clip of the same colorspace as the source clip!"
I don't want ".ebmp" images, I want ".jpg" images.
If I then add "return cl" to the end of the function, no error is generated but also no image is written by imagewriter.
I can do what I want as follows :-
-----------------------------------------
video=DirectShowSource("Z:\VM_shared\Outputs\testclip\Track 1-VC1 video.mkv")
Image = ImageWriter(video.ConvertToRGB(), File = "D:\", Type = "jpg")
ConditionalFIlter(video, Image, video.ConvertToRGB(), "current_frame%50", "equals", "0")
------------------------------------------
...but it's soooo slow, my processing takes about a 40% speed hit because (I presume) i'm making an imagewriter for everyframe, just choosing whether to return the source frame or the imagewriter frame each time.
H E L P !!
How do I get my function to A) write an image using imagewriter and B) return a clip of the right colorspace back to the main script. I'm sure I am being very dumb and missing something here !
Many thanks in advance for any help offered.
I have a very, very simple script that whilst processing video grabs evey 20th frame.
This script here works :-
-------------------------------------------------
cl=DirectShowSource("Z:\VM_shared\Outputs\testclip\Track 1-VC1 video.mkv")
Scriptclip(cl, "current_frame%20==0 ? Screengrab(cl) : cl")
function ScreenGrab(clip cl)
{
ImageWriter(cl, "D:\", Type = "ebmp")
}
--------------------------------------------------
.... and procudes 00000.ebmp (etc) files in the D drive every 20th frame ....
However, this does NOT work :-
-------------------------------------------------
cl=DirectShowSource("Z:\VM_shared\Outputs\testclip\Track 1-VC1 video.mkv")
Scriptclip(cl, "current_frame%20==0 ? Screengrab(cl) : cl")
function ScreenGrab(clip cl)
{
ImageWriter(cl.converttorgb(), "D:\", Type = "jpg")
}
--------------------------------------------------
.... I get the error "ScriptClip: Function does not return a video clip of the same colorspace as the source clip!"
I don't want ".ebmp" images, I want ".jpg" images.
If I then add "return cl" to the end of the function, no error is generated but also no image is written by imagewriter.
I can do what I want as follows :-
-----------------------------------------
video=DirectShowSource("Z:\VM_shared\Outputs\testclip\Track 1-VC1 video.mkv")
Image = ImageWriter(video.ConvertToRGB(), File = "D:\", Type = "jpg")
ConditionalFIlter(video, Image, video.ConvertToRGB(), "current_frame%50", "equals", "0")
------------------------------------------
...but it's soooo slow, my processing takes about a 40% speed hit because (I presume) i'm making an imagewriter for everyframe, just choosing whether to return the source frame or the imagewriter frame each time.
H E L P !!
How do I get my function to A) write an image using imagewriter and B) return a clip of the right colorspace back to the main script. I'm sure I am being very dumb and missing something here !
Many thanks in advance for any help offered.