Jump to content

Emby not respecting mbps limit over cellular data?


Recommended Posts

Jcheinaman
Posted (edited)

Hello,

 

I'm running Emby 4.5.4.0 stable on Windows 10 and I'm experiencing a weird issue. I have the Internet streaming bitrate limit set to 5, however Emby does not appear to be honoring that limit while playing over the Emby for iOS app on cellular data. When I play a file from a remote wifi network, it honors the limit just fine. I'm confused. Any feedback? I started to play a movie on cellular data around 10:48pm and it was direct streaming at 15.5 mbps. Around 10:50pm, I joined a remote wifi network and played the same movie and it was limited to 5 mbps. Is there something I'm doing wrong? I even manually set the max bit rate for the user under their profile settings and it still played back at max bit rate. Any ideas? Please let me know if you need anything from me.

 

Thanks in advance!

embyserver.txt

Edited by Jcheinaman
Happy2Play
Posted (edited)

Are you using a vpn? 

To me the first playback thinks you are on your local network "IsInLocalNetwork: True" so limit is not applied and the second shows you are not "IsInLocalNetwork: False".

Edited by Happy2Play
  • Like 1
Posted

Yes he's right, your network configuration is causing the server to not be able to determine that the request is coming from out of network.

Jcheinaman
Posted

No, I’m not using a vpn on either the server or my phone. This is definitely weird issue for sure. 

Jcheinaman
Posted

This is so weird. I turned on express VPN on my phone on my cell network and it transcoded and respected the 5 mbps limit. I turned the VPN off and it started playing at 15.5 mbps again. Top picture has express VPN turned on my phone and the bottom is with the VPN off. Both on cellular data on the T-Mobile network.39F8EB3E-1ED7-41BD-9E26-B350E1FB6D41.thumb.png.4ac4641088fb99c284b98e4d20296aa4.png888A4D59-1E0E-4BF0-AE75-49557D9E1168.thumb.png.653c2c160f21fa32e4620f8ebe37bd9a.png

Jcheinaman
Posted (edited)

I ran a test on the cellular network in the mobile browser with no vpn turned on so that I am able to show you I’m on the mobile network. I don’t know what’s going on here. Regardless it has the same issue outside of the Emby app  

128C4DFC-6D5D-4356-A2A9-EBCA9DC1E70E.thumb.jpeg.7529373bfb2ae040402a36844d5d4621.jpeg

 

Edited by Jcheinaman
Posted

2021-02-09 20:38:01.191 Info App: RemoteClientBitrateLimit: 5000000, RemoteIp: 172.58.205.19, IsInLocalNetwork: True

Why is Emby classing this as a local network - this is not an RFC 1918 address ?

 

 

Posted (edited)

If you can cycle the logs, then repeat that test you did above and re-post the log - then we should be able to easily see the two 'WAN' based IP addresses being used - one from from 3G/4G cell connection and then a new one from your VPN provider. 

Both should NOT be RFC1918 addresses and thus IsInLocalNetwork should be False ... thus is should restrict both to 5 Mbit/sec.

Edited by rbjtech
Posted

If Emby is wrong (not sure here) - you can overwrite what it thinks is 'local' on the network config page below.

10.0.0.0/8
172.16.0.0/12
192.168.0.0/16

The above are RFC1918 addresses - so if you add these to the page below - it SHOULD make anything outside these addresses as  'remote'.

 

 

Capture.PNG

  • Like 1
Jcheinaman
Posted

Although Emby was reading my cellular IP address as local, I think I found the culprit. It was actually VPN related, but the VPN was turned off. I did have Express VPN installed on the server machine with split tunneling for a specific app to use the VPN. However, I had the VPN disconnected and closed on the server machine. It wasn't active. I guess somehow it was still causing Emby to think my cellular IP was local. It's just weird to me that it only did this via cellular connections. When I would connect to a remote wifi network, it worked fine. Regardless, it appears to be something that Express VPN screwed up. I uninstalled the app entirely and now it transcodes down to 5 mbps as expected.

I appreciate everybody's help. I know a little bit about everything, but I'm definitely not an expert lol.

