[Guide] Install Gstreamer, FFmpeg and mpv (with youtube-dl)

Well unsure where to post it, but since it’s actually more about using what exists i will post it here.

Since Debian is stretch and only have gstreamer 1.10 (which is not enough for gstreamer-rockchip which require >=1.12) and I have failed at building gstreamer (maybe some library links broken after all) here is a guide how to to do it with Ubuntu Server we have.
Gstreamer can be fullscreen and windowed, mpv only fullscreen.

Preparation:

  1. I’m gonna install full Desktop (but using mpv should be possible even without Desktop, because mpv will be anyway only Fullscreen). To do this do sudo su apt-get update && apt-get upgrade && unminimize && reboot, then after it’s rebooted install Desktop you prefer (aka, Ubuntu Mate), after Armbian i prefer xfce4 (which I’m gonna install). Do this apt-get install xfce4 xfce4-goodies then reboot.
    After this you still will boot in console, from there you have two options, or use root as default user or just default user. Since most of times you will still need root to do most things I use first choice (if you prefer second skip next command).sudo su startx. After this you will boot in xfce4 environment (if you choose to use just default user from there you will need to add sudo to each command, or do sudo su in terminal window where you type all this)

  2. Additional steps:
    To use network share you will need to do apt-get install samba gvfs-*. To get default (in Application start menu) shortcuts to work you will need to generate all locales.
    To do this do dpkg-reconfigure locales, then select All locales then select your own locale (most likely en_US.UTF-8 UTF-8).

  3. Now time to get all necessary libraries.
    Do

apt-get install libqt5opengl5 libqt5qml5 libqt5quick5 libqt5widgets5 libqt5gui5 libqt5core5a qml-module-qtquick2 libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediaquick-p5 qtmultimedia5-examples qtmultimedia5-doc-html pkg-config gcc make git unzip wget xz-utils cmake devscripts equivs build-essential docutils-common mercurial cmake-curses-gui yasm mercurial gcc-arm-linux-gnueabi g++-arm-linux-gnueabi texinfo nasm automake gstreamer1.0-tools qtgstreamer-plugins-qt5 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps glib-2.0 libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk2.0-dev libperl-dev libglib2.0-dev jack libass-dev libfdk-aac-dev fdkaac aac-enc libfdk-aac1 autoconf automake git-core libfreetype6-dev libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev zlib1g-dev libx264-dev libx265-dev libnuma-dev libvpx-dev libmp3lame-dev libopus-dev mc locate libghc-bzlib-dev speex libspeex-dev alsa gstreamer1.0-alsa libssl-dev

  1. Time to download all necessary apps. Do
    mkdir video && cd video && git clone -b master https://github.com/rockchip-linux/libmali && git clone https://github.com/rockchip-linux/mpp && git clone -b master https://github.com/rockchip-linux/gstreamer-rockchip && git clone https://github.com/rockchip-linux/gstreamer-rockchip-extra && git clone https://github.com/mpv-player/mpv-build && git clone -b master https://github.com/FFmpeg/FFmpeg && git clone -b master https://github.com/mpv-player/mpv && git -C aom pull 2> /dev/null || git clone --depth 1 https://aomedia.googlesource.com/aom && mkdir aom_build

  2. We need to patch drm_fourcc.h to be able to play 10bits video, to do this do

find /usr/include/ -name drm_fourcc.h -exec sed -i "143 i #define DRM_FORMAT_NV12_10\ fourcc_code('N', 'A', '1', '2') /* 2x2 subsampled Cr:Cb plane */\n#define DRM_FORMAT_NV21_10 fourcc_code('N', 'A', '2', '1') /* 2x2 subsampled Cb:Cr plane */\n#define DRM_FORMAT_NV16_10 fourcc_code('N', 'A', '1', '6') /* 2x1 subsampled Cr:Cb plane */\n#define DRM_FORMAT_NV61_10 fourcc_code('N', 'A', '6', '1') /* 2x1 subsampled Cb:Cr plane */\n#define DRM_FORMAT_NV24_10 fourcc_code('N', 'A', '2', '4') /* non-subsampled Cr:Cb plane */\n#define DRM_FORMAT_NV42_10 fourcc_code('N', 'A', '4', '2') /* non-subsampled Cb:Cr plane */" {} +

  1. Next step is to add all this codes to gstreamer-rockchip (we have them here, why don’t add them for gstreamer too?)

