How to display text on screen?

This forum is about all development around libVLC.
thatguyandrew1992
New Cone
New Cone
Posts: 4
Joined: 17 May 2008 19:03

How to display text on screen?

Postby thatguyandrew1992 » 26 Jul 2014 02:02

Hey all,
I'm new to using lib vlc. I am currently using it with Python. I would like to display text over the video for X amount of time then have it disappear.

Is this possible?

Now I did see something called marquee text. I'm not 100% sure what this is, but I m guessing it will scroll text across the screen? I'd rather it not move, but I can use it if need be.

If I am right about marquee text and it's my only option, could someone tell me why the following code isn't working? No text appears

Code: Select all

#Create the player self.player = self.Instance.media_player_new() self.player.video_set_marquee_int(0, 1) #Enable self.player.video_set_marquee_int(3, 0) #Opccity NOTE: I also tried, (3,1) I'm not sure what the second param should be self.player.video_set_marquee_int(6, 1000) # pixels size self.player.video_set_marquee_int(4, 0) #position self.player.video_set_marquee_int(5, 5000) #refresh millisec (or sec?) self.player.video_set_marquee_int(7, 0) #timeout millisec, 0==forever self.player.video_set_marquee_int(8, 1000) #x self.player.video_set_marquee_int(9, 500) #y t = "testtttttttttttttttttttttttttttttttttttt" t = t.encode(sys.getfilesystemencoding()) self.player.video_set_marquee_string(1, t)

RSATom
Big Cone-huna
Big Cone-huna
Posts: 513
Joined: 24 Nov 2011 06:55
Operating System: Windows/Linux/OsX
Location: Russia, Tomsk

Re: How to display text on screen?

Postby RSATom » 26 Jul 2014 14:00

You have to:
1) pass "--sub-filter=marq" to libvlc_new
2) call set_marquee_int( libvlc_marquee_Enable, 1 );

thatguyandrew1992
New Cone
New Cone
Posts: 4
Joined: 17 May 2008 19:03

Re: How to display text on screen?

Postby thatguyandrew1992 » 27 Jul 2014 04:29

You have to:
1) pass "--sub-filter=marq" to libvlc_new
2) call set_marquee_int( libvlc_marquee_Enable, 1 );
Sadly, no luck
I tried self.Instance = vlc.Instance("--sub-source marq") and self.Instance = vlc.Instance("--sub-filter=marq")
and I have self.player.video_set_marquee_int(0, 1) #Enable

Is there anything else I can try?

OlivierAubert
Developer
Developer
Posts: 92
Joined: 08 Mar 2007 15:43

Re: How to display text on screen?

Postby OlivierAubert » 18 Nov 2014 15:14

Look at the __main__ part of the vlc.py module, it is an example application. You can see that it updates a marquee with the current time. As specified in the comment :

Code: Select all

# Some marquee examples. Marquee requires '--sub-source marq' in the # Instance() call above. See <http://www.videolan.org/doc/play-howto/en/ch04.html>


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 17 guests