“Be inspired, enjoy your work, keep learning and never forget to play.” — gskinner

Taking a snapshot of an flv

Posted: December 3rd, 2007 | Author: Idoru | Filed under: Actionscript3, Bitmap, Tutorial, Video, WorkAround | 2 Comments »

Following my last post on 9-Slice items, here comes another nice one on Bitmap.draw() and the security sandbox.
Many people know the solution to this one, but i just found myself looking for it for too long, so here it goes :)

If you want to take a snapshot of a running Video object, you can't, you'll be alerted by the flash player that you are violating
the sandbox security. So how do we do it?
Easy as pie :)

video.attachNetStream( null );
bitmapData.draw( video );
video.attachNetStream ( myNetStreamObject );

Three very simple lines of code but that are hard to come by.


2 Comments on “Taking a snapshot of an flv”

  1. 1 Oleg Andreev said at 3:29 pm on December 7th, 2007:

    This RTMP protection trick does not work with 9,0,115,0 Moviestar anymore. Also, this prevents taking snapshot of the any http-streamed FLV (non-protected).

    Thus, RTMP content is not compatible with Papervision3D, for example. Bitter by Adobe.

    http://novemberain.com/2007/12/6/en-moviestar-security-arghh

  2. 2 Tip | Taking a snapshot of an flv « Flash Enabled Blog said at 2:19 pm on April 23rd, 2008:

    [...] Video I’ve seen this cool tip which let you create a snapshot preview of your flv at Dreaming In Flash. The following 3 simple lines of code, will enabled you to do [...]


Leave a Reply