Compartir a través de


Capturing video for Windows Phone 8

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

This section describes the APIs you can use to programmatically capture video on Windows Phone. It also lists some points to keep in mind when you use the emulator to develop your camera app.

This topic contains the following sections.

Camera API overview

There are two sets of APIs your app can use to capture video.

Class

Description

Supported on Windows Phone OS 7.1

Supported on Windows Phone 8

CaptureSource and FileSink

Use these classes to record video.

AudioVideoCaptureDevice

Use this class for advanced video and audio capture, and to access the preview buffer.

The System.Windows.Media..::.CaptureSource class, used in conjunction the FileSink class, give your app the ability to programmatically record video. For advanced video and encoding settings, the AudioVideoCaptureDevice class provides an extended set of capabilities and better performance. Use this class to control video properties such as encoding settings, torch power, system mute, and manual focus position.

Using CaptureSource

The System.Windows.Media..::.CaptureSource class is available to apps written for Windows Phone OS 7.1 and Windows Phone 8. However, this class can only be used in managed code. For more info about using System.Windows.Media..::.CaptureSource, see the following topic:

Using AudioVideoCaptureDevice

The Windows.Phone.Media.Capture APIs are available only to apps written for Windows Phone 8. These APIs are projected into C#, Visual Basic, and C++ and are accompanied by interfaces that can be called from native code. For more info about these APIs, see the following topics:

Using the emulator

When you use the emulator to develop a camera app, keep the following points in mind:

  • Some API calls may not work as expected on the emulator. Review the Windows Phone SDK release notes for the latest details.

  • The scene sent to the emulator camera is a box that floats around the borders of the viewfinder.

Tip

For the best development experience, we recommend that you develop your camera app on a Windows Phone 8 device.