Recent

Author Topic: MPlayer seek question  (Read 495 times)

Pe3s

  • Sr. Member
  • ****
  • Posts: 314
MPlayer seek question
« on: July 20, 2022, 09:11:30 pm »
Hello I have this question why the progress bar reacts with a delay , is it due to an error in the MPLayer component ?
Code: Pascal  [Select][+][-]
  1. procedure TForm1.VideoBarMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
  2. var
  3.   Ratio: Real;
  4.   Total, videoPos: Integer;
  5. begin
  6.   if not (ssLeft in Shift) then Exit;
  7.   Ratio := X / VideoBar.ClientWidth;
  8.   Total := Trunc(VideoBar.MaxValue - VideoBar.MinValue);
  9.   videoPos := Trunc((Total * Ratio) + Trunc(VideoBar.MinValue));
  10.   VideoBar.Value := videoPos;
  11. end;
  12.  
  13. procedure TForm1.VideoBarMouseUp(Sender: TObject; Button: TMouseButton;
  14.   Shift: TShiftState; X, Y: Integer);
  15. begin
  16.   MPlayer.SendMPlayerCommand('seek '+inttostr(VideoBar.Value)+ ' 2');
  17. end;
  18.  
  19.  

« Last Edit: July 22, 2022, 08:22:01 am by Pe3s »

metis

  • Full Member
  • ***
  • Posts: 237
Re: MPlayer seek question
« Reply #1 on: July 29, 2022, 05:26:37 pm »
@Pe3s

The MPlayer communicates via Pipes & Strings, which is slow.
If You want something faster, take e.g. the VLC-DLLs.

If You want something really fast & responsive, with outstanding Sound, take my FFmpeg-based AV-Player:
https://forum.lazarus.freepascal.org/index.php/topic,26666.msg428667.html#msg428667
Life could be so easy, if there weren't those f*** Details.

Pe3s

  • Sr. Member
  • ****
  • Posts: 314
Re: MPlayer seek question
« Reply #2 on: July 29, 2022, 09:39:06 pm »
@Metis Thank you :)

 

TinyPortal © 2005-2018