Support for 8/10/12 bit color depths in HandBrake!

HandBrake is now using a freshly built x265 library that enables full color depth support at 8, 10 and 12 bits. You can now convert videos in these format! This has been enabled in the 64 bit builds of the x265 library; for both Fedora 23 and CentOS/RHEL 7.

Also, NUMA support has been added to the libraries. Just by chance I have an SGI UV 200 (the predecessor of the current SGI UV 300) lying around.

ghb-x265

This goes along with the 10 bit support for x264 that was enabled some time ago; so I’ve made some adjustments to the libraries and now there is more consistency between x264/x265. Both are loaded at runtime by HandBrake:

$ ls -alghs /usr/lib64/libx26*
668K -rwxr-xr-x. 1 root 667K Feb  5 09:55 /usr/lib64/libx264_main10.so
764K -rwxr-xr-x. 1 root 763K Feb  5 09:55 /usr/lib64/libx264.so.148
3.4M -rwxr-xr-x. 1 root 3.4M Feb  5 09:05 /usr/lib64/libx265_main10.so
3.4M -rwxr-xr-x. 1 root 3.4M Feb  5 09:05 /usr/lib64/libx265_main12.so
3.2M -rwxr-xr-x. 1 root 3.2M Feb  5 09:05 /usr/lib64/libx265.so.68

Input devices in Steam Big Picture mode

I’ve just updated the the Steam package to fix input detection of some device in Big Picture mode. The package comes now with some additional configuration files for input devices, to have them properly recognized and functioning in Big Picture mode. Check below for the complete list of input device configurations that have been added:

Configuration for the following devices is part of the original Steam tarball:

  • Steam Controller with USB adapter
  • HTC Vive HID Sensor with USB adapter

Detection for the following device has been modified to make it appear as a Game Pad and not as a mouse (due to its touchpad). This prevents the “ghost” keypresses in Steam Big Picture mode:

  • Nvidia Shield Controller with USB cable

Detection for the following device has been modified to have them properly detected as mice/keyboards and not joysticks due to a bug in the Linux kernel. This prevents the “ghost” keypresses in Steam Big Picture mode:

  • Microsoft Microsoft Wireless Optical Desktop® 2.10
  • Microsoft Wireless Desktop – Comfort Edition
  • Microsoft Microsoft® Digital Media Pro Keyboard
  • Microsoft Corp. Digital Media Pro Keyboard
  • Microsoft Microsoft® Digital Media Keyboard
  • Microsoft Corp. Digital Media Keyboard 1.0A
  • Microsoft Microsoft® Digital Media Keyboard 3000
  • Microsoft Microsoft® 2.4GHz Transceiver v6.0
  • Microsoft Microsoft® 2.4GHz Transceiver v8.0
  • Microsoft Corp. Nano Transceiver v1.0 for Bluetooth
  • Microsoft Wireless Mobile Mouse 1000
  • Microsoft Wireless Desktop 3000
  • Microsoft® SideWinder(TM) 2.4GHz Transceiver
  • Microsoft Corp. Wired Keyboard 600
  • Microsoft Corp. Sidewinder X4 keyboard
  • Microsoft® 2.4GHz Transceiver v9.0
  • Microsoft® Nano Transceiver v2.1
  • Microsoft Sculpt Ergonomic Keyboard (5KV-00001)
  • Microsoft® Nano Transceiver v1.0
  • Microsoft Wireless Keyboard 800
  • Microsoft® Nano Transceiver v2.0
  • WACOM CTE-640-U V4.0-3
  • Wacom Co., Ltd Graphire 4 6×8
  • Wacom Bamboo Pen and Touch CTH-460
  • A4 Tech Co., G7 750 mouse
  • A4 Tech Co., Ltd Bloody TL80 Terminator Laser Gaming Mouse
  • A4 Tech Co., Ltd Bloody RT7 Terminator Wireless
  • Modecom MC-5006 Keyboard
  • A4 Tech Co., Ltd Terminator TL9 Laser Gaming Mouse
  • A4 Tech Co., Ltd Bloody V5
  • A4 Tech Co., Ltd Bloody R3 mouse
  • A4 Tech Co., Ltd X-718BK Oscar Optical Gaming Mouse
  • A4 Tech Co., Ltd XL-750BK Laser Mouse
  • A4 Tech Co., Sharkoon Fireglider Optical
  • Cooler Master Storm Mizar Mouse

The relevant repository page has been updated accordingly. If you have any additional misbehaving device that does not currently work properly in Steam Big Picture mode, just contact me and I will try to add the device defnitions to the upstream repositories.

