Jump to content

Emby Theater for Linux


xnappo

Recommended Posts

haraldov

To sum up all my experiences with ET for electron on pi3 here comes my install instructions. Updated 25.12.2007

pi@raspberrypi:~ $ sudo apt-get install npm
pi@raspberrypi:~ $ sudo apt-get install nodejs-legacy

# Issues with the option --disable-gpu and Chrome. Downgrade the electron version
# https://github.com/electron/electron/issues/9164
pi@raspberrypi:~ $ sudo npm -g install electron@1.4.16

# Instead of sudo apt-get install mpv 
# build yourself: https://emby.media/community/index.php?/topic/42868-emby-theater-for-linux/?p=442130

pi@raspberrypi:~ $ sudo apt install git
pi@raspberrypi:~ $ cd ~
pi@raspberrypi:~ $ git clone https://github.com/MediaBrowser/emby-theater-electron.git
pi@raspberrypi:~ $ cd emby-theater-electron

# Make sure you install the local node-mpv package because ET is using a customized version 
# https://emby.media/community/index.php?/topic/42868-emby-theater-for-linux/?p=455028
#  Electron can be installed globally, but node-mpv must be installed locally.

# Listing the contents of the node_modules directory
pi@raspberrypi:~/emby-theater-electron $ ls node_modules
is-linux  is-osx  is-windows  long  node-mpv  power-off  sleep-mode

# Install the local node modules
# https://docs.npmjs.com/getting-started/installing-npm-packages-locally
pi@raspberrypi:~ $ cd /home/pi/emby-theater-electron/
pi@raspberrypi:~ $ npm install

# Run Emby Theater for linux
pi@raspberrypi:~ $ electron main.js

# After ET startup choose Setting --> Video Setting --> Hardware acceleration mode --> RPI 

Trouble?

 

If you get error message when installing node or npm or having problem to install the local node modules try to upgrade node and npm:

# https://github.com/nodesource/distributions
# Upgrading node on ubuntu
~$ curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
~$ sudo apt-get install -y nodejs

# Upgrading npm: https://docs.npmjs.com/getting-started/installing-node
$ sudo npm install npm@latest -g

If you get this error message when installing electron:

/usr/lib/node_modules/electron/install.js:47
  throw err
  ^

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/electron/.electron'

try this:

# Source: https://github.com/npm/npm/issues/17268
~$ sudo npm -g install electron@1.4.16 --unsafe-perm=true --allow-root
Edited by haraldov
  • Like 1
Link to comment
Share on other sites

mitomac

Greetings all,

 

I feel like I'm close, but must be missing something obvious.  I'm running ubuntu 17.4 (lxde) on an intel box with the 915 chipset. I can play streams from mpv with no problem, but in ET -- nothing plays. The OSD timer runs -- suggesting that something is happening, but there is no video.  I also see a weird ghosting where there seems to be multiple overlays.  

 

Many thanks for any suggestions!

 

mitomac

 

davidm@emby:~$ mpv --version
mpv git-076116a © 2000-2017 mpv/MPlayer/mplayer2 projects
 built on Sat Apr  8 01:12:12 UTC 2017
ffmpeg library versions:
   libavutil       55.48.100
   libavcodec      57.83.100
   libavformat     57.66.104
   libswscale      4.3.101
   libavfilter     6.76.100
   libswresample   2.4.100
ffmpeg version: git-2017-03-13-33e997d

 

davidm@emby:~/src/emby-theater-electron$ nodejs -v
v4.7.2

 

davidm@emby:~$ electron -v
v1.4.16

 

