Transcode and stream over http with python

This forum is about all development around libVLC.
postelrich
New Cone
New Cone
Posts: 3
Joined: 22 Jan 2016 00:46

Transcode and stream over http with python

Postby postelrich » 22 Jan 2016 00:59

I'm new to VLC and trying to use it transcode and stream video over http. I figured out how to do this from the command line but having trouble figuring how to do this with the python lib.

Here's the command:

Code: Select all

C:\Program Files\VideoLAN\VLC\vlc.exe" hannibal.mkv --sout="#transcode{vcodec=theo,vb=1024,channels=2,samplerate=44100,ab=128,acodec=vorb}:http{mux=ogg,dst=:8080/hannibal.ogg}" :sout-all :sout-keep -I dummy
Here's what I have in python:

Code: Select all

import vlc inst = vlc.Instance() med = inst.media_new("D:\\Rich\\Videos\\hannibal.mkv", "sout=#transcode(vcodec=theo,vb=1024,channels=2,samplerate=44100,ab=128,acodec=vorb):http(mux=ogg,dst=:8080/hannibal.ogg)", "sout-all", "sout-keep", "I=dummy") p = med.player_new_from_media() p.play()
That's as best as I've been able to figure out from the docs and examples. This just causes a window to open to play the video. What's the proper way to do this?

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Transcode and stream over http with python

Postby Rémi Denis-Courmont » 23 Jan 2016 01:54

Not familiar with the Python bindings but missing colons, maybe?
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

postelrich
New Cone
New Cone
Posts: 3
Joined: 22 Jan 2016 00:46

Re: Transcode and stream over http with python

Postby postelrich » 24 Jan 2016 05:56

I figured out what I believe is the correct way:

Just need to start instance with the params:

Code: Select all

inst = vlc.Instance("""--sout=#transcode{vcodec=theo,vb=1024,channels=2,samplerate=44100,ab=128,acodec=vorb}:http{mux=ogg,dst=:8080/stream} :sout-all :sout-keep -I dummy""")


Return to “Development around libVLC”

Who is online

Users browsing this forum: JimiFA and 26 guests