Display red line on RTSP stream

This forum is about all development around libVLC.
woolfik
New Cone
New Cone
Posts: 6
Joined: 25 Sep 2014 20:49

Display red line on RTSP stream

Postby woolfik » 05 May 2021 13:13

Hello,

I need write red line in the middle of TPanel where is displaying RTSP stream. I have add new component to my application (TPaintBox) and draw over canvas but method:
libvlc_media_player_play(vlcMediaPlayer);
overrite this red line.

Can You help me?

Code: Select all

procedure TkbSDVLCLib.Play(const pRTSPAddr: PAnsiChar; const pDisplay: THandle; const pRec: boolean); var vname: string; begin if (Assigned(vlcMediaPlayer) and (libvlc_media_player_is_playing(vlcMediaPlayer) = 1)) then exit; vlcMedia := libvlc_media_new_location(vlcInstance, pRTSPAddr); vlcMediaPlayer := libvlc_media_player_new_from_media(vlcMedia); if pRec then begin FRTSPAddr := pRTSPAddr; FDisplay := pDisplay; vTimer.Interval := FRecordTimeInMiliseconds; vTimer.Enabled := true; vname :=FPath+'\'+ DateTimeToStr(Now,FS) + '_'+FName + '.mp4'; FFileList.Add(vName); libvlc_media_add_option(vlcMedia,PAnsiChar(AnsiString(':sout=#duplicate{dst=display,dst=std{access=file,mux=mp4,dst="'+vname +'"}}'))); end; libvlc_media_release(vlcMedia); libvlc_media_player_set_hwnd(vlcMediaPlayer, Pointer(pDisplay)); libvlc_media_player_play(vlcMediaPlayer); end;
and drawing on canvas code:

Code: Select all

pbLine.Canvas.Pen.Color := clRed; pbLine.Canvas.MoveTo(0,round(pbLine.Height/2)); pbLine.Canvas.LineTo(pbLine.Width,Round(pbLine.Height/2));

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Display red line on RTSP stream

Postby mfkl » 10 May 2021 04:10

Not sure what GUI toolkit you are using, but I'd try adding a control over the one that holds the HWND libvlc is using to draw on.
https://mfkl.github.io

woolfik
New Cone
New Cone
Posts: 6
Joined: 25 Sep 2014 20:49

Re: Display red line on RTSP stream

Postby woolfik » 11 May 2021 08:25

Can't do it because libvlc create a new window and dock this new window in my control. So everything I put on my control (TPanel or TForm or everything that has HWND) is under this new libvlc window. Now I make this red line by adding some logo but it doesn't work when the control has a small size.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 38 guests