Skip navigation
Cyborg571
Currently Being Moderated

Unable to render full iPad3 camera resolution to Video container

Jul 31, 2012 2:03 PM

Tags: #air #camera #ios #ipad #aspect_ratio #ipad3 #camera_resolution

I'm currently working on an application which uses camera input from iOS devices on the iPhone 3GS and up. Using the native Camera and Video classes, I am able to render the camera input from these devices to the screen. In the case of this current applicaiton, the input renders into a frame sized 640x640, and then is upscaled based on the device's camera and screen resolutions (as well as the device's application memory allocation) and drawn to BitmapData in order to be saved.

 

In order to set the resolution of the camera input initially, I am using the setMode() function, in which I pass in the default resolution for that device's camera based on the conditions mentioned above. This works well across the board, save for the newer devices equipped with the higher resolution cameras. On the iPad 3 and iPhone 4s, I seem to be losing a portion of the images - about 200px - on each of the edges. The resulting input looks like a slightly zoomed-in camera.

 

I've experimented with many varying resolutions and aspect ratios on this device - all with the same results. I've also ensured that the favorArea parameter in setMode is set to true (though I've tried setting it to false just for kicks). It seems the only way I can avert this problem is if I don't call the setMode() function at all. This won't work though, as the default resolution for the Camera is set to 160x120, which is far too low-res for my needs.

 

Are there any caveats with the Camera class that might cause this?

 

Thanks!

 

EDIT: This project is using Air 3.3 release.

 

EDIT 2: Another interesting detail: The FaceTime (front facing) camera doesn't have this problem. Not surprisingly, it is a significantly lower resolution camera than the rear one.

 
Replies
  • Currently Being Moderated
    Aug 1, 2012 5:29 AM   in reply to Cyborg571

    Would it be possible for you to share your app sources to let us investigate the issue on iPad3 and iPhone4s?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 5:26 AM   in reply to Cyborg571

    May be I am missing something, but I am unable to reproduce the issue. The camera preview looks just fine on iPad3 with the following simple code (reduced form of your code) -

     

     

    package

    {

              import flash.display.Sprite;

              import flash.display.StageAlign;

              import flash.display.StageScaleMode;

              import flash.media.Camera;

              import flash.media.Video;

     

              public class cam extends Sprite

              {

                        private var camera:Camera = null;

                        private var vid:Video = null;

                        public function cam()

                        {

                                  super();

     

                                  // support autoOrients

                                  stage.align = StageAlign.TOP_LEFT;

                                  stage.scaleMode = StageScaleMode.NO_SCALE;

     

                                  vid = new Video(640, 640);

                                  vid.x = vid.y =0;

                                  camera = Camera.getCamera();

                                  camera.setMode(2448, 2448, 25,true);

                                  addChild(vid);

                                  vid.attachCamera(camera);

                        }

              }

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2012 8:46 AM   in reply to Cyborg571

    Thanks for the screenshots.

    This makes the issue clear.

    I will get an AIR Runtime bug logged for this, and keep you updated.

     

    -Daman

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 24, 2012 8:32 AM   in reply to Damanjit Singh

    Are there any updates for this problem?
    I get the same results.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points