有关directshow----dspack的问题 ( 积分: 300 )

  • 主题发起人 主题发起人 wanyh
  • 开始时间 开始时间
W

wanyh

Unregistered / Unconfirmed
GUEST, unregistred user!
我使用dspack自带的例程videocap,生成的avi文件实在是太大了,几分钟就几百兆,后来换了种格式,用asf,小是小了,但是失真。请问如何能够解决这个问题,不失真又能比较小。
在线等,分不够可以再加。
 
补充一下:
DSPack2.34版的Demo/D6-D7/VideoCap
 
部分代码:
procedure TMainForm.StartButtonClick(Sender: TObject);
var
multiplexer: IBaseFilter;
Writer: IFileSinkFilter;
PinList: TPinList;
i: integer;
begin


// Activate the filter graph, at this stage the source filters are added to the graph
CaptureGraph.Active := true;

// configure output Audio media type + source
if AudioSourceFilter.FilterGraph <> nil then

begin

PinList := TPinList.Create(AudioSourceFilter as IBaseFilter);
i := 0;
while i < PinList.Countdo

if PinList.PinInfo.dir = PINDIR_OUTPUT then

begin

if AudioFormats.ItemIndex <> -1 then

with (PinList.Items as IAMStreamConfig)do

SetFormat(AudioMediaTypes.Items[AudioFormats.ItemIndex].AMMediaType^);
PinList.Delete(i);
end else
inc(i);
if InputLines.ItemIndex <> -1 then

with (PinList.Items[InputLines.ItemIndex] as IAMAudioInputMixer)do

put_Enable(true);
PinList.Free;
end;


// configure output Video media type
if VideoSourceFilter.FilterGraph <> nil then

begin

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

// with (PinList[1] as Iamoviesetup)do

with (PinList.Items[InputLines.ItemIndex] as IAMStreamConfig)do

SetFormat(VideoMediaTypes.Items[VideoFormats.ItemIndex].AMMediaType^);
PinList.Free;
end;



// now render streams
with CaptureGraph as IcaptureGraphBuilder2do

begin

// set the output filename MEDIASUBTYPE_ASF
SetOutputFileName(MEDIASUBTYPE_AVI, PWideChar(CapFile), multiplexer, Writer);
// Connect Video preview (VideoWindow)
if VideoSourceFilter.BaseFilter.DataLength > 0 then

RenderStream(@PIN_CATEGORY_PREVIEW, nil, VideoSourceFilter as IBaseFilter,
VCompFilter as IBaseFilter , VideoWindow as IBaseFilter);

// Connect Video capture streams
if VideoSourceFilter.FilterGraph <> nil then

RenderStream(@PIN_CATEGORY_CAPTURE, nil, VideoSourceFilter as IBaseFilter,
nil, multiplexer as IBaseFilter);

// Connect Audio capture streams
if AudioSourceFilter.FilterGraph <> nil then

begin


RenderStream(nil, nil, AudioSourceFilter as IBaseFilter,
nil, multiplexer as IBaseFilter);
end;

end;

CaptureGraph.Play;
StopButton.Enabled := true;
StartButton.Enabled := false;
AudioFormats.Enabled := false;
AudioCapFilters.Enabled := false;
VideoFormats.Enabled := false;
VideoCapFilters.Enabled := false;
Timer.Enabled := true;
end;
 
我有一个小的,QQ 87797301
 
同志们 大哥大姐们,帮忙啊
 
呵呵。。。。。。你可以用我的控件去采集,但是前提是机器上要安装xvid解码器。这是MPGE4压缩的,一个小时60-70M(320*240),在www.tomore.com上,找NetVideo 2.2版本。采用DSPAck和INDY10,Delphi7做的。
 
后退
顶部