davidm@emby:~/src/emby-theater-electron$ npm list
emby.theater@2.7.9 /home/davidm/src/emby-theater-electron
├── is-windows@1.0.0
├── long@3.2.0
├─┬ node-mpv@1.0.3
│ ├─┬ cuid@1.3.8
│ │ ├── browser-fingerprint@0.0.1
│ │ ├── core-js@1.2.7
│ │ └── node-fingerprint@0.0.2
│ ├── lodash@4.17.4
│ └─┬ promise@7.1.1
│   └── asap@2.0.5
├─┬ power-off@1.1.2
│ ├── is-linux@1.0.1
│ ├── is-osx@1.0.2
│ └─┬ meow@3.7.0
│   ├─┬ camelcase-keys@2.1.0
│   │ └── camelcase@2.1.1
│   ├── decamelize@1.2.0
│   ├─┬ loud-rejection@1.6.0
│   │ ├─┬ currently-unhandled@0.4.1
│   │ │ └── array-find-index@1.0.2
│   │ └── signal-exit@3.0.2
│   ├── map-obj@1.0.1
│   ├── minimist@1.2.0
│   ├─┬ normalize-package-data@2.3.8
│   │ ├── hosted-git-info@2.4.2
│   │ ├─┬ is-builtin-module@1.0.0
│   │ │ └── builtin-modules@1.1.1
│   │ ├── semver@5.3.0
│   │ └─┬ validate-npm-package-license@3.0.1
│   │   ├─┬ spdx-correct@1.0.2
│   │   │ └── spdx-license-ids@1.2.2
│   │   └── spdx-expression-parse@1.0.4
│   ├── object-assign@4.1.1
│   ├─┬ read-pkg-up@1.0.1
│   │ ├─┬ find-up@1.1.2
│   │ │ ├── path-exists@2.1.0
│   │ │ └─┬ pinkie-promise@2.0.1
│   │ │   └── pinkie@2.0.4
│   │ └─┬ read-pkg@1.1.0
│   │   ├─┬ load-json-file@1.1.0
│   │   │ ├── graceful-fs@4.1.11
│   │   │ ├─┬ parse-json@2.2.0
│   │   │ │ └─┬ error-ex@1.3.1
│   │   │ │   └── is-arrayish@0.2.1
│   │   │ ├── pify@2.3.0
│   │   │ └─┬ strip-bom@2.0.0
│   │   │   └── is-utf8@0.2.1
│   │   └── path-type@1.1.0
│   ├─┬ redent@1.0.0
│   │ ├─┬ indent-string@2.1.0
│   │ │ └─┬ repeating@2.0.1
│   │ │   └─┬ is-finite@1.0.2
│   │ │     └── number-is-nan@1.0.1
│   │ └─┬ strip-indent@1.0.1
│   │   └── get-stdin@4.0.1
│   └── trim-newlines@1.0.0
└─┬ sleep-mode@1.1.0
  └── is-windows@0.1.1

 

593429622822c_screenshot20170604112821.p

Edited by mitomac
Link to comment
Share on other sites

haraldov

It looks like you are missing some dependency node-mpv need.

 

59348f99cfe00_Missing_dependency.png

Try this: Source https://emby.media/community/index.php?/topic/42868-emby-theater-for-linux/?p=454961

pi@raspberrypi:~ $ sudo npm install cuid
pi@raspberrypi:~ $ sudo npm install promise
pi@raspberrypi:~ $ sudo npm install lodash
pi@raspberrypi:~ $ sudo npm install meow
Edited by haraldov
Link to comment
Share on other sites

mitomac

Hi Haroldov --

 

Thanks!  This is funny, but those error strings are NOT from my install,  but from my browser window -- reading that thread!  My apologies, I should have cropped the screen shot.

 

npm list does not reveal any unmet dependencies...

 

mitomac

Link to comment
Share on other sites

Mayankel

Hi,

 

i have the same problem as Denz. Raspberry Pi 3 with Raspbian and the Linux version, and everytime i try to play a video i just get the backdrop and the circle. In the terminal i got the message above:

 

 

thump_9747904errorembylinuxpi.jpg

 

Any idea?

 

Thanks and best regards

Link to comment
Share on other sites

mitomac

Just to come full circle --  I have been able to get this version of emby-theater-electron to run on a pi3 following instructions from Haraldov (although I was not able to get it to work on a linux chromebox...).  A few things of note that may explain some of the issues people have been having.

 

1.  It does not play well with the tvheadend plugin on the emby-server.  Live tv or recordings managed by the tvheadend plugin do not get routed through mpv, but rather play through the native chromium browser and are just rendered via software codecs (too slow to be useable).   It does however, work with m3u streams handled directly by emby-server.

 

2.  At least on the pi3 I have been able to play and view videos using electron1.4.14, 1.4.16, and 1.6.x.

 

3.  Videos play and I am able to control them -- BUT... there are no onscreen controls displayed.  Mpv(git) seems to render in the top most layer with nothing else being able to be overlayed on that layer.  This also happens if I start mpv from the desktop not in fs mode -- it renders the movie, but you can not place another window over the render.

 

