[英]concatenate video files DirectShow
使用C#,
如何使用DrirectShow來連接兩個視頻文件(.avi文件)..? 請幫忙!
以下代碼僅用於解釋問題......
VideoSpanCollection newList = new VideoSpanCollection();
int j;
for(int i=0; i<oldItems.Count; i = j)
{
for(j=i+1;
j<oldItems.Count &&
oldItems[j].File.FullName == oldItems[j-1].File.FullName &&
Math.Abs(oldItems[j].StartPosition - oldItems[j-1].StopPosition) < 0.5;
j++);
VideoSpan newSpan = new VideoSpan();
newSpan.File = oldItems[i].File;
newSpan.StartPosition = oldItems[i].StartPosition;
newSpan.StopPosition = oldItems[j-1].StopPosition;
AddSpanToListView(newSpan, -1);
}
沒有標准/通用的方式,更不用說它們必須是兼容的格式。
在DirectShow中,您需要自定義過濾器,該過濾器從2個以上的源流中傳輸,並將數據路由到管道的記錄段,在路上更新時間戳。
DirectShow編輯服務(DES)雖然可能在渲染目標文件時重新壓縮輸出,但可能會有所幫助。 好消息DES也包含在DirectShow.NET中,它為您提供了將視頻和音頻組合成單個輸出文件的示例代碼。
Samples\Editing\DESCombine
--------------------------
A class library that uses DirectShow Editing Services to combine video and audio
files (or pieces of files) into a single output file. A help file (DESCombine.chm)
is provided for using the class.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.