Tip: How to Marquee in Python (and pitfalls)
Posted: 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.
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.
* The marquee+title bug
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")
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