请使用过Dspack开发过视频捕捉的DFW进来~~~~ ( 积分: 30 )

  • 主题发起人 主题发起人 午午
  • 开始时间 开始时间

午午

Unregistered / Unconfirmed
GUEST, unregistred user!
我现在在做一个视频捕捉软件,用的是天敏的SDK-2000视频卡,该卡有两个输入口,但是两个口的摄像不能同时使用。我想问一下用程序怎么控制输入口之间的切换?第一次用Dspack,也是第一次搞视频,请多多关照!谢谢
 
顶一下...
来个人指点一下
 
大家都是怎么了。。。帮个忙都不中?
 
没有人碰过类似的问题么?
 
可以用SDK-2000开发包可以解决。
 
var video_input_port:TPhysicalConnectorType;
procedure TVideoFormA.inputcomboxChange(Sender: TObject);
var i:Integer;
begin

i:=inputcombox.ItemIndex;
case i of
0:video_input_port:=PhysConn_Video_Tuner;
1: video_input_port:=PhysConn_Video_Composite;
2:video_input_port:=PhysConn_Video_SVideo;
3:video_input_port:=PhysConn_Video_RGB;
4:video_input_port:=PhysConn_Video_YRYBY;
5:video_input_port:=PhysConn_Video_SerialDigital;
6:video_input_port:=PhysConn_Video_ParallelDigital;
7:video_input_port:=PhysConn_Video_SCSI;
8:video_input_port:=PhysConn_Video_1394;
9:video_input_port:=PhysConn_Video_AUX ;
10:video_input_port:=PhysConn_Video_USB;
11:video_input_port:=PhysConn_Video_VideoDecoder;
12:video_input_port:=PhysConn_Video_VideoEncoder;
13:video_input_port:=PhysConn_Video_SCART;
14:video_input_port:=PhysConn_Video_Black;
end;

OnSelectDevice(Sender);
end;


procedure TVideoFormA.OnSelectDevice(sender:TObject);
var
pinlist:TPinList;
i:Integer;
sourcefilter:IBaseFilter;
capturegraph:ICaptureGraphBuilder2;
begin

FilterGraph.ClearGraph;
FilterGraph.Active := false;
bdev.SelectGUIDCategory(CLSID_VideoInputDeviceCategory);
Filter.FilterGraph:=FilterGraph;
Filter.BaseFilter.Moniker := bDev.GetMoniker(videosrccombox.ItemIndex);
FilterGraph.Active := true;
if Filter.FilterGraph <> nil then

begin

PinList := TPinList.Create(Filter as IBaseFilter);
if VideoFormat.ItemIndex <> -1 then

with (PinList.First as IAMStreamConfig)do

begin

SetFormat(VideoMediaTypes.Items[VideoFormat.ItemIndex].AMMediaType^);
end;

PinList.Free;
end;

FilterGraph.QueryInterface(icapturegraphbuilder2,capturegraph);
Filter.QueryInterface(ibasefilter,sourcefilter);

if SetVideoInput(video_input_port) <>S_OK then

raise
Exception.Create('video input connector not found');///端口选择

with FilterGraph as ICaptureGraphBuilder2do

RenderStream(@PIN_CATEGORY_PREVIEW,
nil,
Filter as IBaseFilter,
SampleGrabber as IBaseFilter,
VideoWindow as IbaseFilter);

FilterGraph.Play;
end;
 
后退
顶部