oaubert / python-vlc

Python vlc bindings
GNU Lesser General Public License v2.1
381 stars 108 forks source link

Type Error - libvlc_video_set_logo_string #272

Open Amaanboon opened 5 months ago

Amaanboon commented 5 months ago

I am trying to display a logo using VideLogoOption

vlc.libvlc_video_set_logo_int(pi,vlc.VideoLogoOption.logo_enable,1)
vlc.libvlc_video_set_logo_string(pi,vlc.VideoLogoOption.logo_file,"Media/GUI.png")

Error: "argument 3: TypeError: wrong type" error error

How to pass the file path?

mrJean1 commented 5 months ago

Take a look at the cocoavlc.py example, specifically the method AppVLC._VLClogo on line 568.

Here is a copy of that method. The logostr argument is the file name of the logo image.

    def _VLClogo(self, logostr):
        # add a video logo image, example "... -logo
        p = self.player
        g = vlc.VideoLogoOption  # Enum
        # <https://Wiki.VideoLan.org/Documentation:Modules/logo>
        _g_int = p.video_set_logo_int
        _g_int(g.logo_enable, 1)
        _g_int(g.logo_position, 0)  # FIXME: 0 == vlc.Position.center.value
        _g_int(g.logo_opacity, 128)  # 0-255
        # _g_int(g.logo_delay, 1000)  # millisec
        # _g_int(g.logo_repeat, -1)  # forever
        p.video_set_logo_string(g.logo_file, logostr)