Jump to content

Use Cloudflare to cache /Playback/BitrateTest?Size=


Jdiesel

Recommended Posts

Jdiesel

The Auto quality setting has been wreaking havoc on my CPU cores and my sanity. I'm looking for a way to "trick" the Emby bitrate testing into using something other than 1Mbps when polling my remote server. The network the server is on is capable of saturating the download speeds of all the connected clients. I was thinking that using something like Cloudflare to cache the results to the BitrateTest query on their CDN may resulting in getting more appropriate results from the Auto setting. Any thoughts on Cloudflare rules that would allow me to accomplish this? 

Link to comment
Share on other sites

  • 1 year later...

This isn't something you'd want to cache as the results are expected to vary with each run. But most apps are using device API's now instead of this to get bandwidth estsimates.

Link to comment
Share on other sites

  • 2 years later...
enqbcvqw

Reviving this for a bit. Is there a way to override the current behavior and force apps to re-use the bandwidth test (from a server side setting?).

I'm trying to force as much direct play as possible and even with video transcoding off and video and audio codecs supported by the device the transcoding occurs due to most clients using Auto as their remote setting. My idea was to try and force auto quality to direct play based on returning a 0 byte response to the bandwidth test using a cloudflare worker but that's clearly not going to work if apps don't use that anymore.

Any alternatives? I think at the very least we should have a mechanism to override user playback settings and set them to maximum server side.

Thanks for fixing this by the way:

Caching works perfectly now :) 

EDIT: So two observations...

1. Looks like there might be a bug on the Android app as I consistently only see 7 Mbps MaxBitrate when the device is set to Auto. There isn't even a 7 Mbps option in the UI so it's unclear why the app is choosing this as the quality.

$ grep 'max bitrate' /opt/emby/logs/embyserver.txt | awk '{print $NF}' | sort | uniq -c | sort -nr
   1080 7000000

2. Looks like a workaround to #1 to force max quality is to rewrite the MaxStreamingBitrate query parameter sent by the app when it's present in requests although I need to test this a bit further.

 

Edited by enqbcvqw
  • Like 1
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...