0 Replies Latest reply on Jan 28, 2008 11:40 AM by ArmenGeo

    Web camera video quality in Flex

      Hi, I have a flex app which turns on a web camera and shows the video from the camera. The problem is that the video resolution is a bit choppy or pixilated. I know it’s not because of the quality of the webcam since the video is very clear on other players. Anyone have an idea how to make the resolution clearer? Here is a test app you can try yourself.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="initApplication()" fontFamily="Arial" width="925" height="1100" layout="horizontal"
      <mx:Canvas id="videoContainer" width="330" height="250" borderStyle="solid" borderColor="#000000" cornerRadius="10" borderThickness="5" x="-167" y="42">
      import mx.core.UIComponent;
      public var camera : Camera ;
      public var video : Video;
      public var currentShot : BitmapData = new BitmapData(320,240); // video.width,video.height);
      public var matrix : Matrix = new Matrix();
      public var mybitmapdata : BitmapData = new BitmapData(320,240); // (video.width,video.height);
      public var mybitmap : Bitmap ;
      public var uploadbmd:BitmapData ;
      public var flag:Boolean = true;
      public var loader: URLLoader = new URLLoader();

      public function initApplication()
      camera = Camera.getCamera();
      video = new Video(camera.width*2, camera.height*2);
      mybitmap = new Bitmap(mybitmapdata);
      var ref : UIComponent = new UIComponent();
      setInterval(snapShot, 100);

      public function snapShot() : void
      currentShot.draw(video, matrix);
      mybitmapdata = currentShot.clone();
      mybitmap = new Bitmap(mybitmapdata);
      var ref : UIComponent = new UIComponent();
      ref.addChild( mybitmap );
      videoContainer.addChild( ref );