Question

For doing this action I use below code:

procedure TForm4.Button2Click(Sender: TObject);
begin
  MediaPlayerControl1.MakeScreenshot.SaveToFile('c:\temp\e.bmp');
end;

When this code runs bitmap saved to file; but It is a black Image all of the time. I am trying for solving this problem. please help me.

Was it helpful?

Solution

MakeScreenshot is actually a method of FMX.Types.TControl and a such designed to draw the content of an underlying window to a bitmap. Since DirectShow uses Video Renderer Filters that in most cases use DirectDraw and overlay surfaces to render video frames, the MakeScreenshot method never "sees" the video frames - hence the black bitmaps. It seems there is no built in way into TMediaPlayer to access the video frames, like it is forseen in the SampleBufferToBitmap method of a TVideoCaptureDevice

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top