Posted

I know you have fixed it youself 👍 but can you send the log of the previous test using both cell and VPN ?

Emby should not be categorising that IP as local - if it is, then it is a bug that needs fixing ..

 

Jcheinaman
Posted (edited)
9 minutes ago, rbjtech said:

I know you have fixed it youself 👍 but can you send the log of the previous test using both cell and VPN ?

Emby should not be categorising that IP as local - if it is, then it is a bug that needs fixing ..

 

Unfortunately, I didn't recycle the log before I ran that test. You should be able to easily locate the time I ran those tests based on the time I posted to the forum. I also ran a few more tests on the cell network after removing the VPN app entirely from the server machine. You should see that it is now limiting the stream correctly. Thank you again. Let me know if you find anything. I had a VPN on the server to use for the rare times I may actually use torrents. It was split tunneled to allow only the torrent client to use the VPN. However, as I stated, the VPN was completely off and closed out. Shouldn't have caused the issue, but it did. Regardless, my cell phone wasn't connected to a VPN and to me, it should still have been recognized as not being on the local network. Again I'm no expert. I know just enough to get me along lol. 

embyserver.txt

Edited by Jcheinaman
Posted

If you look at the server activity log you'll see the IP address for the remote client, and if that's not correct then you have something external from Emby Server that you need to look, such as reverse proxy settings if you have one, or the vpn.

Posted (edited)

Thanks for the log.  This confirms that the new WAN IP is classed correctly as 'IsInLocalNetwork' = False.

2021-02-10 13:56:55.183 Info App: RemoteClientBitrateLimit: 5000000, RemoteIp: 172.58.205.19, IsInLocalNetwork: True

@ebr @Luke  @Happy2Play - I'm confused why would it class this remote client as having a local address ?  Even if it was a VPN address, it is still a remote / WAN address ?

 

Edited by rbjtech
Jcheinaman
Posted (edited)

Yeah, I do use Caddy for reverse proxy for SSL, but I wouldn't even know where to begin with that. I just checked again, and it's now doing the same thing it was before. Not limiting bandwidth.

embyserver.txt

Edited by Jcheinaman
Posted

So the same thing is happening - emby is classing your WAN IP as 'local'  ...

Did you see my post above on forcing what emby considers 'local' - this is certainly worth trying imo.

Posted

I would explore the Emby Server network settings that can help you configure what addresses are considered in network and out of network.

  • Like 1
Jcheinaman
Posted
4 minutes ago, rbjtech said:

So the same thing is happening - emby is classing your WAN IP as 'local'  ...

Did you see my post above on forcing what emby considers 'local' - this is certainly worth trying imo.

THANKS! I missed that post and I really didn't even think about netmasks. This definitely fixed the issue. Although I'm still concerned why Emby isn't picking up that it was a remote network. I changed this to the solution! Thanks again to everyone for your help!!

Posted
13 hours ago, rbjtech said:

 I'm confused why would it class this remote client as having a local address ?  Even if it was a VPN address, it is still a remote / WAN address ?

 

14 hours ago, rbjtech said:

10.0.0.0/8
172.16.0.0/12
192.168.0.0/16

@Luke Can you check the code to verify that only these IPs mentioned above are considered local without any network override?

The IP he had should not have been considered local as it's not a reserved IP address. Only 172.16.0.0 – 172.31.255.255 are reserved in the 172 address space.

  • Like 1
Posted

Right, a 172.58 address like he mentioned earlier would not end up being considered in the private address space.

Posted

2021-02-10 13:56:55.183 Info App: RemoteClientBitrateLimit: 5000000, RemoteIp: 172.58.205.19, IsInLocalNetwork: True

Posted

Right but that's probably for another reason besides private address space.

Jcheinaman
Posted (edited)
On 2/11/2021 at 12:25 PM, Luke said:

Right but that's probably for another reason besides private address space.

Hello @Luke

I think I may have found what is causing my issue. I believe I discovered a bug in the Emby for iOS app for both iPhone and iPad. Ok, hear me out for a moment. 
 