find ./gstreamer-rockchip -name rkx_kmsutils.c -exec sed -i "67 i \ DEF_FMT (NV21_10, P010_10LE),\n DEF_FMT (NV21_10, P010_10LE),\n DEF_FMT (NV16_10, P010_10LE),\n DEF_FMT (NV61_10, P010_10LE),\n DEF_FMT (NV24_10, P010_10LE),\n DEF_FMT (NV42_10, P010_10LE),\n" {} +

find ./gstreamer-rockchip-extra -name rkx_kmsutils.c -exec sed -i "64 i \ DEF_FMT (NV21_10, P010_10LE),\n DEF_FMT (NV21_10, P010_10LE),\n DEF_FMT (NV16_10, P010_10LE),\n DEF_FMT (NV61_10, P010_10LE),\n DEF_FMT (NV24_10, P010_10LE),\n DEF_FMT (NV42_10, P010_10LE),\n" {} +

find ./gstreamer-rockchip-extra -name gstkmsutils.c -exec sed -i "64 i \ DEF_FMT (NV21_10, P010_10LE),\n DEF_FMT (NV21_10, P010_10LE),\n DEF_FMT (NV16_10, P010_10LE),\n DEF_FMT (NV61_10, P010_10LE),\n DEF_FMT (NV24_10, P010_10LE),\n DEF_FMT (NV42_10, P010_10LE),\n" {} +

Now all preparation are completed.

  1. To build gstreamer do this:

cd libmali && cmake CMakeLists.txt && make -j6 && make install && ldconfig && LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib && LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/include && cd ../mpp && cmake -DRKPLATFORM=ON -DHAVE_DRM=ON && make -j6 && make install && cd ../gstreamer-rockchip && ./autogen.sh && make -j6 && make install && ldconfig && cd ../gstreamer-rockchip-extra && ./autogen.sh && make clean && make -j6 && make install && ldconfig && cd ..

  1. To test result
    gst-inspect-1.0 --gst-plugin-path=/usr/local/lib/gstreamer-1.0 rkximage
    Expected output:

Plugin Details:
Name rkximage
Description Rockchip X/DRM Video Sink
Filename /usr/local/lib/gstreamer-1.0/libgstrkximage.so
Version 1.1.0
License GPL
Source module gstreamer-rockchip-extra
Binary package GStreamer Plug-ins source release
Origin URL Unknown package origin

rkximagesink: Video sink

1 features:
±- 1 elements

  1. to use gst-play-1.0 you will need to do
    gst-play-1.0 --gst-plugin-path=/usr/local/lib/gstreamer-1.0 --videosink=rkximagesink <videofile>

  2. to use QT player you will need to do this command
    env GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink /usr/lib/aarch64-linux-gnu/qt5/examples/multimediawidgets/player/player
    This will start player which can be also fullscreen

  3. Now about ffmpeg+mpv. First we gonna install everything mpv wanna see to do this do

cd mpv-build && mk-build-deps -s -i && dpkg --unpack *.deb && apt-get install -f -y && cd ..

  1. For most complete installation of ffmpeg i will include aom in it, so to build ffmpeg we first need to build aom. To do this do

cd aom_build && cmake -G "Unix Makefiles" ../aom && make -j6 && make install && cd ..

  1. Now to ffmpeg. To build ffmpeg do this (this will take a bit of time)
first this

./configure \
--arch="aarch64" \
--extra-libs="-Lpthread -Lm" \
--disable-debug \
--enable-libaom \
--enable-stripping \
--enable-gpl \
--enable-nonfree \
--enable-logging \
--disable-doc \
--enable-pic \
--enable-optimizations \
--enable-ffmpeg \
--enable-avdevice \
--enable-avcodec \
--enable-avformat \
--enable-swscale \
--enable-postproc \
--enable-avfilter \
--disable-devices \
--enable-pthreads \
--disable-w32threads \
--enable-network \
--disable-gnutls \
--disable-gray \
--enable-swscale-alpha \
--disable-small \
--enable-dct \
--enable-fft \
--enable-mdct \
--enable-rdft \
--disable-crystalhd \
--disable-vaapi \
--disable-vdpau \
--enable-rkmpp \
--enable-libdrm \
--enable-version3 \
--enable-runtime-cpudetect \
--enable-hardcoded-tables \
--enable-encoder=ac3 \
--enable-encoder=aac \
--enable-encoder=wmav2 \
--enable-encoder=mjpeg \
--enable-encoder=png \
--enable-hwaccels \
--enable-muxer=spdif \
--enable-muxer=adts \
--enable-muxer=asf \
--enable-muxer=ipod \
--enable-muxer=mpegts \
--enable-demuxers \
--enable-parsers \
--enable-bsfs \
--enable-filters \
--enable-bzlib \
--enable-libspeex \
--enable-libx264 \
--enable-libx265 \
--enable-zlib \
--enable-asm \
--enable-neon \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-openssl

