我正在研究如何将视频分成四个片段。我见过很多解决方案和库。我一直在寻找这个库:在C中分割四个文件中的视频#
https://github.com/AydinAdn/MediaToolkit
这是分裂的视频
var inputFile = new MediaFile {Filename = @"C:\Path\To_Video.flv"};
var outputFile = new MediaFile {Filename = @"C:\Path\To_Save_ExtractedVideo.flv"};
using (var engine = new Engine())
{
engine.GetMetadata(inputFile);
var options = new ConversionOptions();
// This example will create a 25 second video, starting from the
// 30th second of the original video.
//// First parameter requests the starting frame to cut the media from.
//// Second parameter requests how long to cut the video.
options.CutMedia(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(25));
engine.Convert(inputFile, outputFile, options);
}
的代码分裂只是一个片段的代码。有没有办法将它分成四部分?
亲切的问候
PS:该解决方案必须是C#和已经看到了Directshow的解决方案。
也许这样做4次改变起始第二? – Pikoh
你的意思是我必须做4 var选项=新的ConversionOptions(); ?我正在考虑这个问题,但这是一个很好的解决方案吗? – Fearcoder
我没有使用过这个库,但对我来说听起来不错,4'var options'和4'engine.Convert'我猜 – Pikoh