H264EncodingProfile和H264EncodingLevel没有任何影响? [英] H264EncodingProfile and H264EncodingLevel not having any effect ?
问题描述
我正在尝试设置不同的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屋!