This topic describes how to use the encoded H264 video frames in the Ecam video capture function to capture the video data.
You need to be familiar with the Capturing a Video Clip tutorial.
The H264 video encoder provides a new, high quality video data encoding format for Ecam. Ecam allows the device to capture video frames which are encoded in the H264 format. The Ecam video capture function supports the H264 video capture format by default. You can select the H264 video capture format when preparing video capture.
The following example code snippet illustrates video capture using H264 encoding:
CCamera* camera = NULL; MCameraObserver2* observer2 = NULL; CCamera::CCameraVideoCaptureControl* videocapture = NULL; MCaptureVideoObserver* videoObserver = NULL; camera = CCamera::New2L(*observer2, 0, 0); videocapture = CCamera::CCameraVideoCaptureControl::NewL(*camera, *videoObserver); CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters prepareVideoParameters; TInt supportedDVCType = -1; // To retrieve the supported video capture mode videocapture->GetVideoCaptureSupportInfoL(supportedDVCType); // To set the video capture mode, if supported by the CCamera implementation prepareVideoParameters.SetVideoCaptureType(CCamera::CCameraVideoCaptureControl::EDirectVideoCapture); // To set encoding for the H264 video data format prepareVideoParameters.iFormat = CCamera::EFormatEncodedH264; // To set aspect ratio for the chosen H264 video format prepareVideoParameters.iPixelAspectRatio = CCamera::CCameraAdvancedSettings::EEPixelAspect40To33; videocapture->PrepareVideoCapture(prepareVideoParameters); videocapture->StartVideoCaptureL(); videocapture->StopVideoCapture(); CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters retrievedVideoParam; videocapture->GetPrepareVideoParametersL(retrievedVideoParam); CCamera::CCameraVideoCaptureControl::TVideoCaptureType retrievedVideoCaptureType; retrievedVideoCaptureType = retrievedVideoParam.VideoCaptureType();
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.