Jump to content

Running Emby as a service with NSSM/Task Manager - Can't play back locally.


Go to solution Solved by Luke,

Recommended Posts

NightWalker86
Posted

Hi All,

 

I've been using Emby Premiere for a while now and I'm really liking it with the exception of 2 problems. First is that I need this to run as a service and the second is with a stuttering issue with Recorded TV playback. I'll make a separate thread for the stuttering issue. I followed the Github guide Luke posted and configured Emby to run as a service using NSSM and I'm experiencing some weird behavior. I'll break this all down as best I can.

 

Environment:

 

1. Emby is running in a Hyper-V VM hosted on a Server 2016 Datacenter edition host. The Guest OS being used for Emby is also Server 2016 D.C.

2. The Emby server is part of my Active Directory domain.

 

Problem:

 

1. After installing Emby as a service with NSSM, I can get Emby to play just fine from my phone externally from T-Mobile's network. As soon as I try to stream something locally though, the screen just spins whenever hitting the play button and nothing will load at all.

 

2. Nothing at all has changed within my network (verified nothing is being blocked within the pfSense firewall, Windows firewall, etc.). Disabling the NSSM service created, restarting the VM, and then logging back in to allow EmbyServer.exe to start as it did before resolves the problem.

 

3. Since NSSM wasn't doing the trick, I found the AppData path for EmbyServer.exe being referenced in Task Manager and then configured that in Task Scheduler to start on startup. The exact same problem occurred wherein Emby is accessible/browsable but the second I try to play something locally I can't.

 

Steps taken:

 

1. Configured Emby to use NSSM as outlined in the Github article. Had to change the service to use the domain admin account I used when setting Emby up originally otherwise Emby would not update any libraries and I lost things like my Recordings folder. Note that this is the same account that I login with and then disconnect normally to get Emby up and running. Makes sense since it looks like quite a bit of the files reside in that profile's AppData folder.

 

2. Tried NSSM/Task manager using both the domain admin account for credentials as well as local system account.

 

Observations:

 

1. The Emby server itself seems to come online just fine, the problem is happening when playback is initiated. Something to do with how a codec is being called? Permissions?

 

2. I noticed the following in the logs when the problem is occurring:

 

Input #0, mpegts, from 'file:\\X.X.X.X\x$\TV Shows\Live TV Recordings\American Dad\Season 3\American Dad S03E02 Meter Made.ts':
  Duration: 00:31:00.15, start: 93607.430944, bitrate: 16623 kb/s
  Program 3 
    Stream #0:0[0x31]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 1920x1080 [sAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x34](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
    Stream #0:2[0x35](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 128 kb/s
[AVHWDeviceContext @ 00000283c192e6c0] Failed to create Direct3D device
Device creation failed: -1313558101.
[mpeg2video @ 00000283c185f240] No device available for decoder: device type dxva2 needed for codec mpeg2video.
 
I can upload the entire log file but would prefer to do that privately since it contains references to my domain accounts.
 
Any ideas? I really need to get this up and running as a service somehow because having to login with the domain account and then leave it disconnected is a huge pain and a security concern. Every time WSUS updates this server I need to remember to manually log back in and disconnect to get Emby up and going again.
 
Thanks for the help!
  • Solution
Posted

You won't be able to use hardware acceleration when running as a service, at least not to my knowledge.

  • Like 1
NightWalker86
Posted

You won't be able to use hardware acceleration when running as a service, at least not to my knowledge.

 

Ugh, I should have caught that. Turned off hardware acceleration in the transcoding settings, re-enabled the service, rebooted the server without logging back in and it looks like it is working totally fine now. Thanks for the assist Luke! I've got one more issue that I'll open a separate thread for.

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...