4.  If I play a 480 movie in ET (and don't have fs=yes in the mpv config file) then ET will render the movie on top and only partially obscure the fan art and the onscreen control display.  There seem to be multiple on screen displays.  Fan art with a static onscreen display and then a transparent but slightly shifted onscreen display that is activated when you interact with the movie - but these are only visible on small movies that do not take up the full screen.  

 

I'm hoping these clues might help someone point me to the obvious fix -- could it be that vo-opengl is rendering straight to the device overriding any other layers?

 

thanks again Harladov for the great write up!

 

Cheers!  

 

mitomac

Link to comment
Share on other sites

@@mitomac thanks for the feedback. I think this will all be easier once we have a friendly install package that takes care of all of that work for you.

Link to comment
Share on other sites

  • 1 month later...

@@haraldov please try your live tv again. it should use mpv now, not the chromium player.

 

Also just a general announcement. The latest updates have added live seeking support for Live TV. Enjoy.

Link to comment
Share on other sites

denz

Has anyone had luck running this version of theater in rpi I can get it to work and the other theater for pi is not working well as it should be sometimes the osd won't disappear, video doesn't stop but becomes  transparent.

 

The electron version I get this error 

 

 

59697bd01ae4c_Selection_001.png

 

pi@raspberrypi:~/emby-theater-electron $ npm ls
emby.theater@2.8.1 /home/pi/emby-theater-electron
├── asap@2.0.6
├─┬ cuid@1.3.8
│ ├── browser-fingerprint@0.0.1
│ ├── core-js@1.2.7
│ └── node-fingerprint@0.0.2
├── is-linux@1.0.1
├── is-osx@1.0.2
├── is-windows@1.0.0
├── lodash@4.17.4
├── long@3.2.0
├─┬ meow@3.7.0
│ ├─┬ camelcase-keys@2.1.0
│ │ └── camelcase@2.1.1
│ ├── decamelize@1.2.0
│ ├─┬ loud-rejection@1.6.0
│ │ ├─┬ currently-unhandled@0.4.1
│ │ │ └── array-find-index@1.0.2
│ │ └── signal-exit@3.0.2
│ ├── map-obj@1.0.1
│ ├── minimist@1.2.0
│ ├─┬ normalize-package-data@2.4.0
│ │ ├── hosted-git-info@2.5.0
│ │ ├─┬ is-builtin-module@1.0.0
│ │ │ └── builtin-modules@1.1.1
│ │ ├── semver@5.3.0
│ │ └─┬ validate-npm-package-license@3.0.1
│ │   ├─┬ spdx-correct@1.0.2
│ │   │ └── spdx-license-ids@1.2.2
│ │   └── spdx-expression-parse@1.0.4
│ ├── object-assign@4.1.1
│ ├─┬ read-pkg-up@1.0.1
│ │ ├─┬ find-up@1.1.2
│ │ │ ├── path-exists@2.1.0
│ │ │ └─┬ pinkie-promise@2.0.1
│ │ │   └── pinkie@2.0.4
│ │ └─┬ read-pkg@1.1.0
│ │   ├─┬ load-json-file@1.1.0
│ │   │ ├── graceful-fs@4.1.11
│ │   │ ├─┬ parse-json@2.2.0
│ │   │ │ └─┬ error-ex@1.3.1
│ │   │ │   └── is-arrayish@0.2.1
│ │   │ ├── pify@2.3.0
│ │   │ ├─┬ pinkie-promise@2.0.1
│ │   │ │ └── pinkie@2.0.4
│ │   │ └─┬ strip-bom@2.0.0
│ │   │   └── is-utf8@0.2.1
│ │   └─┬ path-type@1.1.0
│ │     ├── graceful-fs@4.1.11
│ │     ├── pify@2.3.0
│ │     └─┬ pinkie-promise@2.0.1
│ │       └── pinkie@2.0.4
│ ├─┬ redent@1.0.0
│ │ ├─┬ indent-string@2.1.0
│ │ │ └─┬ repeating@2.0.1
│ │ │   └─┬ is-finite@1.0.2
│ │ │     └── number-is-nan@1.0.1
│ │ └─┬ strip-indent@1.0.1
│ │   └── get-stdin@4.0.1
│ └── trim-newlines@1.0.0
├─┬ node-mpv@1.2.0
│ └── promise@7.3.1
├── power-off@1.1.2
└─┬ sleep-mode@1.1.0
  └── is-windows@0.1.1
Edited by denz
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
Qoolbox

Wonder if anyone can build an .AppImage

 

an headache to compile it for the Qnap HD_Station (Ubuntu x64 14.04.1 chroot)

Link to comment
Share on other sites

haraldov

@haraldov please try your live tv again. it should use mpv now, not the chromium player.

 

@@Luke

ET is working great with livetv and Emby recordings. I takes around 8 seconds to play livetv streams with mpv from vdr (using the plugin vdr-streamdev-server).

 

I use mpv version 0.26 with mmal support compiled in which work great with rpi3. The mpv git version give errors when compiling on rpi. https://github.com/mpv-player/mpv-build/issues/89 I advice others to follow my post howto compile mpv: https://emby.media/community/index.php?/topic/42868-emby-theater-for-linux/?p=442130 .Use the option ./use-mpv-release for downgrading the git version to the newest mpv release.

 

I have also updated my post howto install ET for linux on rpi https://emby.media/community/index.php?/topic/42868-emby-theater-for-linux/?p=455189 with customized node-mpv. 

 

Issues with ET:

1) Mpv fullscreen do not always work in livetv. 

