Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Jellyfin (BETA) #3932

Merged
merged 21 commits into from
Apr 21, 2021
Merged

Add Jellyfin (BETA) #3932

merged 21 commits into from
Apr 21, 2021

Conversation

publicarray
Copy link
Member

@publicarray publicarray commented Mar 25, 2020

Motivation: I wanted to have a go and try Jellyfin for myself. I probably stay on Plex for a little while longer but Jellyfin is really promising. This build creates a single 148mb binary that includes the required parts of the .NET framework. This way there are not hundreds of small dll files and is in-depended from other .NET framework versions. I'm not a .NET developer so I ask that the people over at jellyfin can have a look at some of the warnings in the build log.

Jellyfin works but adding plugins likely crashes the app

Linked issues: #3660 jellyfin/jellyfin#293

Checklist

  • Build rule all-supported completed successfully
  • Package upgrade completed successfully
  • New installation of package completed successfully

Here is a compiled version:
jellyfin_x64-6.1_10.5.2-0.spk

Updated: https://github.com/publicarray/spksrc/releases/tag/jellyfin-10.7.2

If there are errors please attach the log file:

# DSM 6 jellyfin log
cat /var/packages/jellyfin/target/var/jellyfin.log
# DSM 7 jellyfin log
cat /var/packages/jellyfin/var/jellyfin.log
# install log
cat /var/log/packages/jellyfin.log

@publicarray
Copy link
Member Author

When I enabled Hardware encoding I got this in the log:
Error processing request: /volume1/@appstore/jellyfin/var/data/transcodes does not exist.

Solution:

sudo mkdir /volume1/@appstore/jellyfin/var/data/transcodes
sudo chown sc-jellyfin:jellyfin /volume1/@appstore/jellyfin/var/data/transcodes

This also fixes video playback.

@ymartin59
Copy link
Contributor

@publicarray Already a good starting point. I would not add "npm" and "dotnet-core-sdk" in Docker image. I would move their installation and usage in "native/npm/" and "native/dotnet-core/".

@publicarray
Copy link
Member Author

publicarray commented Apr 17, 2020

Please don't merge yet. I want to see if I can cross compile the .NET runtime.

@publicarray
Copy link
Member Author

publicarray commented Apr 19, 2020

Unfortunately It's a bit more complicated than I thought. The script from https://github.com/dotnet/source-build/ uses git to download the dependencies which courses issues when git is inside git. I'll leave this for anyone wishing to continue to build dotnet-runtime:

https://github.com/dotnet/runtime/blob/master/docs/workflow/building/libraries/cross-building.md

PKG_NAME = dotnet-runtime
PKG_VERS = 3.1.3.2
PKG_EXT = tar.gz
PKG_DIST_SITE = https://github.com/dotnet/source-build/archive
PKG_DIST_NAME = v$(PKG_VERS)-runtime.$(PKG_EXT)
PKG_DIR =  source-build-$(PKG_VERS)-runtime

# libcurl, zlib
DEPENDS =

HOMEPAGE = https://dotnet.microsoft.com/
COMMENT  = A developer platform for building apps.
LICENSE  = MIT

CONFIGURE_TARGET = nop
COMPILE_TARGET = dotnet-compile
# INSTALL_TARGET = nop

include ../../mk/spksrc.cross-cc.mk

.PHONY: dotnet-compile
dotnet-compile:
	$(RUN) ./build.sh

@schmidex
Copy link

Thanks for your work @publicarray
Will this be merged without the cross compiled .NET runtime? Would this cause any dissadvantages?
I tried the compiled spk from your first post and it seems to run fine on my 918+ (after creating the transcodes folder). Only hardware transcoding doesn't work.
Maybe you can build an updated testbuild for yellfin 10.5.4. There were some fixes on jellyfin itself recently.

@publicarray
Copy link
Member Author

Yea probability. If we add more .net packages the file size on disk would be larger since .net would be included into every binary. But other than that none that I’m aware of.

Yea that is something that I’m aware of. It depends on the ffmpeg version you are using. You can try and download video station it comes with a different ffmpeg version and we also provide a ffmpeg package.

Thanks for letting me know.

@curro88
Copy link

curro88 commented Apr 22, 2020

Will be possible to build a package for 88f6282 architecture?