HandBrake, MakeMKV, FFMpeg and Skype available for CentOS/RHEL 7

The multimedia and Skype repositories now contain all components and libraries to have the same “experience” as in Fedora 23. This includes HandBrake, MakeMKV, Skype and the same FFMPeg build with the same options that are enabled in the Fedora 23 build; including Intel Quick Sync Video and the Nvidia Encoder.

handbrake-1.0-centos7

To enable this, new build roots with CentOS/RHEL i686 images have been used. This way all dependencies have been correctly built from the same CentOS/RHEL 7 packages and not with cross-compilation or using the Fedora 19 buildroots.

Converged multimedia repository with restricted codecs and binaries

As most of you have noticed, the HandBrake repository has been integrating more and more multimedia packages that are not related to HandBrake itself or to its supporting programs. The latest additions to it are the CUDA/FFMpeg enabled Blender package and some additional encoding options for FFMPeg.

This definitely puts a nail in the coffin of the “CUDA programs” repository that was previously treated as a separate repository. I’m not able to provide separate repositories for them as either you have a full blown multimedia collection with each component strictly tied to each other (Blender requires FFMPeg and Nvidia drivers, FFMpeg requires restricted multimedia libraries and Nvidia drivers, HandBrake requires the same restricted multimedia libraries of FFMPeg, etc.) or you just have the plain Fedora repositories with no license/patent encumbered options.

None of these packages can be distributed inside the main Fedora/RPMFusion repositories as they are presented here with current build options; mainly due to patent and licensing issues or simply because they are coupled with non open source software resulting in dubious licensed binaries.

Some of the packages might have hard dependencies on Nvidia components or libraries, while some other have a weak dependency on them. Whether you can enable support for those it’s usually just a matter of adding or not the Nvidia repository and the multimedia (HandBrake) repository at the same time.

Not all distributions are on par regarding features and packages, let’s say most of the development goes on to the latest Fedora release due to it being my daily desktop.

To install the CUDA enabled Blender, HandBrake, MakeMKV or the fully fledge FFMpeg binary just go to the appropriate page and follow the instructions.

I will probably also rename the repository into something more generic compared to what is currently called now; so suggestions are welcome!

Screenshot from 2015-12-11 19-20-27

Updated packages

There is a new update for HandBrake, it now reverts to using bundled libAV in place of the system FFMpeg. UTF subtitles were not recognized properly when scanning files, and VP8 encoding is not working properly.

Also, there is a new update for libbluray and a FFMpeg update that enables hardware acceleration for Intel Quick Sync Video hardware. That is, you can now use hardware acceleration for encoding on both Nvidia cards (NVENC) and Intel CPUs (QSV). CDRtools has also been updated to the very latest.

Notes and information on the HandBrake repository page has been updated accordingly.

Updated packages and new Samsung repository

As some of you may have noticed, a lot of updates and new stuff has been pushed.

Highlights from the updates

  • The Nvidia driver version 358.16 has been promoted as “Short Lived” for Fedora, and it has support for X.org Video ABI 20. So it is now the default for Fedora 21, 22 and 23.
  • Driver version 352.63 is the new “Long Lived” driver for RedHat/CentOS.
  • Both drivers have a fallback mechanism for the SELinux regression introduced in 358.09, so you don’t need anymore to disable SELinux for GDM refresh problems.
  • The legacy driver has been updated to 340.96, and this as well has been enabled for Fedora 23 as it also supports X.org 1.18
  • CDRtools after years of an alpha 3.01 has finally updated to… an alpha 3.02 😀
  • HandBrake has been updated to the very latest snapshot and is relying only on separate source tarballs that are not statically linked. Unfortunately some are of dubious licenses as usual. Please note that there are some issues with subtitle tracks embedded in Matroska files not being correctly interpreted.
  • The Nvidia NVML library and CUDA packages have seen some small update.
  • Steam has been updated to version 1.0.0.51 and has updated UDev rules for the Steam Controller. If you are one of the owners of such controller, you will find support out of the box. The same changes have also been pushed to the RPMFusion package.

New repository

There’s a new repository for Samsung printers, multifunction printers and scanners that carries the “Samsung Unified Linux Driver” for both the scanning and printing functions. Just by installing it and enabling the ports in the firewall should be enough to get every device running in no time. Refer to the appropriate page for details.

Fully fledged FFMpeg binaries