then make -j6 && make install && ldconfig && cd ..

  1. Now only mpv left. To build mpv do this

cd mpv && wget -q --show-progress --no-use-server-timestamps http://www.freehackers.org/~tnagy/release/waf-2.0.13 && mv waf-* waf && chmod u+x waf && ./waf configure --enable-egl-drm && ./waf build -j6 && ./waf install && ldconfig && cd …

  1. With this you should have gstreamer and mpv. Now we need to create shortcuts (so there will be no need to type commands over and over again). To do this do:
For mpv

rm /usr/local/share/applications/mpv.desktop

echo "[Desktop Entry]
Type=Application
Name=MPV
Icon=mpv
Exec=mpv --hwdec=rkmpp --vo=gpu --gpu-api=opengl --gpu-context=drm – %f
Icon=/usr/share/icons/gnome/48x48/categories/applications-multimedia.png
Terminal=true
Categories=AudioVideo;Audio;Player;Video;TV;
MimeType=application/ogg;application/x-ogg;application/mxf;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/aiff;audio/x-aiff;audio/m4a;audio/x-m4a;application/x-extension-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/mpeg2;audio/mpeg3;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/musepack;audio/x-musepack;audio/ogg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg2;video/x-mpeg3;video/mp4v-es;video/x-m4v;video/mp4;application/x-extension-mp4;video/divx;video/vnd.divx;video/msvideo;video/x-msvideo;video/ogg;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;audio/x-ms-asf;application/vnd.ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-flic;video/fli;video/x-flc;video/flv;video/x-flv;video/x-theora;video/x-theora+ogg;video/x-matroska;video/mkv;audio/x-matroska;application/x-matroska;video/webm;audio/webm;audio/vorbis;audio/x-vorbis;audio/x-vorbis+ogg;video/x-ogm;video/x-ogm+ogg;application/x-ogm;application/x-ogm-audio;application/x-ogm-video;application/x-shorten;audio/x-shorten;audio/x-ape;audio/x-wavpack;audio/x-tta;audio/AMR;audio/ac3;audio/eac3;audio/amr-wb;video/mp2t;audio/flac;audio/mp4;application/x-mpegurl;video/vnd.mpegurl;application/vnd.apple.mpegurl;audio/x-pn-au;video/3gp;video/3gpp;video/3gpp2;audio/3gpp;audio/3gpp2;video/dv;audio/dv;audio/opus;audio/vnd.dts;audio/vnd.dts.hd;audio/x-adpcm;application/x-cue;audio/m3u;
X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb" > /usr/local/share/applications/mpv.desktop

For gst-play-1.0

