Comments (6)
Hi
You should first try the basic loading of the vlc lib from a python
interpreter:
import ctypes
from ctypes.util import find_library
p = find_library('vlc')
dll = ctypes.CDLL(p)
dll.libvlc_get_version()
and see if it works.
Olivier
On Mon, 2016-11-21 at 01:25 -0800, lion6230i wrote:
Hi ,
I porting vlc library to mips platform and use vlc.py to test.
But have some error.
python vlc.py
Usage: vlc.py [options] <movie_filename>
Once launched, type ? for help.
Build date: Fri Oct 7 12:04:48 2016 (0x0)
Error: no function 'libvlc_get_version'
Could any one suggest me how to debug?
I have confirm libvlc.so have libvlc_get_version function.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
from python-vlc.
Hi Olivier,
Thanks for your reply.
I try the command step by step ,
python
Python 2.7.6 (default, Nov 16 2016, 11:18:53)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import ctypes
from ctypes.util import find_library
p = find_library('vlc')
dll = ctypes.CDLL(p)
dll.libvlc_get_version()
Traceback (most recent call last):
File "", line 1, in
File "/media/python_nfs/lib/python2.7/ctypes/init.py", line 378, in getattr
func = self.getitem(name)
File "/media/python_nfs/lib/python2.7/ctypes/init.py", line 383, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: Unable to resolve symbol
Is it mean python can't find my libvlc.so ?
I have set LD_LIBRARY_PATH before I run python.
from python-vlc.
python seems to find libvlc.so (else it would fail at the ctypes.CDLL
line). Maybe your symbol names are mangled in the lib ? You should
check with
readelf -Ws /path/to/libvlc.so
or
objdump -TC /path/to/libvlc.so
If the symbol information is correct, then maybe it has to do with the
arch. You should then investigate ctypes on mips, by for instance
building a minimal lib with a unique symbol.
Olivier
On Mon, 2016-11-21 at 02:23 -0800, lion6230i wrote:
Hi Olivier,
Thanks for your reply.
I try the command step by step ,
python
Python 2.7.6 (default, Nov 16 2016, 11:18:53)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
import ctypes
from ctypes.util import find_library
p = find_library('vlc')
dll = ctypes.CDLL(p)
dll.libvlc_get_version()
Traceback (most recent call last):
File "", line 1, in
File "/media/python_nfs/lib/python2.7/ctypes/init.py", line 378, in
getattr
func = self.getitem(name)
File "/media/python_nfs/lib/python2.7/ctypes/init.py", line 383, in
getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: Unable to resolve symbol
Is it mean python can't find my libvlc.so ?
I have set LD_LIBRARY_PATH before I run python.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
from python-vlc.
Hi Olivier,
I dump symbol information in library , it's correct.
[root@localhost lib]# objdump -TC libvlc.so|grep vlc_get_version
00005954 g DF .text 00000018 Base libvlc_get_version
Then I try the command in below:
python
Python 2.7.6 (default, Nov 16 2016, 11:18:53)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from ctypes import *
cdll.LoadLibrary("libc.so.0")
<CDLL 'libc.so.0', handle 43d838 at 2b396410>
libc = CDLL("libc.so.0")
libc.printf
<_FuncPtr object at 0x2b38b260>
libc.printf("lion debug")
lion debug10
Does it mean ctypes work fine on mips?
from python-vlc.
So it seems ctypes is working on mips, and you have the correct symbol
in libvlc. Maybe the ctypes.util.find_library does not find the
appropriate library, could you check the output?
Olivier
On Mon, 2016-11-21 at 17:33 -0800, lion6230i wrote:
Hi Olivier,
I dump symbol information in library , it's correct.
[root@localhost lib]# objdump -TC libvlc.so|grep vlc_get_version
00005954 g DF .text 00000018 Base libvlc_get_version
Then I try the command in below:
python
Python 2.7.6 (default, Nov 16 2016, 11:18:53)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
from ctypes import *
cdll.LoadLibrary("libc.so.0")
<CDLL 'libc.so.0', handle 43d838 at 2b396410>
libc = CDLL("libc.so.0")
libc.printf
<_FuncPtr object at 0x2b38b260>
libc.printf("lion debug")
lion debug10
Does it mean ctypes work fine on mips?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
from python-vlc.
Hi Olivier,
You are right. The problem case by find_library.
I modify vlc.py skip find_library step , load libvlc.so directly.
Then test it , it's works fine.
python vlc.py
lion debug 1
Usage: vlc.py [options] <movie_filename>
Once launched, type ? for help.
Build date: Fri Oct 7 12:04:48 2016 (0x0)
LibVLC version: 2.2.4 Weatherwax (0x2020400)
LibVLC compiler: gcc version 4.7.3 (Buildroot 2013.08-00907-ga7254e1)
I think , it's may cause by my platform do not have ldconfig.
Somebody said find_library will use ldconfig to look up where library can load.
Anyway thanks for your support.
from python-vlc.
Related Issues (20)
- name 'vlc' not defined HOT 15
- Wrapper for struct libvlc_event_t is Error HOT 1
- MediaListEndReached event is never triggered
- python-vlc about wasapi generic error: cannot activate client (error 0x88890004)
- Qt Video Frame opacity
- Integrating the vlc window in Qt with Wayland HOT 2
- Render to custom OpenGL texture HOT 3
- no more functionnal with the daily vlc
- disable the option audio "time-stretching audio" HOT 1
- Add type hints HOT 1
- Discord invite is expired
- 360 video interaction with mouse
- SyntaxWarning: invalid escape sequence HOT 2
- Using the argument 'vout=mmal_xsplitter' on vlc.Instance does not seem te have any effect
- Not every logs are triggering the callback given to "log_set" HOT 1
- The function get_time() fails to provide an acurrate time HOT 1
- how to draw button over vlc video in pyqt
- Type Error - libvlc_video_set_logo_string HOT 1
- vlc.Instance() returns None on MacOS Silicon HOT 27
- direct3d11 vout display error: SetThumbNailClip failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-vlc.