Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2020-03

Embedded VLC using PasLibVlc - how to fast forward?

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I am working on a video editing tool for Windows and Linux.

Earlier I was adviced to use VLC as the engine and PasLibVlc as the go-between.
So I have created the editor, which works well for me, but I have two new functions I want to add and I don't know how...

1) FF video playback
I want to be able to fast forward the video with audio present like my LG SmartTV can. Is that possible through the VLC plug-in?

2) Maximize
I also want to run the player maximized to full screen, again I don't know how. Any suggsetions?
Right now I only can maximize my main form itself but that brings along all of the panels with the editing controls too... Most video players nowadays have this little square that when clicked maximizes the video canvas itself so the video is full screen, how is that done?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund
Bo Berglund wrote 10 lines
I am working on a video editing tool for Windows and Linux. Earlier I was adviced to use VLC as the engine and PasLibVlc as the go-between. So I have created the editor, which works well for me, but I have two new functions I want to add and I don't know how... 1) FF video playback I want to be able to fast forward the video with audio present like my LG SmartTV can. Is that possible through the VLC plug-in?

I forgot to add:
In VLC the function I am after is located on menu: Playback/Speed
where there are 5 selections to make:
Faster, Faster(fine), Normal speed, Slower(fine), Slower

Show quoted text 8 lines
2) Maximize I also want to run the player maximized to full screen, again I don't know how. Any suggsetions? Right now I only can maximize my main form itself but that brings along all of the panels with the editing controls too... Most video players nowadays have this little square that when clicked maximizes the video canvas itself so the video is full screen, how is that done?

In VLC there is a speed-button on the bottom containing 4 corner marks and when clicked the video area fills the screen, return to normal by Esc.

When using PasLibVlc I have not found much in the way of documentation so I have used a simple demo and worked my way from there.

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund: I am working on a video editing tool for Windows and Linux. Earlier I was adviced to use…

On Sun, 22 Mar 2020 22:29:15 +0100, Bo Berglund via lazarus wrote:

FOLLOW-UP:

1) FF video playback

I found an example that handles the play speed and could verify it thus:
vlcPlayer.SetPlayRate(newPlayRate);

newPlayRate is an integer seemingly in percent of normal speed, so: x2 = 200
x1 = 100
x0.5 = 50
etc

vlcPlayer.GetPlayRate() reads back the current rate.

Still looking for the maximize function, but it is not so needed as was the speed.

Bo Berglund Developer in Sweden

Reply by email

Rolf Wetjen
to Bo Berglund

Hi Bo,

this could be a solution for windows (fullscreen):

     SetWindowLongPtr(Handle,GWL_STYLE,iWindowStyle and not
WS_OVERLAPPEDWINDOW);
     Left:=0;
     Top:=0;
     Width:=Screen.Width;
     Height:=Screen.Height;

Regards

Rolf

Bo Berglund wrote 22 lines
On Sun, 22 Mar 2020 22:29:15 +0100, Bo Berglund via lazarus wrote: FOLLOW-UP: > 1) FF video playback I found an example that handles the play speed and could verify it thus: vlcPlayer.SetPlayRate(newPlayRate); newPlayRate is an integer seemingly in percent of normal speed, so: x2 = 200 x1 = 100 x0.5 = 50 etc vlcPlayer.GetPlayRate() reads back the current rate. Still looking for the maximize function, but it is not so needed as was the speed.
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft. https://www.avast.com/antivirus

Reply by email

Bo Berglund
to Rolf Wetjen
Rolf Wetjen wrote 14 lines
Hi Bo, this could be a solution for windows (fullscreen):     SetWindowLongPtr(Handle,GWL_STYLE,iWindowStyle and not WS_OVERLAPPEDWINDOW);     Left:=0;     Top:=0;     Width:=Screen.Width;     Height:=Screen.Height; Regards Rolf

Well, this seems to make the program window maximized and this is not what I want.
I want the video port only to be maximized....

Meanwhile I found an example inside the PasLibVlc source package where there is a function that seems to do what I wanted so I tried to put it into my code.
However, it does not show any video on the resulting form, it is all black...
And it does not return to the application's previous form either when I hit a keyboard key. The application's main window in this case is all black, only the title bar is not black....

Here is the code of the button event that is supposed to maximize my window (copied from the example and adjusted for proper player name):

procedure TfrmMain.SpeedButton1Click(Sender: TObject);
var
//Defined in unit FullScreenFormUnit from the example:
  aFullScreenForm : TFullScreenForm;
  oldL, oldT, oldW, oldH : Integer;
  oldA : TAlign;
begin
  MessageDlg('Press any key, to leave full screen mode',
mtInformation, [mbOK], 0);
  oldL := vlcPlayer.Left;
  oldT := vlcPlayer.Top;
  oldW := vlcPlayer.Width;
  oldH := vlcPlayer.Height;
  oldA := vlcPlayer.Align;
  if (oldA  alNone) then vlcPlayer.Align := alNone;
  aFullScreenForm := TFullScreenForm.Create(SELF);
  aFullScreenForm.SetBounds(Monitor.Left, Monitor.Top, Monitor.Width,
Monitor.Height);
  // PasLibVlcPlayer1.ParentWindow := aFullScreenForm.Handle;
  {$IFDEF FPC}
    LCLIntf.SetParent(vlcPlayer.Handle, aFullScreenForm.Handle);
  {$ELSE}
    {$IFDEF MSWINDOWS}
      Windows.SetParent(vlcPlayer.Handle, aFullScreenForm.Handle);
    {$ENDIF}
  {$ENDIF}
  vlcPlayer.SetBounds(0, 0, Monitor.Width, Monitor.Height);
  aFullScreenForm.ShowModal;
  vlcPlayer.SetBounds(oldL, oldT, oldW, oldH);
  {$IFDEF FPC}
    LCLIntf.SetParent(vlcPlayer.Handle, SELF.Handle);
  {$ELSE}
    {$IFDEF MSWINDOWS}
      Windows.SetParent(vlcPlayer.Handle, SELF.Handle);
    {$ENDIF}
  {$ENDIF}
  aFullScreenForm.Free;
  if (oldA  alNone) then vlcPlayer.Align := oldA;
end;
Bo Berglund Developer in Sweden

Reply by email