gpt4 book ai didi

video-capture - MediaEncodingProfile.CreateWmv 给出 "No suitable transform was found to encode or decode the content."错误

转载 作者:行者123 更新时间:2023-12-04 06:17:53 24 4
gpt4 key购买 nike

我正在创建一个将音频和视频上传到服务器的 Windows Phone 应用程序 (XAML/C#)。在 Windows Phone 8.0 上使用 VideoCaptureDevice 工作正常,但它只允许设备支持的分辨率(在诺基亚 625 上,最小的分辨率是 640 x 480)。为了缩小尺寸,我已将应用程序升级到 Windows Phone 8.1 Silverlight(开发人员预览版)以使用 Windows.Media.Capture.MediaCapture 库。这适用于通用 Qvga 格式:

MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(Windows.Media.MediaProperties.VideoEncodingQuality.Qvga);

适用于诺基亚 625 和 520,分辨率降至 320 x 240,但 4 分钟视频的文件大小仍然约为 24MB。如果我像这样设置自定义分辨率:

MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(Windows.Media.MediaProperties.VideoEncodingQuality.Auto);
profile.Video.Width = 480;
profile.Video.Height = 320;

我得到的文件大小要小得多(4 分钟 == ~6MB,这很奇怪)但它在 625 上已损坏。

我想尝试使用其他文件类型,例如 .wmv,但是:

MediaEncodingProfile profile = MediaEncodingProfile.CreateWmv(Windows.Media.MediaProperties.VideoEncodingQuality.Auto);

给出一个 System.Exception“没有找到合适的转换来编码或解码内容。”

我还需要对音频执行此操作,即:

MediaEncodingProfile profile = MediaEncodingProfile.CreateMp3(Windows.Media.MediaProperties.AudioEncodingQuality.Auto);

但我得到了同样的错误。

我想我在这里问了很多问题,但我真的在问:

  1. 在 Windows Phone 8.1 Silverlight 中减小视频大小的最佳方法是什么?
  2. 任何人都可以帮助我为 .wmv 和/或 .mp3 录音应用合适的转换吗?
  3. 有谁知道为什么手动设置视频分辨率会导致不稳定?

我也尝试过手动设置音频属性以查看是否会减小尺寸:

MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(Windows.Media.MediaProperties.VideoEncodingQuality.Qvga);
profile.Audio.Subtype = "PCM";
profile.Audio.ChannelCount = 2;
profile.Audio.BitsPerSample = 8;
profile.Audio.SampleRate = 22050;

但这也会导致文件损坏。

非常感谢任何帮助 - 到处寻找但在这个问题上发现的很少......

最佳答案

可能跟这个物联网有关: https://ms-iot.github.io/content/en-US/win10/ReleaseNotesRTM.htm

Release Notes for Windows 10 IoT Core Build Number 10586. December 2015

Known Issues

A MediaEncodingProfile.CreateWma( Windows.Media.MediaProperties. AudioEncodingQuality.Auto) method call may fail on the Raspberry Pi 2 with the error message No suitable transform was found to encode or decode the content. (Exception from HRESULT: 0xC00D5212). (4510128) WORKAROUND: None.

关于video-capture - MediaEncodingProfile.CreateWmv 给出 "No suitable transform was found to encode or decode the content."错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24121125/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com