device-iotcamera-control-demo-videodevguide.md 1.2 KB
Newer Older
W
wenjun 已提交
1 2 3 4 5 6 7 8
# Video Recording<a name="EN-US_TOPIC_0000001054754827"></a>

## When to Use<a name="en-us_topic_0000001051451869_section186634310418"></a>

Use the camera module APIs to capture video streams.

## Available APIs<a name="en-us_topic_0000001051451869_section125479541744"></a>

W
wenjun 已提交
9
For details, see the available APIs described in development guidelines on photographing.
W
wenjun 已提交
10 11 12 13 14 15 16

## Limitations and Constraints<a name="en-us_topic_0000001051451869_section1165911177314"></a>

None

## How to Develop<a name="en-us_topic_0000001051451869_section1196016315516"></a>

W
wenjun 已提交
17
1.  Perform step 1 through step 4 described in development guidelines on photographing.
W
wenjun 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
2.  Obtain the  **FrameConfig**  instance for audio recording.

    ```
    /* Obtain the surface from the recorder. */
    Surface *surface = recorder_->GetSurface(0);
    surface->SetWidthAndHeight(1920, 1080);
    surface->SetQueueSize(3);
    surface->SetSize(1024 * 1024);
    /* Add the surface to the FrameConfig instance. */
    FrameConfig *fc = new FrameConfig(FRAME_CONFIG_RECORD);
    fc->AddSurface(*surface);
    ```

3.  Start and stop video recording.

    ```
    stateCallback->camera_->TriggerLoopingCapture(*fc); // Start recording.
    stateCallback->camera_->StopLoopingCapture(); // Stop recording.
    ```