Requesting help on Raspbian for python vlc playing audio -
Posted: 16 Aug 2020 22:37
Hello,
I'll share replication steps at the bottom but moreso just wanted to share general complaints about what a nightmare it has been to try to understand how to use libvlc / vlc in python3 implementation for running a script to play any ICY webcast / http stream. Just hoping for some guidance on how this could be setup for a simple implementation to play audio.
I've been debugging this for over a week now, I've reviewed all the following sources, giving some notes. I'll note that I am using VLC 3.0.11-0+deb10u1+rpt2 [from apt install vlc] Raspbian 5.4.51+ which is based on Debian. I'm using alsa for audio. I do understand that this is meant to be cross-platform with lots of support for different OS and different coding languages and that the python implementation is only managed by one volunteer. So these complaints may not be fair but I'm just throwing this out into the ether hoping someone has some more experience with this.
This works perfectly on command line "out of the box" all I have to do is run [apt install vlc]: --but hitting tons of modules issues in python script. I think the main thing is that its using pulseaudio even if I set output to alsa.
vlc -I dummy http://s1.voscast.com:8652/
A bit more detailed query: how can I do a simple implementation of vlc in python on Raspberry Pi in a python script, and ensure that I am loading all needed modules? The biggest issue that I've run into is that there are a lot of conflicting information about how to build and manage the vlc package dependencies/modules and configure them, and I haven't seen one single clear example of how to do it from start to finish. Whatever I'm doing, its not properly pulling in needed submodules like http and demuxers for audio and whatnot. More notes on information out there:
https://pypi.org/project/python-vlc/
- just says to use apt to install it, ok I tried that
https://wiki.videolan.org/python_bindings
- links to other locations such as below
https://git.videolan.org/?p=vlc/binding ... es;hb=HEAD
- these "helpful examples" are extremely technical and its unclear if these are meant to be sub-scripts that then you can call on for other functionality, or if these are actual examples of the implementation. Obviously I'm not a full time python developer and it seems that's the only target audience, because this is unreadable to anyone who isn't an expert already
https://git.videolan.org/?p=vlc/binding ... README.rst
- information on building from source, the VLC package on Raspbian
https://github.com/oaubert/python-vlc
- the github repo of the project owner for python vlc, I've read through the main docs on his site as well as many of the issues sections here, some halfway decent examples but nothing that provides a full clear example
So I've tried:
- multiple version of libvlc, vlc, libvlc-dev, etc, moving vlc.py into the same directory as my main script... tons of different command line options... nothing.
Seems all I should have to do is:
# apt install vlc
# sudo apt install python3-pip
# pip3 install python-vlc
Then I should have access to all the libvlc stuff from python-vlc module... but not sure if its working.
I can easily replicate by following this blog post [https://linuxconfig.org/how-to-play-aud ... -in-python] and at this point I'm thinking
- I'm hitting a raspberry Pi specific issue
- using python vlc is **NOT** the same thing as just using vlc in the command line, but I don't understand how/why
More logs in next post...
I'll share replication steps at the bottom but moreso just wanted to share general complaints about what a nightmare it has been to try to understand how to use libvlc / vlc in python3 implementation for running a script to play any ICY webcast / http stream. Just hoping for some guidance on how this could be setup for a simple implementation to play audio.
I've been debugging this for over a week now, I've reviewed all the following sources, giving some notes. I'll note that I am using VLC 3.0.11-0+deb10u1+rpt2 [from apt install vlc] Raspbian 5.4.51+ which is based on Debian. I'm using alsa for audio. I do understand that this is meant to be cross-platform with lots of support for different OS and different coding languages and that the python implementation is only managed by one volunteer. So these complaints may not be fair but I'm just throwing this out into the ether hoping someone has some more experience with this.
This works perfectly on command line "out of the box" all I have to do is run [apt install vlc]: --but hitting tons of modules issues in python script. I think the main thing is that its using pulseaudio even if I set output to alsa.
vlc -I dummy http://s1.voscast.com:8652/
A bit more detailed query: how can I do a simple implementation of vlc in python on Raspberry Pi in a python script, and ensure that I am loading all needed modules? The biggest issue that I've run into is that there are a lot of conflicting information about how to build and manage the vlc package dependencies/modules and configure them, and I haven't seen one single clear example of how to do it from start to finish. Whatever I'm doing, its not properly pulling in needed submodules like http and demuxers for audio and whatnot. More notes on information out there:
https://pypi.org/project/python-vlc/
- just says to use apt to install it, ok I tried that
https://wiki.videolan.org/python_bindings
- links to other locations such as below
https://git.videolan.org/?p=vlc/binding ... es;hb=HEAD
- these "helpful examples" are extremely technical and its unclear if these are meant to be sub-scripts that then you can call on for other functionality, or if these are actual examples of the implementation. Obviously I'm not a full time python developer and it seems that's the only target audience, because this is unreadable to anyone who isn't an expert already
https://git.videolan.org/?p=vlc/binding ... README.rst
- information on building from source, the VLC package on Raspbian
https://github.com/oaubert/python-vlc
- the github repo of the project owner for python vlc, I've read through the main docs on his site as well as many of the issues sections here, some halfway decent examples but nothing that provides a full clear example
So I've tried:
- multiple version of libvlc, vlc, libvlc-dev, etc, moving vlc.py into the same directory as my main script... tons of different command line options... nothing.
Seems all I should have to do is:
# apt install vlc
# sudo apt install python3-pip
# pip3 install python-vlc
Then I should have access to all the libvlc stuff from python-vlc module... but not sure if its working.
I can easily replicate by following this blog post [https://linuxconfig.org/how-to-play-aud ... -in-python] and at this point I'm thinking
- I'm hitting a raspberry Pi specific issue
- using python vlc is **NOT** the same thing as just using vlc in the command line, but I don't understand how/why
More logs in next post...