H264EncodingProfile和H264EncodingLevel没有任何影响? [英] H264EncodingProfile and H264EncodingLevel not having any effect ?

查看:273
本文介绍了H264EncodingProfile和H264EncodingLevel没有任何影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置不同的H264编码配置文件和级别,但似乎无论我放置什么值,它都没有效果,我得到的视频总是具有相同的大小和质量。我有什么问题吗? 


 

async public void initCamera(Windows.Foundation。大小s)
{
_audioVideoCaptureDevice = await AudioVideoCaptureDevice.OpenAsync(CameraSensorLocation.Back,s);

_audioVideoCaptureDevice.VideoEncodingFormat = CameraCaptureVideoFormat.H264;

_audioVideoCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EncodingProfile,H264EncoderProfile.ConstrainedBaseline);
_audioVideoCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EncodingLevel,H264EncoderLevel.Level1);
_audioVideoCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.VideoFrameRate,15);
}

async public void startRecording()
{
StorageFolder localFolder = ApplicationData.Current.LocalFolder;
StorageFile storageFile = await localFolder.CreateFileAsync(" test.mp4",CreationCollisionOption.ReplaceExisting);

path = storageFile.Path;

if(storageFile!= null)

{

sst = await storageFile.OpenAsync(FileAccessMode.ReadWrite);
await _audioVideoCaptureDevice.StartRecordingToStreamAsync(sst);
}
}

解决方案


这些属性中的大多数都是只读的。请参阅此
文档


您的主要枚举选项似乎是
CameraCaptureVideoFormat



ChatterBox VoIP示例
可能对您开发项目有所帮助。


希望这会有所帮助,但是b $ b -Mark



I'm trying to set different H264 encoding profiles and level, but it seems no matter what value I put, it has no effect and the video I get always has the same size and quality. Is there something I'm doing wrong ? 

async public void initCamera(Windows.Foundation.Size s) { _audioVideoCaptureDevice = await AudioVideoCaptureDevice.OpenAsync(CameraSensorLocation.Back, s); _audioVideoCaptureDevice.VideoEncodingFormat = CameraCaptureVideoFormat.H264; _audioVideoCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EncodingProfile, H264EncoderProfile.ConstrainedBaseline); _audioVideoCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EncodingLevel, H264EncoderLevel.Level1); _audioVideoCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.VideoFrameRate, 15); } async public void startRecording() { StorageFolder localFolder = ApplicationData.Current.LocalFolder; StorageFile storageFile = await localFolder.CreateFileAsync("test.mp4", CreationCollisionOption.ReplaceExisting); path = storageFile.Path; if (storageFile != null)

{

sst = await storageFile.OpenAsync(FileAccessMode.ReadWrite); await _audioVideoCaptureDevice.StartRecordingToStreamAsync(sst); } }

解决方案

Hi,

Most of those properties are read-only. See this documentation.

It appears that your main enumeration choices are CameraCaptureVideoFormat .

The ChatterBox VoIP sample might be helpful to you in developing your project.

Hope this helps,
-Mark


这篇关于H264EncodingProfile和H264EncodingLevel没有任何影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