Getting a framegrab of the video in a player

Paul Dupuis paul at researchware.com
Sat May 28 10:16:07 EDT 2016


On 5/28/2016 9:20 AM, Tim Selander wrote:
> Hi Paul,
>
> Thanks. That seems to work... putting it into a text fld results in
> the gibberish I'd expect from a jpeg in ascii form. Putting it into an
> image object shows the QT player frame and controls, but not the video
> frame itself...
>
> Exporting to a file, a la the dictionary, didn't seem to do anything.
> No error reported, but no file made either.
>
> Anyway, progress!
 
The following code works for me in LC6.7.11

    set the currentTime of player "mediaPlayer" to tFrameTime
    -- export it and set the cell frame to it
    put the rect of player "mediaPlayer" into tRect
    -- adjust rect if desired
    export snapshot from rect tRect of player "mediaPlayer" to tImage as PNG
    put tImage into img "filmStripImage"

-- Paul




More information about the Use-livecode mailing list