libvlc_new null when running inside Docker

This forum is about all development around libVLC.
liammartens
New Cone
New Cone
Posts: 5
Joined: 17 Mar 2019 23:31
Operating System: Linux
Contact:

libvlc_new null when running inside Docker

Postby liammartens » 17 Mar 2019 23:38

I have following basic sample code (just for testing in this case)

Code: Select all

#include <vlc/vlc.h> int main(int argc, char* argv[]) { libvlc_instance_t* inst = libvlc_new(0, NULL); printf("%p\n", inst); return 0; }
Now after building and running this on my host system (being Linux - specifically Ubuntu/Debian based) it runs fine and the VLC instance is created as expected. However when I run (and build) it inside a Docker container it is unable to create the vlc instance without showing any error or warning message.

For completion on this issue assume the Docker image looks something like this

Code: Select all

FROM debian:stretch RUN apt-get install libgtk-3-dev libgtk-3-0 libcurl4-openssl-dev sudo -y RUN apt-get install -y libvlc-dev RUN apt-get remove -y libgtk2.0-0 && apt-get autoremove -y RUN export uid=1000 gid=1000 && \ mkdir -p /home/developer && \ echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \ echo "developer:x:${uid}:" >> /etc/group && \ echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \ chmod 0440 /etc/sudoers.d/developer && \ chown ${uid}:${gid} -R /home/developer && \ chown ${uid}:${gid} -R /app USER developer
and is being run as follows

Code: Select all

docker run -e DISPLAY=:0.0 -v /tmp/.X11-unix:/tmp/.X11-unix -it my/image /bin/bash
Anyone any ideas?

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

Re: libvlc_new null when running inside Docker

Postby Rémi Denis-Courmont » 18 Mar 2019 16:04

libvlc_new() returns NULL if it cannot locate the VLC plugins.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

liammartens
New Cone
New Cone
Posts: 5
Joined: 17 Mar 2019 23:31
Operating System: Linux
Contact:

Re: libvlc_new null when running inside Docker

Postby liammartens » 18 Mar 2019 22:00

Argh of course, I only had the development files installed, very smart.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 3 guests