View comments | RSS feed

Camera class

Availability

The Camera class lets you capture video from a video camera attached to the computer that is running Macromedia Flash Player. When used with Flash Media Server, this class lets you transmit, display, and optionally record the video being captured. With these capabilities, you can develop media applications such as video conferencing, instant messaging with video, and so on. Flash provides similar audio capabilities; for more information, see the Microphone class entry.

You can also use a Camera object without a server--for example, to monitor a video feed from a webcam attached to your local system.

NOTE

 

When a SWF file tries to access the camera returned by Camera.get(), Flash Player displays a Privacy dialog box that lets the user choose whether to allow or deny access to the camera. (Make sure your Stage size is at least 215 x 138 pixels for the Camera class examples; this is the minimum size Flash requires to display the dialog box.) End users and administrative users may also disable camera access on a per-site or global basis.

To create or reference a Camera object, use the Camera.get() method.

Method summary for the Camera class

Method

Description

Camera.get()

Returns a reference to a Camera object for capturing video.

Camera.setKeyFrameInterval()

Specifies which video frames are transmitted in full instead of being interpolated by the video compression algorithm.

Camera.setLoopback()

Specifies whether to use a compressed video stream for a local view of what the camera is transmitting.

Camera.setMode()

Sets aspects of the camera capture mode, including height, width, and frames per second.

Camera.setMotionLevel()

Specifies how much motion is required to invoke Camera.onActivity(true).

Camera.setQuality()

Sets the maximum amount of bandwidth per second or the required picture quality of the current outgoing video feed.

Property summary for the Camera class

Property (read-only)

Description

Camera.activityLevel

A numeric value from 0 to 100 that specifies the amount of motion the camera is detecting.

Camera.bandwidth

The maximum amount of bandwidth the current outgoing video feed can use, in bytes.

Camera.currentFps

The rate at which the camera is capturing data, in frames per second.

Camera.fps

The rate at which you would like the camera to capture data, in frames per second.

Camera.height

The current capture height, in pixels.

Camera.index

The index of the camera, as reflected in the array returned by Camera.names.

Camera.keyFrameInterval

A number that specifies which video frames are transmitted in full instead of being interpolated by the video compression algorithm.

Camera.loopback

A Boolean value that specifies whether a local view of what the camera is capturing is compressed or uncompressed.

Camera.motionLevel

A numeric value from 0 to 100 that specifies the amount of motion required to invoke Camera.onActivity(true).

Camera.motionTimeOut

The number of milliseconds between the time the camera stops detecting motion and the time Camera.onActivity(false) is invoked.

Camera.muted

A Boolean value that specifies whether the user has allowed or denied access to the camera.

Camera.name

The name of the camera as specified by the camera hardware.

Camera.names

Class property; an array of strings containing the names of all available video capture devices, including video capture cards and cameras.

Camera.quality

A number that specifies the current level of picture quality based on the amount of compression being applied to each video frame.

Camera.width

The current capture width, in pixels.

Event handler summary for the Camera class

Method

Description

Camera.onActivity

Invoked when the camera starts or stops detecting motion.

Camera.onStatus

Invoked when the user allows or denies access to the camera.

Constructor for the Camera class

See Camera.get().


Comments


No screen name said on Mar 21, 2007 at 3:13 AM :
Hello,

I'm working in a video streaming project. We want to do a live video broadcast of an event, and record it for postproduction.
We have a PC where FMS is installed locally. That PC is the one that we will take to the event, it needs the FMS to record event FLV's and it needs a conection with an external server to allow clients connection.

The problem is how capture live video from a client side of a computer, send it to the official FMS server, and from this location, do a broadcast to the client side and allow people to visualice the live video.

Is any solution for that? I have seen that camera class only allow live video capture and broadcast, from the same server where the camera is connected. Is any form to access to an external camera placed in an url for example?

Thank you very much
tech_writer_00 said on Mar 27, 2007 at 10:57 AM :
I would recommend asking this question in the Flash Media Server Forum.
LiveDocs is designed for correcting the documentation.

http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=15&catid=578&entercat=y

Hope that helps!
No screen name said on Jul 23, 2008 at 4:10 AM :
There is a way to release the flash camera access in order to allow other apps to access it while flash movie is still running?

Thanks a lot.
Suzanne Smith said on Jul 30, 2008 at 11:07 AM :
The Flash 3 Help document says this:

You can't use ActionScript to set the Allow or Deny value for a user, but you can display the Privacy panel for the user by using System.showSettings(0). If the user selects Remember, Flash Player no longer displays the Privacy dialog box for SWF files from this domain

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fms/2/docs/00000526.html