Example: Mpv do not start fullscreen with livetv channel Nrk1, but with Tv3 it does. I attach output from ffprobe of both the channels. The ET setWindowState is Maximized when doing this. 

As a workaround I can use the mpv option fs in the mpv configuration file ~/.config/mpv/mpv.conf which gives my fullscreen in ET.

 

2) Cec support do not work

I attach output from ET starting. I have installed cec-utils and libcec before this. It looks like ET do not find cec-client 

pi@raspberrypi:~ $ whereis cec-client

cec-client: /usr/bin/cec-client /usr/share/man/man1/cec-client.1.gz
 
3) Some livetv channels (Nrk1, Tv3) are dropping audio frame because of embedded ac3 or ac_latm (HE-AAC) streams which gives audio sync problem.
I have a Samsung soundbar which my rpi are connected to with HDMI. It looks like mpv have problems to guess whick track to use because it is using the Auto mode I think. When starting the livetv streams from these channels sometime the audio/video are in sync and everything is fine and sometime not. I have tried to use different setting in ET to solve this, but I have not yet found the correct audio setting. In the setting --> Audio Setting I have chosen Speaker Layout Stereo instead of Auto. I have not choosen to enable passthrough for AC3. 
If I play these livetv streams directly with mpv without any mpv option I do not have these audio sync problems.

Tv3-probe.txt

Nrk1-probe.txt

et-start.txt

Edited by haraldov
Link to comment
Share on other sites

haraldov

3) Some livetv channels (Nrk1, Tv3) are dropping audio frame because of embedded ac3 or ac_latm (HE-AAC) streams which gives audio sync problem

 

I think I found out why I get audio/video sync problems. If I enable verbose logging I can see ac3 (5.1) are converted to stereo (2 channels). This is correct because my Samsung LCD Tv only support stereo (pcm).

pi@raspberrypi:~ $ /opt/vc/bin/tvservice -a
     PCM supported: Max channels: 2, Max samplerate:  48kHz, Max samplesize 24 bits.

But the video is sometime played with software decoding and sometime with hardware decoding (ffmpeg mmal decoding) so this is not a ac3 audio problem. I will investigate further this.

pi@raspberrypi:~ $ mpv -v "http://192.168.9.2:3000/S1.0W-70-25-7432"
....
[lavrresample] Remix: 5.1(side) -> stereo
[af] Audio filter chain:
[af]   [in] 48000Hz 5.1(side) 6ch floatp
[af]   [lavrresample] 48000Hz stereo 2ch float [a]
[af]   [out] 48000Hz stereo 2ch float
[af]   [ao] 48000Hz stereo 2ch float
[ffmpeg/video] h264_mmal: Did not get output frame from MMAL.
[vd] Error while decoding frame!
[ffmpeg/video] h264_mmal: Did not get output frame from MMAL.
[vd] Error while decoding frame!
[ffmpeg/video] h264_mmal: Did not get output frame from MMAL.
[vd] Error while decoding frame!
[vd] Falling back to software decoding.

mpv-play-viasat4.txt

Edited by haraldov
Link to comment
Share on other sites

Ok here instead of the rpi thread.

 

I can not install electron

 

sudo npm -g install electron

 

returns errors about types/node is not in the npm registry.

Link to comment
Share on other sites

@@Dec64

 

Have you tried following my notes about installing Emby Theater for linux on raspbian ? https://emby.media/community/index.php?/topic/42868-emby-theater-for-linux/?p=455189

 

You need a specific version of Electron because the newest version of electron has issues with Chrome hardware acceleration.

