Page 1 of 1

libvlc_new null when running inside Docker

Posted: 17 Mar 2019 23:38
by liammartens
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?

Re: libvlc_new null when running inside Docker

Posted: 18 Mar 2019 16:04
by RĂ©mi Denis-Courmont
libvlc_new() returns NULL if it cannot locate the VLC plugins.

Re: libvlc_new null when running inside Docker

Posted: 18 Mar 2019 22:00
by liammartens
Argh of course, I only had the development files installed, very smart.