Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:57:32+00:00 2026-06-12T08:57:32+00:00

So this will be a bit of a doosy, maybe… I am trying to

  • 0

So this will be a bit of a doosy, maybe… I am trying to play a video clip in an Augmented Reality using the Flash plugin called FLARToolkit. I have a green screen video and i need to play the video on a plane. I am currently using a MovieClipMaterial to lay the video on the display plane. I want to itterate through the pixels in the display plane and change the pixels that match the green in the green screen and set those pixels to transparent, chroma keying. There may be a more efficient way of doing this and I am open to suggestions.

I have also looked into ColorMatrixFilters but I havent been able to devise a way to make it selective, rather than filtering out all the green in the clip.

Here is my code as it stands now:

[SWF(width='640', height='480', backgroundColor='#000000', frameRate='40')]

public class HelloFLAR extends Sprite
{
    private var fm:FLARManager;
    private var scene:Scene3D;
    private var view:Viewport3D;
    private var camera:FLARCamera3D;
    private var bre:BasicRenderEngine;
    private var lre:LazyRenderEngine;
    private var p:Plane;
    private var con:DisplayObject3D;
    private var marker:FLARMarker;
    private var v:Vid;
    private var mat:MovieMaterial
    private var bmd:BitmapData;
    private var videoStream:NetStream;
    private var container:FLARBaseNode;
    private var RGBRaster:FLARRgbRaster_BitmapData;

    public function HelloFLAR()
    {
        initFLAR();
        v = new Vid();
        //source for displayed video
        v.vid.source = "Reuters.m4v";
        v.vid.stop();

    }

    private function initFLAR():void
    {
        fm = new FLARManager("flarConfig.xml");
        fm.addEventListener(FLARMarkerEvent.MARKER_ADDED, onAdded);
        fm.addEventListener(FLARMarkerEvent.MARKER_REMOVED, onRemoved);
        fm.addEventListener(Event.INIT, init3D);
        addChild(Sprite(fm.flarSource));


    }

    private function onAdded(e:FLARMarkerEvent):void
    {
        marker = e.marker;
        p.visible = true;
        v.vid.play();
    }

    private function onRemoved(e:FLARMarkerEvent):void
    {
        marker = null;
        p.visible = false;
        v.vid.stop();
    }

    private function init3D(e:Event):void
    {
        scene = new Scene3D();
        camera = new FLARCamera3D(fm.cameraParams);
        camera.z = -30;
        view = new Viewport3D(640, 480, true);
        lre = new LazyRenderEngine(scene,camera,view);


        //Display plane and Videp material
        mat = new MovieMaterial(v, false, true);
        p = new Plane(mat, 320, 240, 2, 2);
        mat.doubleSided = true;
        p.rotationZ = 90;
        p.visible = true;


        //Green Leech from video plane (Attempt at chromakeying)
        var matrix:Array = new Array();         
        matrix = matrix.concat([1,0,0,0,0]); //Red
        matrix = matrix.concat([0,1,0,0,0]); //Green
        matrix = matrix.concat([0,0,1,0,0]); //Blue
        matrix = matrix.concat([0,-1,0,0,0]); //Alpha

        var color_filter:ColorMatrixFilter = new ColorMatrixFilter(matrix);;
        v.filters = [color_filter];

        //container for display Plane
        con = new DisplayObject3D();
        con.addChild(p);


        //Add plane container to scene
        scene.addChild(con);
        addChild(view);
        addChild(new FramerateDisplay());

        addEventListener(Event.ENTER_FRAME, loop);
        //addEventListener(Event.ENTER_FRAME, pixelCheck);

    }

    private function loop(e:Event):void
    {
        if(marker != null)
        {
            con.transform = FLARPVGeomUtils.convertFLARMatrixToPVMatrix(marker.transformMatrix);
        }
        lre.render();
    }

I can’t seem to get access to the pixels of the video. I have tried accessing the pixels through the plane and the MovieClipMaterial with no luck.

Any help would be greatly appreciated!

Adeptatus

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:57:34+00:00Added an answer on June 12, 2026 at 8:57 am

    Yes, you can do that;

    1. create transparent background video
      to create the transparent background video, using green screen background footage, remove the green background on Adobe Afters Effects or Premiere or Final Cut or..
      in export or render settings change to RGB + Alpha, and then export out

    2. in your code;

      mat = new MovieMaterial(v, false, true);
      mat = new MovieMaterial(v, true, true);
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is bit tough question. Im using third party library that will insert result
This will be a bit subjective, I'm afraid, but I'd value the advice of
This will be my first iOS app with any bit of complexity. I'd like
This case is a bit complex, I hope I will simplify it well. My
I've struggled with this a good bit this morning; I'm creating what will eventually
I am a bit lost as to how to explain this, so I will
This will be a bit difficult to explain but I will try my best.
I'm trying to write a stored procedure that will have 6 bit value flags
This will seem like an odd problem to have. I've got this bit of
I'm trying to develop a bit of JavaScript that will detect the language of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.