WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Python-VLC on tinycore  (Read 2362 times)

Offline Ripley

  • Newbie
  • *
  • Posts: 17
Python-VLC on tinycore
« on: July 20, 2022, 04:31:12 PM »
I'm creating a Mp3 player and I have been using Pygame to load and play the music, but due to some technical issues with Pygame I am trying other things.

I have found Python-vlc and want to give it a try. I am able to pip install Python-vlc onto tinycore successfully and import vlc, but when I attempt to create an instance of vlc I am given an error.

My code is:
Code: (bash) [Select]
import vlc as v
# creating vlc media player object
media = v.MediaPlayer("cats.mp4")
# start playing video
media.play()

And the final line of the error is: (I have to type it out by hand so I only put the final line, but If anyone needs the whole error, please say so)

Code: (bash) [Select]
NameError: no function 'libvlc_new'
This same error occurs if I write the line "v.Instance()" (which works fine on my pc)

I assume I don't have all the libraries required for VLC to work properly, though I assumed the pip install would give me everything I need.

If anyone could help me that would be great, thanks
« Last Edit: July 20, 2022, 04:53:30 PM by Ripley »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Python-VLC on tinycore
« Reply #1 on: July 21, 2022, 12:11:45 AM »
Hi Ripley
According to this:
https://stackoverflow.com/questions/41394040/unable-to-run-the-following-code-using-python-bindings-for-vlc
you also need to have  VLC Media Player  installed.

Offline Ripley

  • Newbie
  • *
  • Posts: 17
Re: Python-VLC on tinycore
« Reply #2 on: July 21, 2022, 12:50:01 AM »
That actually makes a lot of sense, thanks Rich.

I was looking through the fourms and saw that in the past VLC was not available for the raspberry pi on tinycore, and from what I can tell that still remains true.

Is there a way to install vlc (somewhat easily?).

Otherwise I will have to find an alternative, If there isn't a way to get vlc, does anyone have suggestions about what I should use instead? I need to be able to play audio files using python 3.10

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: Python-VLC on tinycore
« Reply #3 on: July 21, 2022, 03:02:16 AM »
The problem with vlc is that it uses qt5 for the gui and qt5 is very large.

I believe rhythmbox has a python interface and it uses gtk3 for the gui, which is available for piCore.

Offline Ripley

  • Newbie
  • *
  • Posts: 17
Re: Python-VLC on tinycore
« Reply #4 on: July 21, 2022, 12:53:16 PM »
Okay then I will refrain from using vlc.

The problem with rhythmbox is the python interface is very limited, the specific parts its missing (from what I could find researching) that I need it to do is 'get current song position' and 'set current song position'

And I have created my own GUI, so I can't use rhythmbox's

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Python-VLC on tinycore
« Reply #5 on: July 21, 2022, 02:30:22 PM »
Hi Ripley
Maybe  mpg123.tcz  or  ffmpeg.tcz  would be suitable. Google returns results for both with respect to Python.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: Python-VLC on tinycore
« Reply #6 on: July 22, 2022, 04:39:47 AM »
Looking at the latest vlc, it seems it will build without qt5, but I'm not sure I see a python interface?
« Last Edit: July 22, 2022, 12:05:10 PM by Juanito »

Offline Ripley

  • Newbie
  • *
  • Posts: 17
Re: Python-VLC on tinycore
« Reply #7 on: July 23, 2022, 10:53:18 AM »
within python you can pip install python's binding for vlc with the following code:
Code: (python) [Select]
pip install python-vlc That package has everything I need, but I need to get vlc on my PiCore

How would one go about getting vlc on PiCore without the qt5?

Also thanks Rich for the suggestions, but mpg123 and ffmpeg doesn't have all the python bindng I need for this project

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: Python-VLC on tinycore
« Reply #8 on: July 23, 2022, 11:27:07 AM »
(coincidentally) cli version of vlc posted.