Some advice on video frame grabbing
Doug Lerner
doug at webcrossing.com
Sat Jan 31 04:03:12 EST 2004
On 1/31/04 5:57 PM, "Chipp Walters" <chipp at chipp.com> wrote:
> Doug,
>
> I haven't used video frame grabbing, but I might suggest some things to
> look at:
>
> When you call:
> revVideoFrameImage userImageWidth, userImageHeight, "videoimagedata"
>
> you might want to include before it:
>
> set the defaultStack to "theStackWithTheVideo"
You mean the stack with the video grabber window in it?
>
> (I assume it is not a palette, if it is, it might NOT work at all)
It's not a palette.
>
> Also, see if you can do it all on the same stack as a test (just like
> the example). If it does work, then you can isolate your frontmost
> stack issues from there.
Well, as a test I can do that in the sample stack. It would be hard to do as
a test in my current app now considering how complicated it has gotten.
But weirdest of all - it worked one time! But I couldn't repeat it after
that.
Also, sometimes the revCloseVideoGrabber that I call when I close the video
grabber window (in closeStack) does not seem to get sent and I need to
invoke it manually.
Thanks,
doug
>
> hope you get it working,
> Chipp
>
>
>
> On Jan 31, 2004, at 2:38 AM, Doug Lerner wrote:
>
>> I have a question for you experts.
>>
>> I basically copied scripts from the sample video stack (where this
>> works
>> correctly), and most of it seems to be working in my stack. But when I
>> try
>> to grab a frame from the video grabber window it does not display in
>> the
>> target image after I use the "set imageData" command.
>>
>> Without boring you with all my code, this is the snippet that grabs the
>> frame and sets the imageData:
>>
>> put empty into videoimagedata
>>
>> put the width of image "userPortrait" of stack portraitName into
>> userImageWidth
>>
>> put the height of image "userPortrait" of stack portraitName into
>> userImageHeight
>>
>> revVideoFrameImage userImageWidth, userImageHeight, "videoimagedata"
>>
>> set the imageData of image "userPortrait" of stack portraitName to
>> videoimagedata
>>
>>
>> Seems vanilla enough, right? The only thing I am doing different from
>> the
>> sample scripts is that my target image happens to be in another stack.
>>
>> All the stacks/windows are open and everything has the correct height
>> and
>> width set.
>>
>> If I log userImageWidth, userImageHeight and the captured
>> videoimagedata,
>> there are what seem to be correct values in all of them. Well, the
>> height
>> and width anyway seem correct. I can't visually confirm that the value
>> of
>> videoimagedata is correct, but it is the correct size - userImageWidth
>> x
>> userImageHeight x 4.
>>
>> If I "put image userPortrait" there is what appears to be PNG data in
>> there.
>>
>> If I check the "number of characters of the imageData of image
>> userPortrait"
>> there is the correct 57,600 characters in there (the image is 120x120).
>>
>> And the paintCompression of image userPortrait is "png" in my stack
>> and also
>> in the sample stack.
>>
>> But:
>>
>> * No image is displayed (even though it is displayed in the video
>> grabber
>> window of course)
>>
>> * If I "put the imageData of image userPortrait" the value displayed
>> looks
>> empty in the message box - not even garbage characters.
>>
>> Any ideas?
>>
>> Thanks!
>>
>> doug
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list