echo "[Desktop Entry]
Type=Application
Name=gst-play
Icon=mpv
Exec=gst-play-1.0 --gst-plugin-path=/usr/local/lib/gstreamer-1.0 --videosink=rkximagesink – %f
Icon=/usr/share/icons/gnome/48x48/categories/applications-multimedia.png
Terminal=true
Categories=Qt;AudioVideo;Player;Video;
MimeType=application/ogg;application/x-ogg;application/mxf;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/aiff;audio/x-aiff;audio/m4a;audio/x-m4a;application/x-extension-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/mpeg2;audio/mpeg3;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/musepack;audio/x-musepack;audio/ogg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg2;video/x-mpeg3;video/mp4v-es;video/x-m4v;video/mp4;application/x-extension-mp4;video/divx;video/vnd.divx;video/msvideo;video/x-msvideo;video/ogg;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;audio/x-ms-asf;application/vnd.ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-flic;video/fli;video/x-flc;video/flv;video/x-flv;video/x-theora;video/x-theora+ogg;video/x-matroska;video/mkv;audio/x-matroska;application/x-matroska;video/webm;audio/webm;audio/vorbis;audio/x-vorbis;audio/x-vorbis+ogg;video/x-ogm;video/x-ogm+ogg;application/x-ogm;application/x-ogm-audio;application/x-ogm-video;application/x-shorten;audio/x-shorten;audio/x-ape;audio/x-wavpack;audio/x-tta;audio/AMR;audio/ac3;audio/eac3;audio/amr-wb;video/mp2t;audio/flac;audio/mp4;application/x-mpegurl;video/vnd.mpegurl;application/vnd.apple.mpegurl;audio/x-pn-au;video/3gp;video/3gpp;video/3gpp2;audio/3gpp;audio/3gpp2;video/dv;audio/dv;audio/opus;audio/vnd.dts;audio/vnd.dts.hd;audio/x-adpcm;application/x-cue;audio/m3u;" > /usr/share/applications/gst-player.desktop

For QT player

For QT player

echo "[Desktop Entry]
Type=Application
Name=QT-play
Icon=mpv
Exec=env GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink /usr/lib/aarch64-linux-gnu/qt5/examples/multimediawidgets/player/player %f
Icon=/usr/share/icons/gnome/48x48/categories/applications-multimedia.png
Terminal=true
Categories=Qt;AudioVideo;Player;Video;
MimeType=application/ogg;application/x-ogg;application/mxf;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/aiff;audio/x-aiff;audio/m4a;audio/x-m4a;application/x-extension-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/mpeg2;audio/mpeg3;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/musepack;audio/x-musepack;audio/ogg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg2;video/x-mpeg3;video/mp4v-es;video/x-m4v;video/mp4;application/x-extension-mp4;video/divx;video/vnd.divx;video/msvideo;video/x-msvideo;video/ogg;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;audio/x-ms-asf;application/vnd.ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/fli;video/x-flc;video/flv;video/x-flv;video/x-theora;video/x-theora+ogg;video/x-matroska;video/mkv;audio/x-matroska;application/x-matroska;video/webm;audio/webm;audio/vorbis;audio/x-vorbis;audio/x-vorbis+ogg;video/x-ogm;video/x-ogm+ogg;application/x-ogm;application/x-ogm-audio;application/x-ogm-video;application/x-shorten;audio/x-shorten;audio/x-ape;audio/x-wavpack;audio/x-tta;audio/AMR;audio/ac3;audio/eac3;audio/amr-wb;video/mp2t;audio/flac;audio/mp4;application/x-mpegurl;video/vnd.mpegurl;application/vnd.apple.mpegurl;audio/x-pn-au;video/3gp;video/3gpp;video/3gpp2;audio/3gpp;audio/3gpp2;video/dv;audio/dv;audio/opus;audio/vnd.dts;audio/vnd.dts.hd;audio/x-adpcm;application/x-cue;audio/m3u;" > /usr/local/share/applications/qt-player.desktop

Now we should have 3 players that can do up to 4k60fps VP9.
Notice: Not of the player support xvid videos. For xvid video you will need to use mpv --vo=x11 <videofile> to get decent picture

To play any youtube file you will need to install youtube-dl with this command

wget https://yt-dl.org/latest/youtube-dl -O /usr/local/bin/youtube-dl
chmod a+x /usr/local/bin/youtube-dl
hash -r

Then do

mpv --hwdec=rkmpp --vo=gpu --gpu-api=opengl --gpu-context=drm <URL>

Then (depends on your network), wait a bit, while video loading. This will load best video and best sound. I.e. in high resolution and bitrate

Update: fixed wrong ", ' – since forum changed them from " to “” and ’ to ‘’ and -- to –
Upate 2: added support command for youtube 4k with mpv

6 Likes

Greate Guide!! @Dante4

@Jack Can you make a package for this so it can be install Easyly?

Thanks
Pierre

2 Likes

Good idea. @Stephen will do the job. Please wait for his update :slight_smile:

