Handbrake package for XU3/XU4

Moderators: mdrjr, odroid

Handbrake package for XU3/XU4

Unread postby mad_ady » Wed Oct 14, 2015 8:35 pm

More recent build and instructions here: viewtopic.php?f=98&t=16863&p=196303#p196303

=== Original Post ===

Package for Handbrake.

HandBrakeCLI
- latest git version
- compiled with the following options:
Code: Select all
./configure --disable-gtk --disable-gtk-update-checks --disable-gst --enable-x265 --enable-fdk-aac --enable-libav-aac --launch-jobs=6


If you want to compile it yourself, read "doc/BUILD-Linux" bundled in the package. Also, during the compilation you will run into some problems, here's how to solve them:
- note: you need to run this command from within build to have it compile (after make fails the first time):
Code: Select all
./stdio.h:477:1: error: 'gets' undeclared here (not in a function)
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

Code: Select all
sed -i -e '/gets is a security/d' ../build/contrib/m4/m4-1.4.16/lib/stdio.in.h

... and this if it doesn't pick up LIBXML2:
Code: Select all
LIBXML2_CFLAGS=-I/usr/include/libxml2 LIBXML2_LIBS=-lxml2 make


Although it doesn't use the GPU for transcoding, it uses the CPU with NEON support:
Code: Select all
x264 [info]: using cpu capabilities: ARMv6 NEON


Transcoding tests:

The video to be transcoded is a 1080p video taken from a phone transcoded to 1080p with a lower bitrate, x264, two passes, aac sound, x264-preset=slow, x264-profile=high

* Intel(R) Core(TM) i7-3612QM CPU @ 2.10GHz x8 (High end laptop PC)
- average fps (during first phase): 36.5
Code: Select all
real 1m5.236s
user 6m53.348s
sys 0m1.500s


* Odroid XU3 with interactive governor, maximum frequency on all cores (reached ~94 degrees while transcoding):
- average fps (during first phase): 7.5
Code: Select all
real    4m15.786s
user    25m17.625s
sys     0m14.775s


* Odroid XU3 with powersave governor, maximum frequency of 200MHz (keep the fan from spinning too much - kept the box below 65 degrees) on all cores (actually the transcoding command was running with nice, and it seems nice + powersave doesn't raise the core frequency and was running at 200MHz instead of the max 600):
- average fps (during first phase): 1.5
Code: Select all
real    29m1.483s
user    171m56.175s
sys     1m34.290s


* Odroid XU3 with powersave governor, maximum frequency of 600MHz, minimum frequency 600MHz (keep the fan from spinning too much - kept the box below 69 degrees) on all cores:
- average fps (during first phase): 3.8
Code: Select all
real    8m42.884s
user    54m0.880s
sys     0m31.515s


Here is a minimum deb package, for Ubuntu 15.04, that doesn't check any dependencies (I'd like to learn how to build packages with dependency checks). Installs to /usr/local/bin/HandBrakeCLI. You may need additional runtime libraries:
Code: Select all
adrianp@procyon:~/temp/HandBrake/build$ ldd /usr/local/bin/HandBrakeCLI   
        libass.so.5 => /usr/lib/arm-linux-gnueabihf/libass.so.5 (0xb6f03000)
        libmp3lame.so.0 => /usr/lib/arm-linux-gnueabihf/libmp3lame.so.0 (0xb6ea4000)
        libsamplerate.so.0 => /usr/lib/arm-linux-gnueabihf/libsamplerate.so.0 (0xb6d32000)
        libtheoraenc.so.1 => /usr/lib/arm-linux-gnueabihf/libtheoraenc.so.1 (0xb6cf4000)
        libtheoradec.so.1 => /usr/lib/arm-linux-gnueabihf/libtheoradec.so.1 (0xb6cd5000)
        libvorbis.so.0 => /usr/lib/arm-linux-gnueabihf/libvorbis.so.0 (0xb6ca3000)
        libvorbisenc.so.2 => /usr/lib/arm-linux-gnueabihf/libvorbisenc.so.2 (0xb6c11000)
        libx264.so.142 => /usr/lib/arm-linux-gnueabihf/libx264.so.142 (0xb6ac9000)
        libxml2.so.2 => /usr/lib/arm-linux-gnueabihf/libxml2.so.2 (0xb69a1000)
        libbz2.so.1.0 => /lib/arm-linux-gnueabihf/libbz2.so.1.0 (0xb6985000)
        libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb6963000)
        libjansson.so.4 => /usr/lib/arm-linux-gnueabihf/libjansson.so.4 (0xb694b000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6937000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6924000)
        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb686a000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb67f5000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb67cc000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb66de000)
        /lib/ld-linux-armhf.so.3 (0xb6f39000)
        libfribidi.so.0 => /usr/lib/arm-linux-gnueabihf/libfribidi.so.0 (0xb66b9000)
        libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0xb6680000)
        libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb661c000)
        libharfbuzz.so.0 => /usr/lib/arm-linux-gnueabihf/libharfbuzz.so.0 (0xb65d1000)
        libenca.so.0 => /usr/lib/arm-linux-gnueabihf/libenca.so.0 (0xb659c000)
        libogg.so.0 => /usr/lib/arm-linux-gnueabihf/libogg.so.0 (0xb658f000)
        libicuuc.so.52 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.52 (0xb6483000)
        libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0xb645b000)
        libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0xb6433000)
        libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb635d000)
        libgraphite2.so.3 => /usr/lib/arm-linux-gnueabihf/libgraphite2.so.3 (0xb633b000)
        libicudata.so.52 => /usr/lib/arm-linux-gnueabihf/libicudata.so.52 (0xb4cbf000)
        libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb4c64000)


