Symbian3/SDK/Source/GUID-AB9A3EA2-2B99-4502-A161-8EE5BF477D41.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-AB9A3EA2-2B99-4502-A161-8EE5BF477D41" xml:lang="en"><title>Capturing
a Video Clip</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>To record video data to a file, descriptor, or an URL, use the video
recorder utility of the Multimedia Framework (MMF) to develop your application.
To make use of the onboard camera to capture a video clip, the application
needs to repeat the steps described in the illustration below.</p>
<fig id="GUID-FEDF24E9-1171-4814-B3C9-21B4E37003BB"><title>The steps required to capture a video clip</title><image href="GUID-141D8786-9987-4E5E-9395-484C87B323FB_d0e290621_href.png"/></fig>
<p>Important implementation considerations include:</p>
<ul>
<li><p>Make sure you include the <codeph>VideoRecorder.h</codeph> and <codeph>mmfcontrollerpluginresolver.h</codeph> header
files in the appropriate class files.</p></li>
<li><p>Make sure you have correct <xref href="GUID-6971B0A2-F79B-4E05-8AF3-BB1FC1932A22.dita">capabilities</xref> information
set for your application. You need at least the <codeph>UserEnvironment</codeph> capability.
If you want to set the recording priority for the video and audio device,
you need the <codeph>MultimediaDD</codeph> capability.</p></li>
<li><p>Make sure <codeph>mediaclientvideo.lib</codeph> and <codeph>mmfcontrollerframework.lib</codeph> are
accessible to your linker when compiling your application by including it
in your <codeph>mmp</codeph> file or by editing the project properties in
your IDE, depending on your build environment.</p></li>
<li><p>To open a file for recording the <xref href="GUID-8A183C79-0EA4-3A4A-B95F-E2F1BF74238D.dita"><apiname>CVideoRecorderUtility</apiname></xref> class
requires the MMF Controller Framework API to specify controller and format
UIDs.</p></li>
<li><p>If you need to use the display of the device as a viewfinder
for your video application, request viewfinder frames using the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCamera</apiname></xref> class,
and draw them yourself. For more information, see step 3 in <xref href="GUID-A1D2C673-3B91-403A-800B-5E1504FB19EE.dita#GUID-A1D2C673-3B91-403A-800B-5E1504FB19EE/GUID-A7ED7A90-1432-4905-A0A5-0CC725997127">To capture still images on a mobile device </xref>.</p></li>
<li><p>The settings you can use in your application depend on what
the camera hardware on the device supports.</p></li>
</ul>
<section id="GUID-0C91A376-92FB-4C5F-8DCF-68A24D01CB9C"><title>To capture a
video clip</title>
<p>Use the methods of the <codeph>CVideoRecorderUtility</codeph> class
to construct your application.</p>
<ol>
<li id="GUID-77A80BE7-A452-42C4-A815-712402597071"><p>Initialize
the video recorder.</p>
<ul>
<li><p>Create a video recorder object using the <codeph>CVideoRecorderUtility::NewL</codeph> method.</p>
</li>
<li><p>Resolve the supported video format and retrieve a list of
controllers using the <codeph>CMMFControllerPluginSelectionParameters</codeph> and <codeph>CMMFFormatSelectionParameters</codeph> classes,
and the respective type definitions <codeph>RMMFControllerImplInfoArray</codeph> and <codeph>RMMFFormatImplInfoArray</codeph>. </p>
</li>
<li><p>Open a file, descriptor or an URL to store the video clip
in using the respective <codeph>CVideoRecorderUtility::OpenFileL</codeph>, <codeph>CVideoRecorderUtility::OpenDesL</codeph>,
or <codeph>CVideoRecorderUtility::OpenUrlL</codeph> method.</p></li>
<li><p>Set the maximum video clip size using the <codeph>CVideoRecorderUtility::SetMaxClipSizeL()</codeph> method.</p>
</li>
<li><p>Prepare the record controller using the <codeph>CVideoRecorderUtility::Prepare()</codeph> method. <codeph>MVideoRecorderUtilityObserver::MvruoPrepareComplete</codeph> is called upon completion.</p></li>
</ul>
</li>
<li id="GUID-8A46469A-E0BE-4789-ADEE-C900FF7CB331"><p>Configure
the audio and video settings.</p><p>You can check and set, for example,
the recording priority, audio track, video frame size and frame rate, audio
and video codecs and bit rates, and recording gain of the video clip. For
more information on the options, see the <codeph>CVideoRecorderUtility</codeph> class.</p>
</li>
<li id="GUID-CB57B0CC-14AD-464F-82FF-9D80CD369CD5"><p>Capture the
video clip.</p>
<ul>
<li><p>Start recording a video using the <codeph>CVideoRecorderUtility::Record()</codeph> method.</p>
</li>
<li><p>Pause recording using the <codeph>CVideoRecorderUtility::PauseL()</codeph> method.</p>
</li>
<li><p>Stop recording using the <codeph>CVideoRecorderUtility::Stop()</codeph> method.</p>
</li>
</ul>
</li>
<li id="GUID-6CB8476D-CC81-4776-B42F-F6AF3EDEBE76"><p>To exit the
application or to switch it to the background, close audio and video controllers
using the <codeph>CVideoRecorderUtility::Close()</codeph> method.</p></li>
</ol>
</section>
<section id="GUID-AA5B55BE-12E2-4CDF-9FA6-717669E07095"><title>Additional information
on capturing a video</title>
<p>For a reference example, see the <xref href="GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551.dita">Camera
Example: Capturing and controlling the images using Camera</xref>.</p>
<p>For more information on <codeph>CVideoRecorderUtility</codeph>, see:</p>
<ul>
<li><p><xref href="GUID-2DC80BA9-7AA2-5CD3-9105-1DE28CE196C1.dita">Video
Client Overview</xref></p></li>
<li><p><xref href="http://developer.symbian.org/wiki/index.php/File:Quick_Recipes_Symbian_multimedia_recipes.pdf" scope="external">Multimedia
recipes</xref> at the Symbian Foundation</p></li>
</ul>
<p>For information on using encoded H264 video frames, see <xref href="GUID-D038D77F-A6B8-5A18-8978-4981AE8D0F35.dita">Using
the Encoded H264 Video Frames to Capture Video</xref>.</p>
</section>
</conbody></concept>