While i’m trying to understand why packages are so broken (basically checkinstall’s, radxa’s and github’s packages doesn’t work and report Segmentation fault) here is script that will compile everything on fly. You need to start this script after you unminimize ubuntu (and install graphical user interface) from terminal.
https://mega.nz/#!IN1XQC7B!OeqQ1nHVC4x9K4_92WHSXuoYQq4Aa2BGmPVXNCObLAg

under reconstruction

Short guide (if you need both gstreamer and FFmpeg&mpv, do apt-get install first, before installing packages):
gstreamer.
Do

apt-get install libqt5opengl5 libqt5qml5 libqt5quick5 libqt5widgets5 libqt5gui5 libqt5core5a qml-module-qtquick2 libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediaquick-p5 qtmultimedia5-examples qtmultimedia5-doc-html gstreamer1.0-tools qtgstreamer-plugins-qt5 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps glib-2.0 libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk2.0-dev libperl-dev libglib2.0-dev jack alsa gstreamer1.0-alsa 

After this we need to fix 10bit video (if you need one)

find /usr/include/ -name drm_fourcc.h -exec sed -i "143 i #define DRM_FORMAT_NV12_10\ fourcc_code('N', 'A', '1', '2') /* 2x2 subsampled Cr:Cb plane */\n#define DRM_FORMAT_NV21_10 fourcc_code('N', 'A', '2', '1') /* 2x2 subsampled Cb:Cr plane */\n#define DRM_FORMAT_NV16_10 fourcc_code('N', 'A', '1', '6') /* 2x1 subsampled Cr:Cb plane */\n#define DRM_FORMAT_NV61_10 fourcc_code('N', 'A', '6', '1') /* 2x1 subsampled Cb:Cr plane */\n#define DRM_FORMAT_NV24_10 fourcc_code('N', 'A', '2', '4') /* non-subsampled Cr:Cb plane */\n#define DRM_FORMAT_NV42_10 fourcc_code('N', 'A', '4', '2') /* non-subsampled Cb:Cr plane */" {} +

Then download packages

libmali-rk-dev
libmali-rk-midgard-t86x-r13p0
gstreamer-rockchip
librockchip-mpp-dev
librockchip-mpp-static
librockchip-mpp1

After you download them install them with

dpkg --unpack --force-all libmali-rk-dev_1.5-4_arm64.deb libmali-rk-midgard-t86x-r13p0_1.5-4_arm64.deb gstreamer-rockchip_3.9.8-1_arm64.deb librockchip-mpp-dev_20171218-1_arm64.deb librockchip-mpp-static_20171218-1_arm64.deb librockchip-mpp1_20171218-1_arm64.deb
apt-get install -f

Then to check if everything correct do
gst-inspect-1.0 --gst-plugin-path=/usr/local/lib/gstreamer-1.0 | grep mpp

Expected output
rockchipmpp:  mpph264enc: Rockchip Mpp H264 Encoder
rockchipmpp:  mppvideodec: Rockchip's MPP video decoder
typefindfunctions: audio/x-musepack: mpc, mpp, mp+

For ffmpeg+mpv (under reconstruction because of problem with packages)

apt-get install libgtk2.0-dev libperl-dev libglib2.0-dev jack libass-dev libfdk-aac-dev fdkaac aac-enc libfdk-aac1 libfreetype6-dev libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev zlib1g-dev libx264-dev libx265-dev libnuma-dev libvpx-dev libmp3lame-dev libopus-dev mc locate libghc-bzlib-dev speex libspeex-dev alsa libssl-dev librockchip-mpp1

Download packages
libmali-rk-dev
libmali-rk-midgard-t86x-r13p0
FFmpeg package.
aom package.
mpv package
Mpv-depens package

Then do (that’s from build-dep of FFmpeg)