If there is any interest in this, I will try to compile the GUI version as well. For now I use it to transcode my home videos with some custom scripts.

Download link: http://www.mediafire.com/download/vs9k8 ... _armhf.deb
Code: Select all
8508e47c1162285974ad84094ddbf824  handbrake-cli_20151014-1_armhf.deb

Download link for the gtk frontend: http://www.mediafire.com/download/1w9hi ... _armhf.deb

Download link for C2 arm64 build: http://www.mediafire.com/download/k7dv3 ... _arm64.deb
Code: Select all
fdd5649d55f6597b60ccc966352874e3  handbrake_20160714-1_arm64.deb
Last edited by mad_ady on Wed Jul 12, 2017 4:28 pm, edited 5 times in total.
User avatar
mad_ady
 
Posts: 2895
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Handbrake package for XU3/XU4

Unread postby mdrjr » Thu Oct 15, 2015 2:00 am

Does handbrake support OpenCL?
If so, XU3/XU4 has OpenCL support already...
mdrjr
Site Admin
 
Posts: 11640
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: Handbrake package for XU3/XU4

Unread postby mad_ady » Thu Oct 15, 2015 3:56 am

Based on their configure options I would say it doesn't. I only removed the options to build a GTK GUI and DirectX acceleration. I will check with the handbrake community - thanks for the idea.
User avatar
mad_ady
 
Posts: 2895
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Handbrake package for XU3/XU4

Unread postby meveric » Thu Oct 15, 2015 4:40 am

The only option where HandBrake is using OpenCL is for Scaling and it's a beta feature.. it's said to give a performance boost from "UP TO" 5% (and may also decrease quality), so i don't think it will give us anything on ODROID devices :)

I compiled Handbreak in the past for ODROIDs already.. the gtk frontend is working fine.
But as you already noticed, the performance is rather bad. I wouldn't use a XU3/XU4 for converting videos.. the performance is way to low to be "usefull" and CPU on ~95°C for several hours/half a day is nothing i want for my XU3/XU4 just to convert a movie.

I would rather use a U3 for this. It still get's about 5 FPS and can run even with passive cooling. Although i probably wouldn't use an ODROID at all for doing tasks like this :)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7966
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Handbrake package for XU3/XU4

Unread postby mad_ady » Fri Oct 16, 2015 1:14 am

Yes, the XU3/4 is not built for this but I plan to use it to run my custom video conversion scripts for my home video collection. <rant>Samsung phone camera insists on using 20Mbps bitrate even though 6Mbps is more than enough for my needs </rant>

With the CPU throttled at 600MHz it chugs along while not going over 65C. And the nights are long and I have time to spare... :)

I'm glad to hear that GTK can be compiled. I'm currently working on it.
User avatar
mad_ady
 
Posts: 2895
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Handbrake package for XU3/XU4

Unread postby mad_ady » Wed Oct 21, 2015 2:17 am

Update: I managed to compile the gtk version as well. I got stuck at first in dependency hell, but HandBrake's main developer helped me out and told me to install libtool-bin as well. After that the compilation went well. The deb package is in the first post.
User avatar
mad_ady
 
Posts: 2895
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Handbrake package for XU3/XU4

Unread postby mad_ady » Thu Jul 14, 2016 4:02 pm

I've built a deb package for the C2 as well. It includes HandBrakeCLI and the GTK frontend. You can download it here: http://www.mediafire.com/download/k7dv3 ... _arm64.deb

To build it yourself you will need to install the dependencies as described here: http://magazine.odroid.com/wp-content/u ... df#page=32. But for C2 you will need to build a fake package for libegl1-mesa-dev (which is needed by libgtk3.0 and conflicts with libegl-mesa). You can get the fake package here: http://www.mediafire.com/download/0w62b ... ke_all.deb