pi@raspberrypi:~ $ sudo npm -g install electron@1.4.16
npm ERR! TypeError: Cannot read property '1.4.16' of undefined
npm ERR!     at /usr/share/npm/lib/cache/add-named.js:123:27
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 4.9.35-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "-g" "install" "electron@1.4.16"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! type non_object_property_load
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/npm-debug.log
npm ERR! not ok code 0

Does not work

Link to comment
Share on other sites

geaves

I've been following both threads, here and the Pi.....one of options I have tried (I'm now going to do a clean install) was this which was posted in the Pi forum;

 

sudo apt-get install git && git clone https://github.com/audstanley/NodeJs-Raspberry-Pi-Arm7 && cd NodeJs-Raspberry-Pi-Arm7 && chmod +x Install-Node.sh && sudo ./Install-Node.sh;

 

this then would run sudo npm -g install electron.

 

But because I have been trying so many options I'm going to start again with a clean install of Raspbian.....and if I can get it all to work looks like a Premiere :)

Link to comment
Share on other sites

right so i have moved on with @@haraldov's instructions. But mpv won't build. Any one any ideas, seen this error before?

Waf: Leaving directory `/home/pi/mpv-build/mpv/build'
Build failed
 -> task in 'mpv' failed with exit status 1 (run with -v to display more information)
debian/rules:69: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 1
make[1]: Leaving directory '/home/pi/mpv-build'
debian/rules:23: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Link to comment
Share on other sites

haraldov

returns errors about types/node is not in the npm registry.

You get this error because the npm electron package depend on the npm package @types/node https://www.npmjs.com/package/electron.

You can try to install like this https://www.npmjs.com/package/@types/node but I think you get the same errors.

npm install --save @types/node 

I think you need to upgrade npm and node following the method @@geaves suggested and after that install electron. Source: http://ww2.audstanley.com:3003/install-nodejs-on-raspberry-pi/

cd;  
git clone https://github.com/audstanley/NodeJs-Raspberry-Pi;  
cd NodeJs-Raspberry-Pi;  
chmod +x Install-Node.sh;  
sudo ./Install-Node.sh;  
cd .. && rm -R -f NodeJs-Raspberry-Pi/;  
node -v; 
pi@raspberrypi:~ $ node -v
v8.3.0
pi@raspberrypi:~ $ npm -v
5.3.0
Edited by haraldov
Link to comment
Share on other sites

haraldov

But the video is sometime played with software decoding and sometime with hardware decoding (ffmpeg mmal decoding) so this is not a ac3 audio problem

 

Found out why mpv sometimes do software decoding. I got this error because mpv immediately falls back to software decoding if there is a error using the hardware decoder. This issue has been reported earlier here https://github.com/mpv-player/mpv/issues/925

[ffmpeg/video] h264_mmal: Did not get output frame from MMAL.
[vd] Error while decoding frame!
[ffmpeg/video] h264_mmal: Did not get output frame from MMAL.
[vd] Error while decoding frame!
[ffmpeg/video] h264_mmal: Did not get output frame from MMAL.
[vd] Error while decoding frame!
[vd] Falling back to software decoding.

The solution I found out was to use the mpv option 

--demuxer-lavf-probe-info=no

 Because mpv is not trying to probe which codecs to use for the video in the ts stream I do not have the errors and mpv is not falling back to software decoding.

As a bonus the livetv streaming is a lot faster. With tvheadend ts streaming the livetv start up after 4 seconds because we do not have probing of the ts stream. 

--demuxer-lavf-probe-info=<yes|no|auto>
Whether to probe stream information (default: auto). 
Technically, this controls whether libavformat's avformat_find_stream_info() function is called. 
Usually it's safer to call it, but it can also make startup slower.

The auto choice (the default) tries to skip this for a few know-safe whitelisted formats, while calling it for everything else.
Edited by haraldov
Link to comment
Share on other sites

geaves

Clean install followed all the commands including the changes.....now when do ./et.sh I get an error electron: command not found :)

 

EDIT: If you search enough you'll find an answer sudo npm -g install electron --unsafe-perm=true --allow-root

 

Well that reinstalled electron....or supposedly, but still the same error....

Edited by geaves
Link to comment
Share on other sites

haraldov

error electron: command not found

 

Use the command whereis for searching in the path

pi@raspberrypi:~/emby-theater-electron $ whereis electron
electron: /usr/lib/electron /usr/local/bin/electron /opt/nodejs/bin/electron

Edit et.sh and write in the correct electron path like this:

/usr/local/bin/electron --enable-transparent-visual main.js
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...