when I log on to my server via the emby app, on either my iPhone or iPad via my home WiFi connection, Emby will play the media properly. Direct stream or direct play @ the original bit rate. Now if I close the app by opening the task manager and swiping the app closed. If I disconnect from WiFi and proceed to reopen the app while connected to cellular data. It appears that the app isn’t recognizing fully that I’m off the local network. Like it’s not totally flushing my previous session if that makes sense. I know this may sound weird and I’m not sure what’s causing it. I’m going to run a few tests and come back and post the log. 
 

So when I reconnect to the app on the cellular network and play a file, it transcodes. That’s great right? Not exactly. It transcodes, but still plays back at the full bit rate. I have my network limit to 5mbps, but the file transcodes and plays at the full bitrate. At least according to the iOS for Emby app. The dashboard simply only states “Transcoding” without any relevant information below it as it would normally have during a transcodes session. To resolve this issue, I found all that I have to do is as follows. 
 

When I change from WiFi to cellular data. The next time I open the app I need to click on sign out, then sign back in to get it to work properly. It transcodes the stream down to 5 mbps. It also displays this information properly in the dashboard.
 

I also noticed an anomaly in the server dashboard when my previous connection wasn’t flushed. My device will show up twice! One shows normally as “Emby for iOS 2.0.2” and the other session as “Emby%20for%20iOS 2.0.2”. 
 

I have noticed that if I sign out after I made the WiFi to cellular transition. When I reconnect to the app, this second session anomaly is no longer showing in the dashboard. At least not until I connect to the app via WiFi again and then try to watch something on cellular again without first logging out and back in. I have to rinse and repeat. I have been able to replicate this issue 100% of the time. I’m planning on rotating the log file here in a moment and posting it after running this a few times. 
 

I believe this may have at least partially been why Emby wasn’t fully respecting the max per stream network threshold. I do have my network netmask entered into the lab networks field “10.0.0.0/8” and this makes the file transcode, but as stated, until I fully log out and in, it still plays at the max bit rate. 
 

I’m hoping you were able to follow me here. I’m going to attach a picture showing what my dashboard displays when this happens. I’ll be back to attach the log after I rotate and run this a few times. 
 

I’m hoping with this information, you may be able to discover something that will help alleviate the issue. Thanks!!

I would like to also point out that I upgraded from stable to beta, however this same issue was present in the stable release as well. I actually upgraded in hopes that this may help fix the issue. 

BAE1D670-592E-4ACC-89EF-17CB892CBC5D.jpeg

Edited by Jcheinaman
Jcheinaman
Posted (edited)

 

As promised in my post directly above, I ran this a few times and I was able to replicate the issue. I included a few pictures from the app. I also included the log. I used my iPhone for these tests, but the app does the same thing when connected with my iPad. Being that this appears to be linked to the app, I'm not sure if the server logs will necessarily help here or not. Call me crazy, but something is definitely out of sorts here. Please let me know if you find anything. Thanks!

 

Direct play from my local network. Proper playback as expected:

EB896586-D647-46CF-BEA7-9346903395E0.thumb.png.f10678085b609b47ab3909ba1845b810.png

transcoding, but @ max bitrate on cellular data. I have my network stream limit set to 5mbps. This is when the server dashboard simply states "Transcoding" and has no transcode reason or stats displayed below it. If I was previously connected to the app via a local wifi connection and I don't first manually log out and back into the server, this is the result below. It's almost like the server gets confused? It transcodes, but doesn't limit the bitrate over the remote connection. Stats for nerds doesn't even show the transcode progress. It's almost like it's just saying that the file is transcoding for some reason, but not actually transcoding and simply playing directly:

B3CDACDC-4945-440E-A3C4-031325F5223A.thumb.png.c16cfb09c271cf9e309abb3b8e97292d.png

Transcoding on cellular data properly after I log out and back into the server via the iOS app:
3BB33D3D-7581-4954-A708-56211BF9B22F.thumb.png.59ce5bca01675901c017258b21ad5daa.png
 

embyserver.txt

Edited by Jcheinaman

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