BitmapData.draw fails to capture webcam

I am trying take a snapshot from a webcam. I'm using
BitmapData.draw(video). This works fine on my desktop but when I
try to do it in the browser it fails. Apparently this is some kind
of security restriction. Is there a way to get around it?

Hello jspoon27,
I am working on a locally run flash application that is very
similar to your post about wanting to save a snapshot of a local
webcam. Could you share your code for doing that or explain your
steps? I would like to have a webcam running then take a snapshot
of the webcam with a button and then email the saved snapshot. My
main interest is how you created the snapshot and button for it.
Thank you,
LeverLock2

Similar Messages

  • BitmapData.draw failed on WebcamSubscriber

    Most of the times when I try to snap data from WebcamSubscriber movieclip I get the following error.
    SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: mypath.swf cannot access rtmfp://fms7.acrobat.com/cocomo/na2-sdk-bec0edb4-775b-4f16-94f7-cd43ec89ff10/test. No policy files granted access.
    in some (very few) cases it works, and I can feagure out what are the conditions require for it to work.
    Few weeks ago it was working consistently.
    Will appreciate any help.
    Best regards,
    Gadi Srebnik

    Great, bitmapdata.draw works good !
    however, it didnt happened when I removed the protocol decleration on my previous room/application. When I tried that it tried to connect to fms8 and only when I started a new application/room and removed the protocol declaration it changed to fms4 and it works fine now.
    Does it have anything to do with the specific server node?
    how can I be sure that user connection will allways run on the server that will enable this feature?
    btw, the subscribe from dev panel also work now all the time
    Best Regards,
    Gadi Srebnik

  • BitmapData.draw() failing to draw entire MovieClip

    Hi, all;
    I'm trying to do some lean blitting for an object that rotates by rotating it once at startup and capturing a BitmapData snapshot of each 5 degrees.  The problem I'm having is that the draw() method of the BitmapData object is only picking up pixels in the MovieClip that are below and to the right of the registration point.  If I change the MC so that the registration point is in the top left corner, I sometimes get what looks like most of the pixels, but the entire object rotates into and out of the frame, since it's rotating around the corner and not the center.
    Has anyone encountered this before, and if so is there a fix?
    Thanks;
    Amy Blankenship
    flexdiary.blogspot.com

    I think you're misunderstanding the question.  I am using a matrix to transform it, and that lower right quadrant of the MovieClip rotates perfectly as inended, but the rest of the object isn't captured as if it weren't there.
    Here's the code:
    package com.magnoliamultimedia.datastructures
    import flash.display.BitmapData;
    import flash.display.IBitmapDrawable;
    import com.magnoliamultimedia.datastructures.IChain;
    import com.magnoliamultimedia.datastructures.IChainable;
    import flash.geom.Matrix;
    import flash.geom.Rectangle;
      * RotationChain takes an IBitmapDrawable and rotates
      * it through 360 degrees, creating a BitmapDataLink
      * for each incremental rotation
      * @author Amy Blankenship
    public class RotationChain implements IChain
      //private storage for the chain entry point
      private var _defaultNode:IChainable;
       * Constructor
       * @param rotatingObj object to rotate
       * @param degrees number of degrees to rotate (must divide evenly into 360)
      public function RotationChain(rotatingObj:IBitmapDrawable, degrees:int=5, size:int=200)
       //first, check if degrees divides evenly into 360
       if (360 % degrees != 0) {
        throw new Error('Degrees must divide evenly into 360');
        //set to the default, so we still have a usable chain
        degrees = 5;
       var matrix:Matrix = new Matrix();
       var bd:BitmapData;
       var bdl:BitmapDataLink;
       var lastBDL:BitmapDataLink;
       var loops:int = 360 / degrees - 1;
       for (var i:int = 0; i < loops; i++) {
        /* Take "snapshot" of rotating obj with matrix applied.
         *  On the first loop, use the identity matrix.
        bd = new BitmapData(size, size);
        bd.draw(rotatingObj, matrix);
        bdl = new BitmapDataLink(bd);
        //check for any previous links that might have been added
        if (lastBDL == null) {
         //no? this is the default
         defaultNode = bdl;
        } else {
         //set up reciprocal arrangement with last node
         bdl.previous = lastBDL;
         lastBDL.next = bdl;
        //set this link as the last link
        lastBDL = bdl;
        //rotate next snapshot
        matrix.rotate(degrees);
       //connect the last link to the first link to make a circular chain
       lastBDL.next = defaultNode;
       defaultNode.previous = lastBDL;
      /* INTERFACE com.magnoliamultimedia.datastructures.IChain */
      public function get defaultNode():IChainable
       return _defaultNode;
      public function set defaultNode(value:IChainable):void
       _defaultNode = value;
    Is there anyone out there who does this kind of stuff?
    Thanks;
    Amy

  • BitmapData.draw() and embedded MovieClip

    I can't capture the content of an embedded MovieClip, the
    following code creates a Bitmap that shows only the results of the
    changes methods of Graphics, although the clip is correctly
    embedded. Have you tackled similar problems? Thanks.
    [Embed(source="aMovieClip.swf")]
    private static var AMovieClip:Class;
    var aMovieClip:MovieClip = new AMovieClip();
    aMovieClip.graphics.lineStyle(6, 0xff0000);
    aMovieClip.graphics.lineTo(100,100); //i don't need this, but
    this is the only things that you will see, a red line
    var bitmapData:BitmapData = new BitmapData(aMovieClip.width,
    aMovieClip.height,true, 0xFFFFFF);
    bitmapData.draw(aMovieClip);

    It seems that the functions that were failing were
    getBounds() and accessing the transform.concatenatedMatrix in the
    loaded swf in the process of preparing to draw the bitmap.

  • Getting Security Error when trying to use bitmapdata.draw method on youtube videos

    Hi All ,
    I am playing youtube videos in UIComponet of flex, but when I trying to capture the image using bitmapdata.draw() method it gives me an secutity error on server  , It works well locally in flex editor.
    Is any one knows how to resolve this bug??
    Thanks in advance
    sujit Rai

    Try nesting the clips and then adding the warp stabiliser to the nest.

  • BitmapData.draw() with crossdomain

    Hi,
    I am trying to capture an FLV Frame with the
    bitmapdata.draw() function.
    I works fine with same domain but don't with cross domain
    even with crossdomain.xml
    I got a Security SandBox Violation
    Here is the sample demo :
    http://www.raprace.nl/forums/MMBBSevotest/Snapshot1.html
    It should be considering the file
    http://loloviolo.com/crossdomain.xml
    Here is the source
    Thanks for your help.
    LoLoVioLo

    works for me using an flvplayer without a cross domain
    policy.

  • BitmapData.draw() and Security

    I am dynamically creating screen captures from flv files
    located in separate sub domains through the Bitmap Data Draw
    method. The problem is the illusion that flash calls security.
    "When you call the BitmapData.draw() method with progressive
    video as the source parameter, the caller of BitmapData.draw() must
    either be from the same sandbox as the FLV file, or the server of
    the FLV file must have a policy file that grants permission to the
    domain of the calling SWF file. You can request that the policy
    file be downloaded by setting the checkPolicyFile property of the
    NetStream object to true."
    Here is my first question. This seems to only apply to
    "progressive video". Is this yet another attempt to make us buy
    stream servers?
    And now my second question.
    Why is it that an end user can tap the flv files and draw
    freely as long as the embed object code references a cached version
    of the swf file but the remote swf file hosted on a separate sub
    domain in the same network needs to download a copy of the "policy
    file"?

    Could you try this - Open and swf, rightClick - Goto
    settings, then click Advanced. On the webPage click on "Global
    Security settings panel".
    If you don't find your local directory in there, add it and
    see if things work?
    If not, it would be good if you could post the chunk of code
    which is creating problems.

  • Using your own AMS, how can you use BitmapData.draw() on an RTMP stream with no security exception?

    We have an Adobe AIR app written in AS3 that can view live video streams from other parties.  That being said, when trying to call BitmapData.draw() on one of those remote video streams (technically we're calling ImageSnapshot.captureImage()), we're getting a 2123 error - a security sandbox exception.  I've seen a lot of people refer to a real simple configuration in the AMS that will allow this to work for RTMP streams, but they keep posting broken links, links to posts that only vaguely mention this configuration, etc.  The one thing I did find is something that I'm having trouble applying:
    http://help.adobe.com/en_US/FlashMediaServer/3.5_SS_ASD/WS5b3ccc516d4fbf351e63e3d11a11afc9 5e-7ec3.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7fcb
    Please don't just give me another link, unless it's to a quick, clear explanation.  How do you configure the AMS to allow people to capture screenshots from RTMP video streams?  For the above article, I've tried setting videoStreamAccess and audioStreamAccess both to "/", and even it didn't work.  We also need to be able to do this for P2P RTMFP streams, but that's really a different question.  Thanks.

    You will get a better luck if you post this question on media server forum:
    http://forums.adobe.com/community/adobe_media_server?view=discussions

  • Still cannot use BitmapData.draw from RTMP sources?

    I have been trying all different ways to capture RTMP streams from my local FMS3.5 server but no luck... then I read this:
    "For media loaded from RTMP sources, you cannot use the BitmapData.draw() and SoundMixer.computeSpectrum() methods to extract run-time graphics and sound data. "
    is this still true? If so, is there any way around this?
    Thx!

    You will get a better luck if you post this question on media server forum:
    http://forums.adobe.com/community/adobe_media_server?view=discussions

  • BitmapData.draw problem due to security

    As another thread has posted, there seems to be a problem for BitmapData.draw on the Stratus server.
    After connecting to the Stratus server, drawing any part of the UIComponents will be stopped by a security alert.
    Event after disconnecting to Stratus, the problem still exist.  The only time when BitmapData.draw worked is when
    the application just lunched and havn't connect to Stratus yet.
    I've found another thread in the LCCS forum discussing the same problem, and it seems that over there they found a solution.
    Just wondering of Stratus will apply the same fix or do we have to wait until the new edition of FMS to have this fixed.
    Thanks in advance
    The LCCS forum thread discussing this problem:
    http://forums.adobe.com/message/2803074#2803074

    Hi,
    If you haven't already, I suggest opening a ticket with customer support.
    Jennie

  • HTTP Streaming and BitmapData.draw

    Hi OSMF Experts,
    I've tried to duplicate segments of a Video with BitmapData.draw.
    It's working with RTMP (set videoSampleAccess server side).
    Progressive is also working (crossdomain.xml is ok).
    BitmapData.draw doesn't work with HTTP Streaming! (Using *.f4m). What's the way to get this working? Following Error is thrown:
    SecurityError: Error #2123: Verletzung der Sicherheits-Sandbox: BitmapData.draw: file:///C|/players/myVideoTestHTTP.swf kann nicht auf null zugreifen. Es haben keine Richtliniendateien Zugriff gewährt.
    I've used OSMF 2.0 for the Tests. And I've testet with the sample.mp4/manifest.f4m example.
    Thanks for your answers.
    Greets
    Martin

    Have you seen bug CSCdx31582- Macintosh wont play WMT from CE (ecdn). Guess this is similar to the issue that you have.

  • BitmapData.draw Security Sandbox and LocalTrusted not working?

    Hello there, wondering if anyone else is having the same
    problem -- I have a LocalTrusted security sandboxType -- and when i
    try to access a BitmapData.draw method on a progressive flv, i get
    the error message:
    SecurityError: Error #2135: Security sandbox violation:
    BitmapData.draw: file://file.swf may not access null. RTMP content
    cannot be accessed using this API.
    I've rechecked my sandbox type a zillion times, as well as
    tried putting allow="*" in the crossdomain policy file ....
    is this an error in my security settings -- or is
    bitmapdata.draw on video objects now "gone"?

    Could you try this - Open and swf, rightClick - Goto
    settings, then click Advanced. On the webPage click on "Global
    Security settings panel".
    If you don't find your local directory in there, add it and
    see if things work?
    If not, it would be good if you could post the chunk of code
    which is creating problems.

  • Security sandbox violation: BitmapData.draw

    Hello,
    I got this error:
    SecurityError: Error #2122: Security sandbox violation: BitmapData.draw: A policy file is required, but the checkPolicyFile flag was not set when this media was loaded. 
    when I try to draw a frame of a movie that is downloading from another server. Crossdomain.xml is set. Another Jpgs are correctly drawn but only a movie causes an error.
    I need to checkPolicyFile but where should I do this? I have no direct access  to Loader to set up LoaderContext(true) ...
    Thanks,
    Michal

    I too would love to know how we can pass in our own LoaderContext to set the security domain. I'm receiving the same error after snapshotting a loaded SWFElement bug/watermark.
    e.g.
    var bug:MediaElement = new SWFElement(new URLResource(url));
    var bugTrait:LoadTrait = bug.getTrait(MediaTraitType.LOAD) as LoadTrait;
    bugTrait.load();

  • BitmapData.draw Security error

    I am drawing to bitmap from MediaContainer:
    var mediaContainer:MediaContainer = new MediaContainer();
    bitmapData.draw(mediaContainer);
    This works, but when I switch video, an error occurs:
    SecurityError: Error #2123: Security sandbox violation: BitmapData.draw
    cannot access unknown URL. No policy files granted access.
    Any ideas?

    Here you go:
    http://flashboard.info/files/DrawTest.fxp
    It has both HTTP and RTMP ways.
    I've tried launching from http:// and file:// - both work fine for me.
    Links inside app are to our production servers.
    Regards!

  • LOCAL_WITH_NETWORK sandbox and SecurityError: Error #2121: BitmapData.draw

    We have an application we run in a localWithNetwork security sandbox.  This application loads many assets from an off-site web server.  In spite of a very permissive crossdomain.xml, swfs downloaded from site give a 2121 error when we convert them to bitmaps at runtime.
      <?xml version="1.0" ?>
      <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
      <cross-domain-policy>
        <allow-access-from domain="*" />
        <site-control permitted-cross-domain-policies="all"/>
      </cross-domain-policy>
    Now, I understand why this restriction with BitmapData.Draw exists in general, and from what I've read in other discussion threads the general solution is to allow less restrictive access via crossdomain.xml.  This is the most permissive I know how to make it, although the documentation on the subject is not the most concise.  Are there details I'm missing here?
    For the moment we're just running this as LOCAL_TRUSTED, but this requires folks to be setup with the debug plugin which is a maintenance problem.
    Thanks in advance for any guidance.
    jv

    Crossdomain isn’t used in localWithNetwork because there is no “domain” for the request.
    I didn’t think you needed a debug plugin for LOCAL_TRUSTED, I thought any trust file would work.  Did you try creating an AIR app instead?  It might have different security rules.

Maybe you are looking for

  • Event tags not recognized in 11

    I upgraded from 7 to 11. 11 recognized my people tags, but not my event tags. I have 9484 pictures without any event tags. What do I do now? Thanks

  • KF creation  - Non-cumulative value with NCUM value change - option

    What is the use above option in the KF creation? Thanks

  • Help: Issue on || and &&

    Hi I wanted user to key in 'y', or 'Y' or 'N or 'n' ; so if it is not either one of this characters it will prompt a error message. However this statement I was using happen to satisfy the requirement. if(choice.compareTo("y")!=0&&choice.compareTo("Y

  • What issues can i run into using HR_PSBUFFER_INITIALIZE

    Hi we are going to add FM "HR_PSBUFFER_INITIALIZE" with "HR_INFOTYPE_OPERATION", for improving the perofrmance...as this FM is buffering the data and doing some EXPORT to memory. The result of this is that after a few hundred calls to HR_INFOTYPE_OPE

  • Error in classification (class REQ_RELEASE class type 032)

    Hi Guys I have changed the release codes to 6 release strategys and maintained Charecterstics and moved them to Quality system. Now in Quality i can see those changes applied but when i click on Classification i can't open it and system is throwing a