Closed davidonet closed 9 years ago
Hi. This is a libvlc limitation. As mentioned (briefly I admit) in the doc http://olivieraubert.net/vlc/python-ctypes/doc/vlc.Media-class.html#add_option "Not all options affects Media objects: Specifically, due to architectural issues most audio and video options, such as text renderer options, have no effects on an individual media. These options must be set through libvlc_new() instead". I reflected this warning in some other places where it applies too.
Unless I'm just missing something, options don't seem to work at all:
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GdkX11', '3.0')
from gi.repository import Gtk, GLib, GdkX11
import sys
vlc_options = "vout-filter=invert"
import vlc; VLC = vlc.Instance(vlc_options)
widget = Gtk.DrawingArea()
player = VLC.media_player_new(vlc_options)
def handle_embed(*args):
win = widget.get_window()
if sys.platform == 'win32':
# XXX probably doesn't work
player.set_hwnd(win.get_hwnd())
else:
player.set_xwindow(win.get_xid())
return True
widget.connect('map', handle_embed)
win = Gtk.Window()
win.connect('delete-event', Gtk.main_quit)
win.add(widget)
win.show_all()
media = VLC.media_new(sys.argv[1], vlc_options)
player.set_media(media)
player.play()
Gtk.main()
Here I pass the options in three separate places and still they aren't applied on any video.
There are 2 issues in your code:
Try the following:
player = vlc.MediaPlayer(vlc.Instance("--video-filter=invert"))
player.set_mrl(sys.argv[1])
Did this work? I am having the same issues and it' incredibly frustrating. I have compiled VLC to run with openMAX IL video output on the Raspberry pi and Raspbian. It runs well from the VLC application but I cannot get it to run with this option from python. I have tried the suggested method above. I have also tried using vlc.libvlc_new( options ) but nothing appears to work. VLC runs but with the default options which is no good. Is it possible to get python-vlc running with '--vout=omxil_vout'? as an option? It appers to just get ignored.
show no difference with