2

I'm trying to add video recording into a mobile app I'm building. But am struggling with the recording part. So far I have got the camera class displaying in a video object with the code below.

private function init():void
        {
            var camera1:Camera = Camera.getCamera();
            trace(Camera.names);
            if (camera1)
            {
                var ui1:UIComponent = new UIComponent();
                var video:Video = new Video (320, 240);
                camera1.setMode(320, 240, 24);
                camera1.setQuality(0, 100);
                video.attachCamera(camera1);
                ui1.addChild(video);
                cameraGroup1.addElement(ui1);

            }

        }

From what I understand you can use the cameraUI class instead to achieve the recording part and add it to the library but it would mean using the default camera application when I would rather use my own. I imagine recording using the camera class would require a tick to grab each frame and then something like the videoFrame event but could really use some code or a point in the right direction.

Thanks in advance.

Nick
  • 21
  • 1

1 Answers1

0

Best way to record using the Flash or AIR application is Media Server. You can connect your application with Media Server (Flash Media Server / Red5 / any other Media Server which is providing Media Recording and Publishing.) and publish your stream for recording.

Second way, I need to search out the code but logically I can say answer. We need to convert Camera stream buffer in to the binary data and we need to save binary data as video file o File system. For that you can write down some code in ActionScript and need to write down some code in the Native Application as Native Extension.

Mrugesh
  • 461
  • 4
  • 16