You also need to create a fake wayland-egl.pc file in /usr/lib/aarch64-linux-gnu/pkgconfig/wayland-egl.pc (which you can get here): http://www.mediafire.com/download/3urdw ... and-egl.pc

You can use the build instructions in the article to make the program yourself, but to package it as a deb you need to change the dependencies a bit (for a strange reason Ubuntu 16.04 added a -0 postfix to most libraries):
Code: Select all
sudo checkinstall -D --install=yes --pkgname=handbrake --provides=handbrake --requires=libtheora0,libogg0,libvorbis0a,libsamplerate0,libxml2,libfribidi0,libfreetype6,libfontconfig1,libass5,libmp3lame0,libx264-148,libjansson4,libglib2.0-0,libgtk-3-0,libgudev-1.0-0,libwebkitgtk-3.0-0,libnotify4,libgstreamer1.0-0,libgstreamer-plugins-base1.0-0,libappindicator1 --showinstall=yes --strip=yes


Have fun!
User avatar
mad_ady
 
Posts: 2895
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Handbrake package for XU3/XU4

Unread postby mad_ady » Wed Jul 12, 2017 4:27 pm

I've updated the handbrake-cli package for XU3/4 and C2.

Here are updated build instructions for reference (use this guide for up-to-date instructions: https://handbrake.fr/docs/en/latest/dev ... linux.html):
Code: Select all
sudo apt-get install git autoconf automake build-essential cmake git libass-dev libbz2-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libjansson-dev libmp3lame-dev libogg-dev libopus-dev libsamplerate-dev libtheora-dev libtool libtool-bin libvorbis-dev libx264-dev libxml2-dev m4 make patch pkg-config python tar yasm zlib1g-dev checkinstall
git clone https://github.com/HandBrake/HandBrake.git
cd HandBrake/
./configure --launch-jobs=4 --disable-gtk --launch
cd build
sudo make install
sudo checkinstall -D --install=yes --pkgname=handbrake-cli --provides=handbrake-cli --requires=libtheora0,libogg0,libvorbis0a,libsamplerate0,libxml2,libfribidi0,libfreetype6,libfontconfig1,libass5,libmp3lame0,libx264-148,libjansson4,libglib2.0-0,libgstreamer1.0-0,libgstreamer-plugins-base1.0-0 --showinstall=yes --strip=yes


You can download precompiled packages from here:
Odroid XU3/4: http://www.mediafire.com/file/4opeew8v0 ... _armhf.deb
Odroid C2: http://www.mediafire.com/file/q0aj0875w ... _arm64.deb
User avatar
mad_ady
 
Posts: 2895
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Handbrake package for XU3/XU4

Unread postby meveric » Wed Jul 12, 2017 4:48 pm

just as an info:
If you're using Debian (or Ubuntu) with deb-multimedia package list there are packages for handbrake, handbrake-cli and handbrake-gtk already available ready to install via apt.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7966
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Handbrake package for XU3/XU4

Unread postby mad_ady » Wed Jul 12, 2017 5:26 pm

Didn't know deb-multimedia also works on Ubuntu. Does it interfere with anything?
User avatar
mad_ady
 
Posts: 2895
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2

Re: Handbrake package for XU3/XU4

Unread postby meveric » Wed Jul 12, 2017 6:58 pm

Packages from deb-multimedia have all dependencies listed in the .deb files as all well packages .deb files should have.
As long as Ubuntu can satisfy these dependencies the packages from deb-multimedia will work on Ubuntu as well.
If Ubuntu can't satisfy the dependencies, the packages will simply not be installed.

ffmpeg could be a little messy since deb-multimedia uses it's own versioning for ffmpeg and has a higher version than the default Debian packages (maybe Ubuntu as well), in worst case that could mean you install an older version of ffmpeg than provided by Ubuntu.

In the past this was all not much of a problem. Using deb-multimedia for Debian Wheezy on a Ubuntu 14.04 worked perfectly fine with rarely any issues at all.
Since Debian Jessie there are some minor differences in the packages that could be harder to solve, such as that Debian now uses libjpeg62-turbo while Ubuntu still uses libjpeg.

At least all deb-multimedia packages are easily to find on your system, since they all have a "-dmo" in the version name so if you use dpkg --list | grep dmo you normally can easily identify all packages from deb-multimedia on your system in case you really end up with issues.

You could probably avoid most conflicts by pinning the deb-multimedia repository with a lower priority than the default repositories. That way Ubuntu repos are always preferred (even if deb-multimedia has newer packages) and only if explicitly requested it would install packages from deb-multimedia.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7966
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1


Return to Projects

Who is online

Users browsing this forum: No registered users and 3 guests