使用 Expression Encoder SDK 确定媒体是否需要转码
我有大量媒体文件,我经常需要这些文件来使 Silverlight 做好准备。基本上,取一个文件夹并对所有视频和音频文件进行转码。
添加 MediaItem
时,有没有办法确定它是否不需要任何转码 - 即它是否已经准备好根据默认编码过程在 Silverlight 中播放?
I have a large number of media files I will regularly need to make Silverlight-ready. Basically, take a folder and transcode all the video and audio files.
When adding a MediaItem
, is there a way to determine if it doesn't require any transcoding - i.e. it's already ready to be played in Silverlight based on the default encoding process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我是从相反的方向解决这个问题的。我想将多个文件附加在一起。因为我知道它们的格式都相同,所以我只想执行附加而不重新编码。我学到的一些课程应该对你有帮助。
我所做的是将
OutputFormat.VideoProfile
的编码设置为与SourceVideoProfile
相同。在您的情况下,您需要将OutputFormat.VideoProfile
设置为所需的编码配置文件,然后您可以比较所有媒体文件的SourceVideoProfile
并跳过那些相同的。还需要注意的是,表达式编码器不会重新编码具有匹配源和输出配置文件的文件。这意味着,如果您不进行这些检查,您可能仍然没问题。
有关比较视频配置文件的更多信息,请查看 MergeMedia 示例 和 MediaInfo 示例< /a> 来自微软。示例代码不在网上,但如果您安装了 Expression Encoder SDK,它就在那里:
*C:\Program Files\Microsoft Expression\Encoder 4\SDK\Samples*
I was working through this from the opposite direction. I wanted to append multiple files together. Since I knew they were all formatted the same way, I just wanted to perform the appending without re-encoding. Some of the lessons I learning should help you out.
What I did was to set the encoding of the
OutputFormat.VideoProfile
to be the same as theSourceVideoProfile
. In your case you would want to set theOutputFormat.VideoProfile
to your desired encoding profile and then you could compare theSourceVideoProfile
of all your media files and skip the ones that are the same.It is also important to note that the Expression Encoder will not re-encode files that have matching source and output profiles. This means that if you didn't do these checks, you'd probably still be okay.
For more information on comparing the video profiles check out the MergeMedia sample and the MediaInfo sample from Microsoft. The sample code is not online, but if you install the Expression Encoder SDK it's in there:
*C:\Program Files\Microsoft Expression\Encoder 4\SDK\Samples*