@publicarray
Copy link
Member Author

publicarray commented Apr 23, 2020

88f6282 is armv5 (32bit) and is supported by .NET Core, so yes it would be build once it's merged.

@publicarray
Copy link
Member Author

@chmidex Hardware transcoding/encoding with vaapi works well now with our updated ffmpeg package thanks to @th0ma7 just install the ffmpeg package and change the ffmpeg path to /var/packages/ffmpeg/target/bin/ffmpeg but note that not all codecs are accelerated.
You can check with: grep -A2 'Stream mapping:' /var/packages/jellyfin/target/var/log/ffmpeg-transcode-*

@curro88 88f6282 is a little more difficult than I initially thought. .NET does not contain the arch with a default install

@schmidex
Copy link

schmidex commented May 4, 2020

thanks for the tip. Works fine here now. I tried with an older ffmpeg version of that package before and got some strange not allowd issuses. Seems to be fixed now.

@publicarray
Copy link
Member Author

publicarray#10

@koelner21
Copy link

Jellyfin works but adding plugins likely crashes the app

This Function still works :) hahaha...

@schmidex
Copy link

I made a pull request for the new 10.6.0 jellyfin version..

But I ran into permission issues when compiling.

make arch-x64-6.1 stops with some dotnet permission error
sudo make arch-x64-6.1 stops (later) with an npm permisssion error when compiling jellyfin-web

any tips? Compiling jellyfin 10.5.5 worked fine

@publicarray
Copy link
Member Author

publicarray commented Jul 21, 2020

Thank you!
I've still been running plex, but this new update is great!

How do you run the commands in docker? Use docker pull synocommunity/spksrc to get the latest image and I used docker run --name spksrc --rm -it -v $(pwd):/spksrc:delegated -v :/root/.dotnet synocommunity/spksrc:latest /bin/bash to run the container.

You may need to clear out old files, $ make clean in /spksrc/native/nodejs/ and /spksrc/spk/jellyfin/.

I'm on macOS and get tar: jellyfin-10.6.0/build: Cannot utime: No such file or directory errors. A quick google search leads me to this: https://lists.gnu.org/archive/html/bug-gnulib/2019-07/msg00067.html
My current work around is just to run the same command a few times: root@4ae5b2fe63c2:/spksrc/spk/jellyfin# make arch-x64-6.1

I'm compiling the PR right now, once it's done I'll merge it.

@publicarray publicarray force-pushed the jellyfin branch 3 times, most recently from 6afa467 to 63a4748 Compare July 21, 2020 08:43
@schmidex
Copy link

Thank you for your help!
Compiling worked after using your command to run the docker container.

@hgy59 hgy59 added the dotnet Related to dotnet (core) label Jul 25, 2020
@adamh128
Copy link

Hi, any success compiling for a DS214play (Intel Atom Evansport)?

@publicarray
Copy link
Member Author

publicarray commented Aug 29, 2020

