Tip: How to Marquee in Python (and pitfalls)

This forum is about all development around libVLC.
Vhati
Blank Cone
Blank Cone
Posts: 16
Joined: 06 Apr 2011 08:07

Tip: How to Marquee in Python (and pitfalls)

Postby Vhati » 29 Sep 2012 19:28

For the curious, here's how I eventually got Marquee working with the Python Bindings (2012-09-28) and VLC 2.0.2.

Code: Select all

# Gotta mention marq in the instance for marquee methods to work. # Gotta show title for marquee to be visible*. With a 1ms timeout to effectively hide the title. # Verbose -1 suppresses marquee log spam about "vlc_object_find_name" not being safe. self.vlc_obj = vlc.Instance("--video-title-show --video-title-timeout 1 --sub-source marq --verbose -1") self.vlc_player.video_set_marquee_int(vlc.VideoMarqueeOption.Position, vlc.Position.Bottom) self.vlc_player.video_set_marquee_int(vlc.VideoMarqueeOption.Timeout, 6*1000) # ... self.vlc_player.video_set_marquee_string(vlc.VideoMarqueeOption.Text, "Hello World")
If an important bit is missing, messages will be invisible or, at best, a message set on startup will disappear almost instantly when first playing.

Weirdly, I've never gotten vlc_media.add_option() to do anything.

Enabling marquee on an existing instance (one that lacked the sub-source arg) didn't work either.

Code: Select all

self.vlc_player.video_set_marquee_int(vlc.VideoMarqueeOption.Enable, 1)

* The marquee+title bug

Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests