Some advice on video frame grabbing

Chipp Walters chipp at chipp.com
Sat Jan 31 03:57:03 EST 2004


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"

(I assume it is not a palette, if it is, it might NOT work at all)

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.

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
>



More information about the use-livecode mailing list