Page 1 of 1

LibVLC_SampleCode_SDL - no codec is supported?

Posted: 17 Feb 2019 00:07
by Domarius
Just trying to get the code working from here https://wiki.videolan.org/LibVLC_SampleCode_SDL/ I am compiling on Ubuntu 18.04.1 LTS and have installed libsdl2-dev and libvlc-dev, and am linking with -lSDL2 -lvlc (I have also installed VLC itself since apparently on Linux you need to do that to make the plugins available).

Any video file I throw at it, it displays an error saying the codec isn't supported for that format - but I commented out the line that disables sound, and the sound does play at least. But the window remains black.

Here is the output I'm getting. If anyone can tell me how to enable logging, I'll do it. (I couldn't find out how from searching the net.)

I notice it keeps saying VLC_PLUGIN_PATH=(null), what can I do about that?

Code: Select all

$ ./test agro.mp4 VLC_PLUGIN_PATH=(null) [00007f7ed81153c0] main decoder error: Codec `h264' (H264 - MPEG-4 AVC (part 10)) is not supported. [00007f7ed81153c0] main decoder error: Codec not supported [00007f7ed81153c0] main decoder error: VLC could not decode the format "h264" (H264 - MPEG-4 AVC (part 10)) $ ./test test.mov VLC_PLUGIN_PATH=(null) [00007f22d833acf0] main decoder error: Codec `h264' (H264 - MPEG-4 AVC (part 10)) is not supported. [00007f22d833acf0] main decoder error: Codec not supported [00007f22d833acf0] main decoder error: VLC could not decode the format "h264" (H264 - MPEG-4 AVC (part 10)) $ ./test "bonus body language disc.avi" VLC_PLUGIN_PATH=(null) [00007f65f8027c50] main decoder error: Codec `mp4v' (MPEG-4 Video) is not supported. [00007f65f8027c50] main decoder error: Codec not supported [00007f65f8027c50] main decoder error: VLC could not decode the format "mp4v" (MPEG-4 Video)

Re: LibVLC_SampleCode_SDL - no codec is supported?

Posted: 17 Feb 2019 05:43
by mfkl
apt-get install vlc?

Re: LibVLC_SampleCode_SDL - no codec is supported?

Posted: 17 Feb 2019 17:55
by Jean-Baptiste Kempf
libavcodec missing?

Re: LibVLC_SampleCode_SDL - no codec is supported?

Posted: 18 Feb 2019 07:37
by Domarius
apt-get install vlc?
Yes, installed. As stated, I already installed VLC, both through the Software Center, and the terminal as well (with that very command) just to be sure.
libavcodec missing?
Well libavcodec57 appears to be installed, after I used this command I found to determine what codecs are installed.

Code: Select all

domarius@Domarius-Ubuntu ~/$ aptitude search codec | egrep ^i i A chromium-codecs-ffmpeg-extra - Extra ffmpeg codecs for the Chromium Browser i A libavcodec57 - FFmpeg library with de/encoders for audio/video codecs - runtime files idA libcommons-codec-java - encoder and decoders such as Base64 and hexadecimal codec i A libkf5codecs-data - collection of methods to manipulate strings i A libkf5codecs5 - collection of methods to manipulate strings i A libopencv-imgcodecs3.2 - computer vision Image Codecs library
Tellingly, my Python version of this test program (using vlc.py) plays videos just fine - so clearly I must have the codecs installed correctly!

Re: LibVLC_SampleCode_SDL - no codec is supported?

Posted: 18 Feb 2019 15:05
by Jean-Baptiste Kempf
vlc --list | grep avcodec

Re: LibVLC_SampleCode_SDL - no codec is supported?

Posted: 18 Feb 2019 22:32
by Domarius
This is the output I get;

Code: Select all

domarius@Domarius-Ubuntu ~ $ vlc --list | grep avcodec VLC media player 3.0.4 Vetinari (revision 3.0.4-0-gf615db6332) avcodec FFmpeg audio/video decoder avcodec FFmpeg audio/video decoder avcodec FFmpeg audio/video decoder avcodec FFmpeg audio/video encoder vdpau_avcodec VDPAU video decoder
I don't think it's a missing codec that's the issue, because my Python version works.

Ok I've just done some more experimenting... I think I've finally narrowed down the problem as much as I can. New thread (third time lucky...)