Hi @adamh128, I have not looked at cross compiling to 32-bit for a while, according to the build logs the 64 bit version can't natively compile to 32 bit (I'm not a .net dev) The exact error is error NETSDK1084: There is no application host available for the specified RuntimeIdentifier 'linux-x86' So the .NET framework runtime needs to be compiled/downloaded for the architecture first and integrated into the makefile in spksrc.
(https://dotnet.microsoft.com/download/dotnet-core/3.1 or https://github.com/dotnet/installer#installers-and-binaries)

Copy link
Contributor

@ymartin59 ymartin59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done for this work introduction both dotNet core and NodeJS as compilation tools.
I request improvements and also bug fixing 32 bits support for evansport - I will probably help about it (mine is evansport)

cross/jellyfin/Makefile Outdated Show resolved Hide resolved
cross/jellyfin/Makefile Outdated Show resolved Hide resolved
native/dotnet-sdk/Makefile Outdated Show resolved Hide resolved
spk/jellyfin/PLIST Outdated Show resolved Hide resolved
spk/jellyfin/Makefile Outdated Show resolved Hide resolved
@publicarray
Copy link
Member Author

@ymartin59 Thanks for the review I believe I've addressed everything. I've added dotnet make files, similar how go works. The Change log is there (just says "First Version").

IMHO NodeJS could be part of the docker image, at the moment I'm adding the binaries to the $PATH in the common make file.

@hgy59
Copy link
Contributor

hgy59 commented Apr 20, 2021

BTW the icons used in package center are not the ones in app/images folder but are taken from the spk (top level in package) and stored in the cache at /var/cache/pkglist.tmp/icon/AVAIL/OTHER/{package}/{version}/icon_{256,72}.png and /var/cache/pkglist.tmp/icon/INST/{package}/{version}/thumb_{256,72}.png for DSM6 and /var/cache/pkglist.tmp/icon/AVAIL/OTHER/{package}/{version}/icon_{256,64}.png and /var/cache/pkglist.tmp/icon/INST/{package}/{version}/thumb_{256,64}.png for DSM7.

In parallel of AVAIL/OTHER there is a folder AVAIL/SYNO for the packages provided by synology.
I can find some packages that have also a resolution of 120px or have 120px instead of 256px.

When you want to verify new icons, you have to delete the icon cache before installation to see updated icons in the package center of DSM.

@publicarray
Copy link
Member Author

publicarray commented Apr 20, 2021

After clearing the cache, I downloaded the file from /var/cache/pkglist.tmp/icon/INST/MariaDB10/10.3.24-1029/thumb_64.png the file is actually 72x72 pixels 🤷 (I'm using Firefox BTW, they do look better in chrome)
thumb_64
jellyfin-thumb_64

/var/cache/pkglist.tmp/icon/INST/SecureSignIn/1.0.1-0077/thumb_64.png:

I found the problem, I had FF zoom in because I have a high DPI screen. Sorry for that

@publicarray publicarray mentioned this pull request Apr 20, 2021
3 tasks
@th0ma7
Copy link
Contributor

th0ma7 commented Apr 21, 2021

@publicarray

@th0ma7 first I want to publish the package as is. (Just so we can get it out there). I think we can add that in the next version.

We can certainly do. The caveat is that the only option for users is to use the paid EPG site or fully manually create an alternative. Would pip install python-xmltv be much trouble for a start? Or does it need to be included part of the python3 package (and may already be, haven't checked yet)?

Yea I also think jellyfin rocks! IMHO It is better than plex in some aspects. But Plex does better in some other areas. Hard to pick a favourite at this point but im leaning towards jellyfin in the near feature. (Plex free tv or whatever, is worthless IMHO)

Fully agree about plex which led me to use tvheadend + kodi instead for OTA free TV.
Sadly I've hit this bug jellyfin/jellyfin-androidtv#308 which is sort of a blocker as that functionality works quite well with TVH timeshift functionality + kodi.

Other than that package LGTM.

@publicarray publicarray merged commit 4f26acd into SynoCommunity:master Apr 21, 2021
@publicarray
Copy link
Member Author

publicarray commented Apr 21, 2021

@th0ma7 jellyfin already has XMLTV support: https://github.com/jellyfin/Jellyfin.XmlTv, can you provide a (free) example file? I've used https://www.matthuisman.nz/2017/07/australia-iptv-epg-files.html and they work fine. I can look at adding something like zap2it-GuideScraping

edit: I see python-xmltv also scrapes data. Unfortunately It hasn't been updated since 2014, at least https://github.com/daniel-widrick/zap2it-GuideScraping has been updated to python3

@publicarray publicarray added status/published Published and activated (may take up to 48h until visible in DSM package manager) and removed status/needs-review labels Apr 22, 2021
@publicarray publicarray deleted the jellyfin branch April 22, 2021 02:10
@hgy59
Copy link
Contributor

hgy59 commented Apr 22, 2021

❤️ Just added Jellyfin in #4524

@publicarray
Copy link
Member Author

publicarray commented Apr 22, 2021

Thanks mate!

@florianbrinkmann
Copy link

Is there anything to do for users who installed the package manually before it was added to the SynoCommunity repo? Or do those users automatically get updates from there now?

@publicarray
Copy link
Member Author

Hey @florianbrinkmann. Yes, everyone who installed the package manually will get future updates from SynoCommunity.

@florianbrinkmann
Copy link

Great, thanks for the info and thanks again for your work @publicarray!

@DigitalBox98
Copy link
Contributor

I've just installed it on DSM 7.0 and it's working fine.
Great job @publicarray !

@th0ma7
Copy link
Contributor

th0ma7 commented Apr 23, 2021

@th0ma7 jellyfin already has XMLTV support: https://github.com/jellyfin/Jellyfin.XmlTv, can you provide a (free) example file? I've used https://www.matthuisman.nz/2017/07/australia-iptv-epg-files.html and they work fine. I can look at adding something like zap2it-GuideScraping

That is exactly what I was referring in my original post #3932 (comment) . I haven't found any freely available EPG pre-built XMLTV listing for Canada, we must built our own. Ref my doc online: https://github.com/th0ma7/synology/wiki/TVHeadend:-5)-Guide-t%C3%A9l%C3%A9

edit: I see python-xmltv also scrapes data. Unfortunately It hasn't been updated since 2014, at least https://github.com/daniel-widrick/zap2it-GuideScraping has been updated to python3

EDIT: I haven't looked into the weeds yet but I believed zap2it-GuideScraping was making use of python-xmltv as back-end. Tested: no it does not use it.

I'm currently using a perl version of zap2it but due to the CPAN complexity over DSM I'd rather move the the easier to support python version of it.

EDIT: After playing with it I now believe we would be better of creating a zap2it (or XMLTV EPG Scrapper Collection) package instead. The integration could then be independent from both tvheadend and jellyfin.

EDIT2: I must admit that the perl version is doing a better overall job. But the python version would work.

@th0ma7
Copy link
Contributor

th0ma7 commented Apr 23, 2021

@publicarray @th0ma7 Here's the list of patches we currently use on Debian, which should be considered the "default" platform for Jellyfin: https://github.com/jellyfin/jellyfin-ffmpeg/blob/jellyfin/debian/patches/series

@anthonylavado

I'll start-up an new PR to update from 4.3.1 to 4.3.2 and do a round of vaapi updates while at it.
Looking at things patches looks like should in theory be relatively trivial to add to our repo.
I'll add you both to the loop.

@marcoh242
Copy link

Is the jellyfin Package maintained and gets updated regulary?

@publicarray
Copy link
Member Author

Is the jellyfin Package maintained and gets updated regulary?

Um yes. Is there something in particular that you are looking for?

@marcoh242
Copy link

I was looking for an up-to-date Jellyfin Version(10.7.7) and considered doing it nyself

@publicarray
Copy link
Member Author

PRs are always appreciated but this is a very minor version with 3 specific and small fixes

@radiogalva
Copy link

Hi, first of all, thank You very much for making jellyfin available for us! :)

I had it installed installed in DSM6 DS418 and it was working very well, I did upgrade to DSM7 now and after doing repair Jellyfin app, clients would connect to it and only option available was to create new account (no access to previous library).
So I did uninstall Jellyfin app in Synology and chose an option to keep aplication data (with hope that fresh install would pick up old DB and account data). But now when I try to install Jellyfin I get this error:
firefox_dMf18pWXtJ

I'm sure that port 8096 is not taken by any other service. Could it be that old installation files contain some link to port 8096 and that's why I can't install Jellyfin anymore?

At this point I don't care much for old DB and userdata, I would be happy to start all fresh. Is there some way to clear this locked port?

@hgy59
Copy link
Contributor

hgy59 commented Dec 10, 2021

to evaluate whether the port is in use you can ssh into your diskstation and run as root:

netstat -tulpn | grep 8096

or probably the former port reservation file was not uninstalled.
You find those files (*.sc) in the folder /usr/local/etc/services.d/

If you have a file /usr/local/etc/services.d/jellyfin.sc you can simply delete it.
Otherwise you could look into existing *.sc files for reservation of port 8096.

You also can inspect the assigned ports in DSM with "Control Panel" - "Network" - "Traffic Control"
Select "Create" - "Select from a list of build-in applications" - "Select" to see the list of "Built-in Applications" and the related Ports.
May be this is the fastest way to find, whether a port is assigned to an application.

@radiogalva
Copy link

@hgy59 thank You for help! Indeed there was jellyfin.sc file from previous installation. After removing it - new install finished without an error and everything is working great again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet Related to dotnet (core) status/published Published and activated (may take up to 48h until visible in DSM package manager)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet