python-vlc http streaming doesn't work but same args work fine from CLI

This forum is about all development around libVLC.
wikipediant
New Cone
New Cone
Posts: 1
Joined: 22 Aug 2021 22:25

python-vlc http streaming doesn't work but same args work fine from CLI

Postby wikipediant » 22 Aug 2021 22:38

Hi guys,

I've been trying to get python-vlc to take a simple .mp3 file and push it out via an http stream on a Raspberry Pi 3, running Raspberry Pi OS. For some reason, if I run the following CLI command, it works just fine:

Code: Select all

vlc ./test.mp3 --verbose 3 --no-video --sout '#transcode{vcodec=none,acodec=mp3}:std{mux=mp3,dst=:8080/stream,access=http}' --sout-all --sout-keep --loop

I can connect to that stream without any issues. However, when I try to execute the following python code, it doesn't work:

Code: Select all

import vlc instance = vlc.Instance("--verbose 3 --no-video --sout '#transcode{vcodec=none,acodec=mp3}:std{mux=mp3,dst=:8080/stream,access=http}' --sout-all --sout-keep --loop") player = instance.media_player_new() media = instance.media_new('/code/fiddling/test.mp3') player.set_media(media) player.play() while True: pass

In the debug output, I can see when I run it from CLI, there are lots of lines referring to avcodec encoder, however when I run the python version, I don't see any of this, it just tries to push the audio out via alsa. It's got me tearing my hair out somewhat as I don't fully understand why the python version seems to be ignoring the fact I want to stream.


It's got me stumped, so I would be appreciative for any assistance.

Cheers,

Lachlan.

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

Re: python-vlc http streaming doesn't work but same args work fine from CLI

Postby Rémi Denis-Courmont » 23 Aug 2021 22:25

Streaming output is not yet supported in LibVLC. For the time being, you need to spawn a child VLC process as the shell does.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 3 guests