apt-get install cleancss doxygen flite1-dev frei0r-plugins-dev gir1.2-rsvg-2.0 ladspa-sdk libavc1394-0 libavc1394-dev libavcodec57 libavutil55 libbluray-dev libbluray2 libbs2b-dev libbs2b0 libc-ares2 libcaca-dev libcaca0 libcdio-cdda-dev libcdio-cdda2 libcdio-dev libcdio-paranoia-dev libcdio-paranoia2 libcdio17 libchromaprint-dev libchromaprint1 libclang1-6.0 libdc1394-22 libdc1394-22-dev libevent-2.1-6 libfftw3-double3 libflite1 libgcrypt20-dev libgif7 libgme-dev libgme0 libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutlsxx28 libgpg-error-dev libgsm1 libgsm1-dev libhttp-parser2.7.1 libidn2-0-dev libidn2-dev libiec61883-0 libiec61883-dev libjack-jackd2-dev liblept5 libleptonica-dev libllvm6.0 liblzma-dev libmpg123-0 libmpg123-dev libmysofa-dev libmysofa0 libnorm1 libomxil-bellagio-dev libomxil-bellagio0 libopenal-data libopenal-dev libopenal1 libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0 libopencv-core-dev libopencv-core3.2 libopencv-imgproc-dev libopencv-imgproc3.2 libopenjp2-7 libopenjp2-7-dev libopenmpt-dev libopenmpt0 libout123-0 libp11-kit-dev libpgm-5.2-0 libraw1394-11 libraw1394-dev librsvg2-dev librubberband-dev librubberband2 libsctp-dev libsctp1 libshine-dev libshine3 libslang2-dev libsnappy-dev libsnappy1v5 libsodium23 libsoxr-dev libsoxr-lsr0 libsoxr0 libssh-gcrypt-4 libssh-gcrypt-dev libswresample2 libtasn1-6-dev libtbb-dev libtbb2 libtesseract-dev libtesseract4 libtext-unidecode-perl libtheora-dev libtheora0 libtwolame-dev libtwolame0 libunbound2 libuv1 libvo-amrwbenc-dev libvo-amrwbenc0 libwavpack-dev libwavpack1 libwebp-dev libwebp6 libwebpdemux2 libwebpmux3 libxapian30 libxml-libxml-perl libxml-namespacesupport-perl libxml-sax-base-perl libxml-sax-perl libxml2-dev libxvidcore-dev libxvidcore4 libxvmc-dev libxvmc1 libzmq3-dev libzmq5 libzvbi-common libzvbi-dev libzvbi0 nasm nettle-dev node-clean-css node-commander node-less nodejs tex-common texinfo

After this install packages with

dpkg --unpack --force-all libmali-rk-dev_1.5-4_arm64.deb libmali-rk-midgard-t86x-r13p0_1.5-4_arm64.deb mpp-rockchip_1.4.0-1_arm64.deb aom-build_20190202-1_arm64.deb ffmpeg_20190202-1_arm64.deb mpv-build-deps_1.0_arm64.deb mpv_20190203-1_arm64.deb
apt-get install -f 

To create shortcuts you still need to do step 9

3 Likes

Hello,

I´am getting this error at Point 7

gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -std=c11 -fomit-frame-pointer -fPIC -pthread -I/usr/local/include -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/opus -I/usr/include/opus -c -o /tmp/ffconf.dTv6J8Iu/test.o /tmp/ffconf.dTv6J8Iu/test.c
/tmp/ffconf.dTv6J8Iu/test.c: In function ‘check_SSL_library_init’:
/tmp/ffconf.dTv6J8Iu/test.c:3:51: error: ‘SSL_library_init’ undeclared (first use in this function); did you mean ‘check_SSL_library_init’?
long check_SSL_library_init(void) { return (long) SSL_library_init; }
^~~~~~~~~~~~~~~~
check_SSL_library_init
/tmp/ffconf.dTv6J8Iu/test.c:3:51: note: each undeclared identifier is reported only once for each function it appears in
ERROR: openssl not found