Also, due to popular request, there is now a custom built FFMpeg package that drops in as a replacement for RPMFusion ones and that enables linking and support for all the codecs/encoders/decoders that would result in an unredistributable binary. This is now available the HandBrake repository. The following codecs/encoders/decoders/transports have been enabled:

  • VP8 and VP9 de/encoding
  • WebP encoding
  • AAC (Fraunhofer, LibVO and other variants) de/encoding
  • OpenAL 1.1 capture support
  • BluRay reading
  • AMR-WB de/encoding
  • AMR-NB de/encoding
  • RTMP[E] support
  • H.264 encoding (OpenH264, Cisco variant)
  • OpenGL rendering
  • SSH transport
  • Fontconfig/fribidi text support

This sobstitutes the ffmpeg binary that was provided as part of the CUDA enabled programs, as it is now tied to all the other multimedia libraries available in this repository. The support for Nvidia H.264/H.265 hardware encoding/decoding is enabled here as well and the required packages are now installed through the use of RPM weak dependencies.

The package has a different Epoch so it is not overwritten by normal updates. The idea is to have all the possible codecs supported out of the box, so also expect HEVC kvazaar (H.265), Intel Quick Sync Video (H.265) hardware support through libmfx/mfx_dispatch, CIFS transport, and other stuff, as soon as I have more time.

The same repository will be used to host the CUDA and FFMpeg enabled Blender, as it makes no sense to have a separate repository for it. Either you have a full blown multimedia collection with each component strictly tied to each other, or you just have the plain Fedora repositories with no license/patent encumbered options.

Enjoy!

Fedora 23 packages now live

All the repositories have been updated for Fedora 23, so if you trigger an update, everything should update properly. CUDA enabled programs are still building.

A few notes:

  • HandBrake has been updated to a pre-release of 1.0 for Fedora 23. Updated x264/x265/FFmpeg libraries should give a speed bost to all encoding operations.
  • The Spotify 0.9.x repository has been removed. It will never receive updates anymore, and now the 1.x builds are on feature parity, including 32 bit support. If you haven’t upgraded, just do it now.
  • Nvidia drivers version 358.09 do not yet support X.org driver ABI 20, so you’re probably going to have some lock ups or random issues.
  • The SteamOS and X-Box replacement driver have been updated to the latest upstream.

Please let me know if you have any upgrade issue.

BluRay playback and ripping on Fedora (AACS, BD+, BD-J)

There are multiple ways that one can try to make BluRay decryption and playback in Linux. Of course, after some googling and fiddling around, you can see that is quite simple even if not the different instructions are quite confused as they span across multiple iterations of software development.

First of all a brief introduction. It is all explained here in great detail on the BluRay Wikipedia page, this is just an extract.

There are two different types of encryption:

  • AACS, performed using keys)
  • BD+, performed using a small embedded Java VM that executes programs and decrypts contents

And one type of “enhanced” java embedded menu (even small apps, like internet connected browsers, etc.) that can run on the BluRay player:

  • BD-J, using a GEM standard Java VM that includes also BDlive, for internet access

If any of these is implemented in a disk you own, the thing you need to do is simply insert a disk and run the bd_info command (from the libbluray-utils package) against your BD/DVD device.

Screenshot from 2015-08-27 10-59-57

This, of course, does work if you have the proper decryption keys or software installed on your system. That is, by default, nothing. 🙂

So, to enable decryption of the discs, you can proceed in two different ways, one using only open source software (not really, as you need anyway keys and a JVM dump of a BluRay Player) or going through commercial software (free at the moment while in beta).

Unfortunately none of my BluRays worked with open source tools on my system. I was not even able to get the required keys with the aacskeys program; so the proprietary software is my current choice.

Required repositories

In both cases, first of all enable the RPMFusion and the HandBrake/MakeMKV repository. Most of the keys required can be fetched from labDV, where you can also contribute back yours.

For the following examples I’m taking VideoLan as the main player, as it has good support (and a nice interface) to fiddle around with the various settings and is already available in RPMFusion.

Open Source AACS/BD+ decryption

First of all install libaacs and libbdplus from RPMFusion:

dnf install libaacs libbdplus

Then put the required AACS keys in a place, so that your AACS client can find them. For example:

mkdir -p ~/.config/aacs
wget -c http://www.labdv.com/aacs/KEYDB.cfg -O ~/.config/aacs/KEYDB.cfg

Now, VLC, using libbluray, should dynamically load the library if it finds it on the system and then decrypt the AACS protected content if the key for the specific disc is available.

Similar to AACS, put the required BD+ JVM dump in the appropriate folder, so that your BD+ client can find them. For example:

mkdir -p ~/.config/bdplus/
wget -c http://www.labdv.com/aacs/libbdplus/bdplus-vm0.bz2 -O ~/bdplus-vm0.bz2
tar -xvjf ~/bdplus-vm0.bz2 -C ~/.config/

Again, now libbluray should dynamically load the library if it finds it on the system and then decrypt the BD+ protected content using the VM dump in your personal folder.

Do not forget to update the AACS keys and the VM dump every once in a while!

Moving keys and dumps in a system wide location

This is required if you have multiple user for the system and you want to avoid each user into maintaining its own set of keys and dumps.
After installing everything in your personal folder, you will end up with a structure like the following:

$ find .config/bdplus .config/aacs | sort
.config/aacs
.config/aacs/KEYDB.cfg
.config/bdplus
.config/bdplus/vm0
.config/bdplus/vm0/aes_keys.bin
.config/bdplus/vm0/device_discovery_1.bin
.config/bdplus/vm0/device_discovery_2.bin
.config/bdplus/vm0/device_discovery_3.bin
.config/bdplus/vm0/device_discovery_4.bin
.config/bdplus/vm0/device_discovery_5.bin
.config/bdplus/vm0/ecdsa_keys.txt
.config/bdplus/vm0/mem_area_02.bin
.config/bdplus/vm0/mem_area_03.bin
.config/bdplus/vm0/mem_area_04.bin
.config/bdplus/vm0/mem_area_05.bin
.config/bdplus/vm0/mem_area_06.bin
.config/bdplus/vm0/mem_area_07.bin
.config/bdplus/vm0/mem_free.bin
.config/bdplus/vm0/memory.map
.config/bdplus/vm0/mem_player_executable.bin
.config/bdplus/vm0/mem_player_name.bin
.config/bdplus/vm0/mem_player_version.bin

To move up everything to a common location, just performs the following commands:

sudo mv ~/.config/{aacs,bdplus} /etc/xdg
sudo chown -R root:root /etc/xdg/{aacs,bdplus}

That’s it!

Proprietary AACS/BD+ decryption

This is done through MakeMKV, available from the HandBrake/MakeMKV repository, with the registration key available publicly from their forum. The software is fast, works really well, and although not open source is the only way to properly get access to your disks.

Support for external decoders has been added in libbluray some time ago, and allows you to specify different libraries than libaacs/libbdplus for decrypting content.

To proceed, remove the libaacs/libbdplus libraries if you have them installed, and install MakeMKV:

dnf remove libaacs libbdplus
dnf install libbdplus

As explained in the repository page, the MakeMKV package sets up environment variables that override the default libraries using for decryption and just uses MakeMKV’s libmmbd to launch a hidden MakeMKV instance for decryption in the background. To load the environment, logoff and login again, so it is picked up by any program starting.

After logging in, check that the environment is loaded with the following command:

$ env | egrep "LIBAACS_PATH|LIBBDPLUS_PATH"
LIBBDPLUS_PATH=/usr/lib64/libmmbd.so.0
LIBAACS_PATH=/usr/lib64/libmmbd.so.0

Then start VLC, select to open a BluRay disc, with or without the menus. Both will smoothly work as long as it is not a BD-J, as you can see in the pictures below. Menu is navigable, reactive to selections and clickable.

menus

Now also the command bd_info works fine, using the same mechanism.

BD-J Java menus

BD-J support is still in its infancy, at the moment of writing, with the latest libbluray 0.8.1 I am able to get part of the menus working. Most of the time I just got a video loop where the menu should be but not the actual menu. This is much better than having just VideoLan crashing, though. 🙂

Support for this is enabled by installing the libbluray-bdj package. The package puts an OpenJDK compiled Java Archive inside the classpath of the Java VM, so no further configuration is required. To install the package, just do:

dnf install libbluray-bdj

After this, in VideoLan you can just select “Open Disc”, “Blu-Ray” as the source and deselect “No disc menus”. As I said, support is not perfect, in the screnshot below I was able to see the menus but not click on them and in the background I was having a lot of errors.

bdj

I’m tracking the upstream project, so if the library can be rebuilt without breaking compatibility with the additional Fedora packages, I will add it to the repository along with MakeMKV. Before version 0.8.1 I was not even able to open a BD-J enabled BluRay disc with VideoLan.

One final curiosity

All my BD-J enabled discs have a Playstation 3 firmware update on the disc. Don’t know why, but probably because Sony owns the BluRay format so they can do as they please. Meh!

As always, feedback is welcome.