是否可以通过 DsPack 组件从视频文件中获取位图?
在这种情况下,我正在使用此代码;但它不能截图图像:
type
TForm4 = class(TForm)
FilterGraph1: TFilterGraph;
VideoWindow1: TVideoWindow;
btnPlay: TButton;
SampleGrabber1: TSampleGrabber;
btnTakePicture: TButton;
Image1: TImage;
procedure btnPlayClick(Sender: TObject);
procedure btnTakePictureClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
...
procedure TForm4.btnPlayClick(Sender: TObject);
begin
SampleGrabber1.FilterGraph := FilterGraph1;
VideoWindow1.FilterGraph := FilterGraph1;
FilterGraph1.Active := true;
FilterGraph1.RenderFile('C:\TEMP\1.mp4');
FilterGraph1.Play;
end;
procedure TForm4.btnTakePictureClick(Sender: TObject);
begin
SampleGrabber1.GetBitmap(Image1.Picture.Bitmap);
end;
是否可以修复此代码?