How does vlc.py play video stream?

why picture why · Feb 21, 2012 · Viewed 26.9k times · Source

I want to use vlc.py to play mpeg2 stream http://wiki.videolan.org/Python_bindings.

There are some examples here: http://git.videolan.org/?p=vlc/bindings/python.git;a=tree;f=examples;hb=HEAD

When I run the examples, it just can play video file, I want to know is there any examples to play video stream ?

Answer

Steinar Lima picture Steinar Lima · Oct 21, 2013

According to this Pastebin entry, linked to in this mailing list, it can be solved using a method like this:

import vlc
i = vlc.Instance('--verbose 2'.split())
p = i.media_player_new()
p.set_mrl('rtp://@224.1.1.1')
p.play()

I haven't tried it though, so please let me know if it works.