nurdism/neko

[Feature Request] Add Neko variant using custom Chromium build from Woolyss

WhaleHub opened this issue · 9 comments

Is your feature request related to a problem? Please describe.
If a user wants to watch a media file that has been encoded in HEVC/x265 in the currently available builds of Neko, the video playback will either outright fail or cause the origin server to first transcode the video before serving it, a process which greatly reduces the quality of the video. HEVC is burdened by its patents and licensing fees which is why it currently isn't supported by the two big browsers Firefox and Chrome and likely never will be.

Describe the solution you'd like
Since Chrome is based on the open-source project Chromium, people have developed custom variants of the latter with support for HEVC/x265. These are available for all major platforms, including Linux, and can be downloaded on Woolyss' website. The build that would have be used for Neko is this one (since it is marked with all-codecs+).

Describe alternatives you've considered
N/A

Additional context
N/A

m1k1o commented

You can create your own Dockerfile FROM nurdism/neko:openbox and install this.

This is Chomium dockerfile:

FROM nurdism/neko:openbox
#
# install neko chromium
RUN set -eux; apt-get update; \
apt-get install -y --no-install-recommends unzip chromium; \
#
# install widevine module
WIDEVINE_VERSION=$(wget --quiet -O - https://dl.google.com/widevine-cdm/versions.txt | tail -n 1); \
wget -O /tmp/widevine.zip "https://dl.google.com/widevine-cdm/$WIDEVINE_VERSION-linux-x64.zip"; \
unzip -p /tmp/widevine.zip libwidevinecdm.so > /usr/lib/chromium/libwidevinecdm.so; \
chmod 644 /usr/lib/chromium/libwidevinecdm.so; \
rm /tmp/widevine.zip; \
#
# clean up
apt-get --purge autoremove -y unzip; \
apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#
# copy configuation files
COPY .docker/files/chromium/supervisord.conf /etc/neko/supervisord/chromium.conf
COPY .docker/files/chromium/preferences.json /usr/share/chromium/master_preferences
COPY .docker/files/chromium/policies.json /etc/chromium/policies/managed/policies.json
COPY .docker/files/chromium/openbox.xml /etc/neko/openbox.xml

I would looking forward to see H265 support in neko!

@m1k1o Thanks for the pointer, but it looks like some of the required libraries (e.g. libva2) are only available on Debian Buster and newer. This means that Neko's entire image chain (deps -> base -> openbox -> chromium) needs to be updated from Stretch to Buster for this change.

m1k1o commented

I did it already in my fork. Check it out. @WhaleHub

@m1k1o Ah, thank you. I'll start working on implementing support for the custom Chromium build based on your fork then.

I'm only running stretch because of the space savings (is not that much compared to Buster) @m1k1o if all the images work fine I don't mind changing to buster

@m1k1o I'm happy to report that I just finished implementing this feature request and that the custom Chromium build can indeed Direct Play both 8-bit and 10-bit HEVC content. I'll open a pull request on your repo once I've ironed out a bug where Chromium doesn't start with a maximized window even when using the --start-maximized runtime flag. While it can still be maximized by clicking on the corresponding button, I'd prefer to have it work like the original Neko.

Chromium

m1k1o commented

@nurdism buster works for me great. I created completly new workflow in my custom folder (didn't touch your old ones) hecne pull request from my fork would not be possible. Either you modify your dockerfiles according to mine or they would be completly replaced.

@WhaleHub i faced similar issue, where browser didn't start maximized. It was caused by missing openbox or bad window identifier.

https://github.com/m1k1o/neko/blob/aed37c553fc1221661a332787adb54d848fc8237/.m1k1o/chromium/openbox.xml#L16-L21

@m1k1o Bingo, that was it. I changed it from chromium-browser to chromium-devel and now it works as expected. I just opened a pull request on your repo. 👍

@alectrocute If you want to give this custom build a spin, feel free to use graywhale/neko:chromium. It's a drop-in replacement for the official Neko Chromium image, so it requires the same parameters, see https://n.eko.moe/#/docker.

m1k1o commented

@WhaleHub just tried it, works great. Thanks!