0) (when unsure what OS to install on rock64: ) install Ubuntu linux on rock64 Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.4.190-1233-rockchip-ayufan-gd3f1be0ed310 aarch64) _ __ _ _ _ __ ___ ___| | __/ /_ | || | | '__/ _ \ / __| |/ / '_ \| || |_ | | | (_) | (__| <| (_) |__ _| |_| \___/ \___|_|\_\\___/ |_| * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage System information disabled due to load higher than 4.0 * Kubernetes 1.18 GA is now available! See https://microk8s.io for docs or install it with: sudo snap install microk8s --channel=1.18 --classic * Multipass 1.1 adds proxy support for developers behind enterprise firewalls. Rapid prototyping for cloud operations just got easier. https://multipass.run/ Last login: Sun Apr 5 08:39:06 2020 from 192.168.1.17 johannes@rock64:~$ 1) Install all libraries and tools Handbrake configuration (configure) and build (GNUmake) depends on. sudo apt update sudo apt-get install git autoconf automake build-essential cmake libass-dev libbz2-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libjansson-dev liblzma-dev libmp3lame-dev libogg-dev libopus-dev libsamplerate-dev libspeex-dev libtheora-dev libtool libtool-bin libvorbis-dev libx264-dev libxml2-dev m4 make patch pkg-config python tar yasm zlib1g-dev libvpx-dev xz-utils bzip2 zlib1g sudo apt-get install -y meson sudo apt-get install -y nasm sudo add-apt-repository ppa:nbritton/meson-0.47 sudo apt-get update sudo apt install python3-pip sudo apt-get install python3-setuptools sudo apt-get install -y numa sudo apt-get install -y libnuma sudo apt-get install libnuma-dev sudo apt-get install gettext-tools sudo apt-get install -y gettext sudo apt-get install -y autopoint sudo apt-get install libgtk-3-dev sudo apt-get install -y libpostproc-dev 2) Get git repository for Handbrake. git clone https://github.com/HandBrake/HandBrake.git cd Handbrake 3) Follow instruction 4, 5, 6 and part of 7 of https://github.com/kapitainsky/handbreak-RaspberryPi/blob/master/README.md (Note that instruction 5. is updated to not remove the gtk (windows) version of Handbrake) 4. we have to add extra configure parameters to X265 module Without it won't compile on RPi echo "X265_8.CONFIGURE.extra += -DENABLE_ASSEMBLY=OFF -DENABLE_PIC=ON -DENABLE_AGGRESSIVE_CHECKS=ON -DENABLE_TESTS=ON -DCMAKE_SKIP_RPATH=ON" >> ./contrib/x265_8bit/module.defs \ && \ echo "X265_10.CONFIGURE.extra += -DENABLE_ASSEMBLY=OFF -DENABLE_PIC=ON -DENABLE_AGGRESSIVE_CHECKS=ON -DENABLE_TESTS=ON -DCMAKE_SKIP_RPATH=ON" >> ./contrib/x265_10bit/module.defs \ && \ echo "X265_12.CONFIGURE.extra += -DENABLE_ASSEMBLY=OFF -DENABLE_PIC=ON -DENABLE_AGGRESSIVE_CHECKS=ON -DENABLE_TESTS=ON -DCMAKE_SKIP_RPATH=ON" >> ./contrib/x265_12bit/module.defs \ && \ echo "X265.CONFIGURE.extra += -DENABLE_ASSEMBLY=OFF -DENABLE_PIC=ON -DENABLE_AGGRESSIVE_CHECKS=ON -DENABLE_TESTS=ON -DCMAKE_SKIP_RPATH=ON" >> ./contrib/x265/module.defs 5. now we can configure our project /* Do not: ./configure --launch-jobs=$(nproc) --disable-gtk --disable-nvenc --disable-qsv --enable-fdk-aac */ ./configure --launch-jobs=$(nproc) --disable-nvenc --disable-qsv --enable-fdk-aac 6. we have to make quick-and-dirty hack to x265 source code We compile with DENABLE_ASSEMBLY=OFF but x265 code does not take it into account that they don't handle it right for ARMv7 (I have reported it to X265 guys so maybe in the future it wont be required if they modify their code) but first we have to start building it so it is downloaded cd build make -j 4 x265 Wait unitl you see that files have been downloaded then CTRL-C nano ./contrib/x265/x265_3.0/source/common/primitives.cpp and change following section - at the end of the file: #if X265_ARCH_ARM == 0 void PFX(cpu_neon_test)(void) {} int PFX(cpu_fast_neon_mrc_test)(void) { return 0; } #endif // X265_ARCH_ARM to #if X265_ARCH_ARM != 0 void PFX(cpu_neon_test)(void) {} int PFX(cpu_fast_neon_mrc_test)(void) { return 0; } #endif // X265_ARCH_ARM we just change == condition to != 7. we can build all now make clean 4) Configure and build ffmpeg (and its libraries) first. (This is to disable inline assembly coding, to not get an invalid assembly instruction error: src/libavutil/aarch64/bswap.h:31:5: error: invalid 'asm': invalid operand for code 'w' __asm__("rev16 %w0, %w0" : "+r"(x)); ^~~~~~~ Note that this must be fixed, so Hanbrake will encade faster! ) cd ../build/contrib/ffmpeg/ffmpeg-4.2.2 ./configure --disable-nvenc --disable-asm cd - 5) (from within the build directory) build ffmpeg (and its libraries) (Note that this breaks the main build a bit, libraries are not copied as a result and an ffmpeg executable is created and installed) make -j $(nproc) ffmpeg cp ./contrib/ffmpeg/ffmpeg-4.2.2/libavdevice/libavdevice.a lib/ cp ./contrib/ffmpeg/ffmpeg-4.2.2/libswresample/libswresample.a lib/ cp ./contrib/ffmpeg/ffmpeg-4.2.2/libavfilter/libavfilter.a lib/ cp ./contrib/ffmpeg/ffmpeg-4.2.2/libswscale/libswscale.a lib/ cp ./contrib/ffmpeg/ffmpeg-4.2.2/libavutil/libavutil.a lib/ cp ./contrib/ffmpeg/ffmpeg-4.2.2/libavformat/libavformat.a lib/ cp ./contrib/ffmpeg/ffmpeg-4.2.2/libavcodec/libavcodec.a lib/ 6) (from within the build directory) build it all. (note that use of sudo is a hack, to get install rights, but you should do better ...) sudo make -j $(nproc)