Q
qdpingping
Unregistered / Unconfirmed
GUEST, unregistred user!
做了一个视频捕捉的程序,转换小的视频文件时没事,但如果转换大的 .dat 文件,总是在转换过程中出错,出错位置总是在一个地方。我使用 Delphi 做的程序,代码如下:
procedure TForm1.GOClick(Sender: TObject);
var Filter: IBaseFilter;
FileSink: IFileSinkFilter;
begin
FilterGraph.Active := true;
with FilterGraph as ICaptureGraphBuilder2do
begin
SetOutputFileName(MEDIASUBTYPE_Avi, StringToOleStr(Output.Text), Filter, FileSink);
ShowFilterPropertyPage(Self.Handle, DivXEncoder as IBaseFilter, ppVFWCompConfig);
OpenDialog.Title := 'Select Video File';
if OpenDialog.Execute then
begin
with FileSource as IFileSourceFilterdo
Load(StringToOleStr(OpenDialog.FileName), nil);
RenderStream(nil, nil, FileSource as IBaseFilter, DivXEncoder as IBaseFilter, Filter);
RenderStream(nil, nil, FileSource as IBaseFilter, DivXEncoder as IBaseFilter, Filter);
FilterGraph.Play;
end;
end;
end;
可以帮我找一下出错的原因吗?
procedure TForm1.GOClick(Sender: TObject);
var Filter: IBaseFilter;
FileSink: IFileSinkFilter;
begin
FilterGraph.Active := true;
with FilterGraph as ICaptureGraphBuilder2do
begin
SetOutputFileName(MEDIASUBTYPE_Avi, StringToOleStr(Output.Text), Filter, FileSink);
ShowFilterPropertyPage(Self.Handle, DivXEncoder as IBaseFilter, ppVFWCompConfig);
OpenDialog.Title := 'Select Video File';
if OpenDialog.Execute then
begin
with FileSource as IFileSourceFilterdo
Load(StringToOleStr(OpenDialog.FileName), nil);
RenderStream(nil, nil, FileSource as IBaseFilter, DivXEncoder as IBaseFilter, Filter);
RenderStream(nil, nil, FileSource as IBaseFilter, DivXEncoder as IBaseFilter, Filter);
FilterGraph.Play;
end;
end;
end;
可以帮我找一下出错的原因吗?