Expression Encoder SDK用c#,如何剪切视频,音频

时间:2012-03-26 03:06:23

标签: c# .net

如何使用带有.net的Expression Encoder SDK剪切视频或音频?

1 个答案:

答案 0 :(得分:1)

Here可能会对您有所帮助:

// Create a media item and get a pointer to the inital source.
MediaItem item = new MediaItem(@"c:\users\Public\Videos\Sample Videos\Wildlife.wmv");
Source source = item.Sources[0];

// Change the first clip so that instead of spanning the entire file
// I'm just going to encode the bit from 5 to 10 seconds.
source.Clips[0].StartTime = new TimeSpan(0, 0, 5);
source.Clips[0].EndTime = new TimeSpan(0, 0, 10);

// Also add the bit from 20 to 30 seconds from the original file.
TimeSpan secondClipStart = new TimeSpan(0,0,20);
TimeSpan secondClipEnd = new TimeSpan(0,0,30);
source.Clips.Add(new Clip(secondClipStart, secondClipEnd));

除此之外,我认为你使用的是错误的工具。