×
Namespaces

Variants
Actions

通过CVideoRecorderUtility录制更大尺寸视频

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

兼容于
平台: S60 3rd Edition

文章
翻译:
最后由 hamishwillee 在 06 Mar 2012 编辑
  • 详细描述:

如果想要录制尺寸超过QCIF(176x144)的视频,那就要使用MPEG-4格式("video/mp4v-es")。

_LIT8(KMimeTypeMPEG4VSPL3, "video/mp4v-es; profile-level-id=3");  
// MPEG-4 Visual Simple Profile Level 3
 
_LIT8(KMimeTypeMPEG4VSPL4, "video/mp4v-es; profile-level-id=4");
// MPEG-4 Visual Simple Profile Level 4

我们可以在支持MPEG-4 VSP Level4(Visual Simple Profile Level 4)的设备上捕捉到30fps的VGA(640x480)视频,大部分S60第三版手机至少都支持VSP Level 3,即CIF(352x288)30fps的视频。

如:

iRecorder->OpenFileL( iFilename,  iCameraHandle, iControllerUid, iFormatUid, KMimeTypeMPEG4VSPL4, KMMFFourCCCodeAAC );

在MvruoOpenComplete回调函数中,capture size, frame rate以及bit rate应该在CVideoRecorderUtility::Prepare()前设置好,如下示例:

void CMyVideoRecorder::MvruoOpenComplete( TInt aError )
{
if( aError == KErrNone )
{
// instead of using TRAP_IGNORE, proper error checking should be done
TRAP_IGNORE( iRecorder->SetVideoFrameSizeL( iResolution ));
TRAP_IGNORE( iRecorder->SetVideoFrameRateL( iFps ));
TRAP_IGNORE( iRecorder->SetVideoBitRateL( KMMFVariableVideoBitRate ));
...
iRecorder->Prepare();


我们可以通过CCamera获得当前设备所支持最大的视频capture size和frame rate

    TInt sizeIndex = 0, rateIndex = 0;  
iCamera->EnumerateVideoFrameSizes( iResolution, sizeIndex, CCamera::EFormatYUV420Planar );
iCamera->EnumerateVideoFrameRates( iFps, rateIndex, CCamera::EFormatYUV420Planar, sizeIndex );
This page was last modified on 6 March 2012, at 03:19.
126 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×