开发者

Determine If Media Requires Transcoding with Expression Encoder SDK

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 d开发者_C百科oesn't require any transcoding - i.e. it's already ready to be played in Silverlight based on the default encoding process?


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 the SourceVideoProfile. In your case you would want to set the OutputFormat.VideoProfile to your desired encoding profile and then you could compare the SourceVideoProfile 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*

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