怎样在自己的程序中设置采集的制式、分辨率等信息?(不通过调用系统的对话框)
另外,我现在用的是dspack控件,有没有更好的directshow控件能够更好的实现视频采集?

解决方案 »

  1.   

    我在dspack中用一下的方法设置采样格式,但是在很多采集卡下,352×288一下的分辨率可以设置成功,但是再大就不行了,采集卡支持最大768×576(pal)。请高手指点一下迷津。  if Succeeded(Filter.QueryInterface(IBaseFilter, BaseF)) then
      begin
        PinLIst := TPinList.Create;
        PinList.Assign(BaseF);
        for I := 0 to PinList.Count - 1 do
        begin
          if Succeeded(PinList.Items[I].QueryInterface(IID_IAMStreamConfig, VStreamConf)) then
          begin
            VStreamConf.GetFormat(pf);
            if IsEqualGUID(pf^.formattype, FORMAT_VideoInfo) then
            begin
              FVideoFormat := PVideoInfoHeader(pf^.pbFormat)^;
              FVideoFormat.bmiHeader.biCompression := BI_RGB;
              FVideoFormat.bmiHeader.biWidth := VIDEO_MODES[VideoMode].Width;
              FVideoFormat.bmiHeader.biHeight := VIDEO_MODES[VideoMode].Height;
              FVideoFormat.bmiHeader.biBitCount := 24;
              FVideoFormat.bmiHeader.biSizeImage := FVideoFormat.bmiHeader.biWidth *
                                                    FVideoFormat.bmiHeader.biHeight *
                                                    FVideoFormat.bmiHeader.biBitCount
                                                    div 8;
              pf^.pbFormat := @FVideoFormat;
              result := Succeeded(VStreamConf.SetFormat(pf^));
            end
            else pf := nil;
          end;
        end;
        PinList.Free;
        BaseF := nil;
      end;