root@linaro-alip:/home/rock/video/FFmpeg# apt-get install openssl
Reading package lists… Done
Building dependency tree
Reading state information… Done
openssl is already the newest version (1.1.0g-2ubuntu4.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

how can i fix that?

somebody had the same problem?

greetings

You need to do:
apt-get install libssl-dev

I will update guide also, because seems that i forgot to add this

does not matter what I try, mpv is not working.

I tried a lot the last days
the way you show at the 12.01.19 and also the short form from the 3.2.19.

gstreamer works, but i cant control the replay of an video.
no pause, forward or backward etc…

mpv works not, only a window is shown shortly

my plan was to use mpv with kodi, but i guess it will not work if mpv runs not well.

or does somebody know how to optimize kodi for RockPi

@pumuckll do

In terminal and post the output
Also as for gstreamer - do

hi
first thank you for the support.

I tested with a clean installation, this time without [OpenCV](http://root@linaro-alip:/home/rock# env GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink /usr/lib/aarch64-linux-gnu/qt5/examples/multimediawidgets/player/player QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’ libEGL warning: DRI2: failed to authenticate (gst-plugin-scanner:4629): GStreamer-WARNING **: 18:34:18.344: Failed to load plugin ‘/usr/local/lib/gstreamer-1.0/libgstrkv4l2.so’: librk_aiq.so: cannot open shared object file: No such file or directory (gst-plugin-scanner:4629): GStreamer-WARNING **: 18:34:18.344: Failed to load plugin ‘/usr/local/lib/gstreamer-1.0/librk_aiq.so’: /usr/local/lib/gstreamer-1.0/librk_aiq.so: undefined symbol: __cxa_pure_virtual root@linaro-alip:/home/rock# env GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink /usr/lib/aarch64-linux-gnu/qt5/examples/multimediawidgets/player/player QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’ libEGL warning: DRI2: failed to authenticate) installation

I followed the short method and made the shortcuts at the end.

apt-get install librockchip-mpp1 (unsure about this, need testing) or [this package)

the installation of "this package does not work. there is no error , but I could install it endless.

apt-get install build-dep `

E: Paket build-dep kann nicht gefunden werden.
could not be found

lip:/media/rock/Stick/Bumblebee.2018.German.DL.AC3.Dubbed.1080p.WEBRip.x264-PsO$ mpv --hwdec=rkmpp --vo=gpu --gpu-api=opengl --gpu-context=drm pso-bumblebee_webrip.1080p.mkv
mpv: symbol lookup error: mpv: undefined symbol: eglQueryString

root@linaro-alip:/home/rock# env GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink /usr/lib/aarch64-linux-gnu/qt5/examples/multimediawidgets/player/player
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’
libEGL warning: DRI2: failed to authenticate

(gst-plugin-scanner:4629): GStreamer-WARNING **: 18:34:18.344: Failed to load plugin ‘/usr/local/lib/gstreamer-1.0/libgstrkv4l2.so’: librk_aiq.so: cannot open shared object file: No such file or directory

(gst-plugin-scanner:4629): GStreamer-WARNING **: 18:34:18.344: Failed to load plugin ‘/usr/local/lib/gstreamer-1.0/librk_aiq.so’: /usr/local/lib/gstreamer-1.0/librk_aiq.so: undefined symbol: __cxa_pure_virtual
root@linaro-alip:/home/rock# env GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink /usr/lib/aarch64-linux-gnu/qt5/examples/multimediawidgets/player/player
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’
libEGL warning: DRI2: failed to authenticate

when I start QT-play:
libEGL warning: DRI2: failed to authenticate

I want to use kodi on this device, and it would be nice if you can help me.
I already compiled kodi, but play videos works not very well.

so my plan was to use kodi with mpv.

can i make some optimization wile compile process?

greetings
have a nice weekend

I will check then the whole install setup then

Just for clarification.

(gst-plugin-scanner:4629): GStreamer-WARNING **: 18:34:18.344: Failed to load plugin ‘/usr/local/lib/gstreamer-1.0/libgstrkv4l2.so’: librk_aiq.so: cannot open shared object file: No such file or directory 
(gst-plugin-scanner:4629): GStreamer-WARNING **: 18:34:18.344: Failed to load plugin ‘/usr/local/lib/gstreamer-1.0/librk_aiq.so’: /usr/local/lib/gstreamer-1.0/librk_aiq.so: undefined symbol: __cxa_pure_virtual

This means that depends are all over the places and broken

mpv: symbol lookup error: mpv: undefined symbol: eglQueryStrin

And here is the same, usually it fixed by installing Mpv-depens package and you need to be careful about apt autoremove.

I understood the problem behind your problem, and gonna try to create properly packages now (yes it’s problem with packages if built from scratch it will work, but as soon as i try to go with fast&dirty packages from checkinstall - it doesn’t work)

I fixed gstreamer, you should be good to go with it, tomorrow i will work on ffmpeg&mpv and fix them

rock@linaro-alip:~/video$ sudo dpkg --unpack --force-all
[sudo] password for rock:
dpkg: error: --unpack needs at least one package archive file argument

which package should her installed?

So, for some reason i don’t yet understand i can’t get packages to work. Nor official’s, nor Radxa’s, nor packages i got from checkinstall. So until then there is script that do everything (downloading, compile, installing)

Hi, we have built player and gstreamer player packages. To use them, try:

$ apt-get install -y mpv
$ apt-get install -y librockchip-mpp1

$ apt-get install -y gstreamer1.0-tools gstreamer1.0-plugins-bad 
$ apt-get install -y gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base 
$ apt-get install -y gstreamer1.0-plugins-base-apps glib-2.0 libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev 
$ apt-get install -y gstreamer1.0-rockchip1

Bty, I use rockpi4b-ubuntu-bionic-minimal-20190104_2101-gpt.img and mate desktop. Before installing the above packages, I do this:

$ sudo apt install -y ubuntu-mate-core
$ sudo apt install -y ubuntu-mate-desktop
3 Likes

So I did it with fresh inminimized image with xfce4 installed (to check, maybe my memory is bad and it actually worked).
Mpv fails with

mpv: error while loading shared libraries: librockchip_mpp.so.1: cannot open shared object file: No such file or directory

For gstreamer (gstreamer1.0-alsa is needed to use gst-play-1.0) I have this problems (erm…which inconsistent? it disappeared after i installed qt5 libraries)

Summary

(gst-plugin-scanner:13741): GStreamer-WARNING **: 11:00:42.267: Failed to load plugin ‘/usr/local/lib/gstreamer-1.0/libgstrkv4l2.so’: librk_aiq.so: cannot open shared object file: No such file or directory
(gst-plugin-scanner:13741): GStreamer-WARNING **: 11:00:42.268: Failed to load plugin ‘/usr/local/lib/gstreamer-1.0/librk_aiq.so’: /usr/local/lib/gstreamer-1.0/librk_aiq.so: undefined symbol: __cxa_pure_virtual

And after i installed qt5base5-example and qtmultimedea5-examples the problem with librockchip_mpp.so.1 disappeared? I’m unsure, i will try another fresh installation.

P.S. @pumuckll you should be ok with packages @Stephen posted. To use mpv with hardware acceleration you need to use command (ignore errors)
mpv --hwdec=rkmpp --vo=gpu --gpu-api=opengl --gpu-context=drm

P.S.S. Additional testing showed that just by installing

$ apt-get install -y mpv
$ apt-get install -y librockchip-mpp1
$ apt-get install -y gstreamer1.0-tools gstreamer1.0-plugins-bad 
$ apt-get install -y gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good gstreamer1.0-plugins-base 
$ apt-get install -y gstreamer1.0-plugins-base-apps glib-2.0 libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev 
$ apt-get install -y gstreamer1.0-rockchip1

I still have

mpv: error while loading shared libraries: librockchip_mpp.so.1: cannot open shared object file: No such file or directory

But, after i install any(?) package, everything seems to be corrected

Can you check does mpv still works? Because i’m getting “Segmentaton fault” (if i use hwdec=rkmpp) error with both gstreamer and mpv on both radxa’s packages and building from scratch

I’m having the same “segmentation fault” issue with the Ubuntu server image and mpp from the Radxa repo.

If I install the latest librockchip-mpp from the rockchip repository, “mpv --hwdec=rkmpp --vo=null” plays fine with hardware decoding enabled (without any video output of course).

But “mpv --hwdec=rkmpp --vo=drm” shows error:

[autoconvert] can't find video conversion for drm_prime/nv12

1 Like

The mpv-gbm shortcut under fresh Armbian Bionic desktop + media script (from the Armbian rk3399 subforum) works with no hiccups playing 4k hevc videos.

It ships with this version of mpv, not sure how it differentiate from the upstream one:

mpv-rockchip/now 2:2018.12.12.d6d6da4711-0bionic1 arm64 [installed,local]

“–vo=drm” doesn’t work on Armbian either, got the same color format error.

The Armbian Bionic desktop image for Rock Pi 4 ships with the wrong kernel (4.4.182-rockchip64), which doesn’t activate the mali gpu on rock pi 4 (/dev/mali0 doesn’t exist). I had to manually do “apt install linux-dtb-rk3399 linux-image-rk3399” (which contains 4.4.179-rk3399) to get gpu acceleration working.

1 Like