大家帮忙看一下,两路视频采集的,不能实现,有源码.(200)

  • 主题发起人 主题发起人 u9085
  • 开始时间 开始时间
U

u9085

Unregistered / Unconfirmed
GUEST, unregistred user!
//这儿开始对第一路图像进行采集procedure TVideoForm.OnSelectDevice(sender: TObject);
begin
FilterGraph.ClearGraph;
FilterGraph.Active := false;
Filter.BaseFilter.Moniker := SysDev.GetMoniker(0);
FilterGraph.Active := true;
with FilterGraph as ICaptureGraphBuilder2do
begin
RenderStream(@PIN_CATEGORY_PREVIEW, nil, Filter as IBaseFilter, nil, VideoWindow as IbaseFilter);
SetOutputFileName(MEDIASUBTYPE_Asf, PWideChar(CapFile), multiplexer, Writer);
RenderStream(@PIN_CATEGORY_CAPTURE, @MEDIATYPE_Video, Filter as IBaseFilter,nil,multiplexer as IBaseFilter);
end;

FilterGraph.Play;
end;
//开始转换到第二路图像procedure TVideoForm.Button1Click(Sender: TObject);
begin
filtergraph.Pause;
FilterGraph.ClearGraph;
FilterGraph.Active := false;
Filter.BaseFilter.Moniker := SysDev.GetMoniker(1);
FilterGraph.Active := true;
with FilterGraph as ICaptureGraphBuilder2do
begin
RenderStream(@PIN_CATEGORY_PREVIEW, nil, Filter as IBaseFilter, nil, VideoWindow as IbaseFilter);
RenderStream(@PIN_CATEGORY_CAPTURE, @MEDIATYPE_Video, Filter as IBaseFilter,nil,multiplexer as IBaseFilter);
end;

FilterGraph.Play;
end;
程序运行后可以采集第一路的,但是转换到第二路后videowindow中可以显示第二路的图像,而采集会停止(也就是说已经不往文件中写了)。这个问题已经困扰我好长时间了,一直没有解决,请各位老大帮忙看一下,这个问题应该怎么样解决,谢谢各位了。
 
后退
顶部