Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does vlc.py play video stream?

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 ?

like image 449
why Avatar asked Feb 21 '12 05:02

why


People also ask

How does VLC stream work?

The VLC streaming player from the VideoLAN Organization is an open-source audio and video player. The player will play video or audio files stored locally on your hard drive, and will also play streaming audio and video from a local network or the internet.

Can VLC play streaming video?

VLC includes a fairly easy-to-use streaming feature that can stream music and videos over a local network or the Internet. You can tune into the stream using VLC or other media players. Use VLC's web interface as a remote control to control the stream from elsewhere.

What is the use of Python VLC?

The VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. VLC is available for desktop operating systems and mobile platforms, such as Android, iOS, iPadOS, Tizen, Windows 10 Mobile, and Windows Phone.


1 Answers

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.

like image 137
Steinar Lima Avatar answered Nov 15 '22 15:11

Steinar Lima