Jump to content

Optimal Transcoding Settings For Peak Internet Congestion


darrenkdean

Recommended Posts

darrenkdean

Good Afternoon,

  • Emby Server is hosted on a dedicated Ubuntu machine with 5x 1 Gbps bonded connections to the switch (overkill for our needs, but nonetheless)
  • 1 Gbps Fiber Internet Connection
  • Locally Hosted & Local Area Network Media Storage

Most hours of the day, when I remotely connect to Emby, it direct streams the content.  However, between the hours of 5 PM - 8 PM Eastern Time (Peak Internet Congestion), the remote streams begin transcoding.  Running trace routes reveals that there is congestion/oversubscription in some of the hops between the server & clients (little I can do about this).

 

During peak congestion, changing the playback stream from Auto to 1.5 Mbps or 3.0 Mbps typically leads to smooth playback.  That being said, I'm now looking to optimize the Transcoding Settings, to cater to this dynamic.  Direct Stream (non peak hours) & Transcoding 1.5 - 3.0 Mbps (peak hours).  Any suggestions on the best Transcoding Settings for this dynamic (1.5 Mbps - 3.0 Mbps)?  ​I'm looking for the best picture quality at that stream rate.  This is a dedicated Emby Server with plenty of horse power & rarely more than 5-8 streams at one time.  Current settings & specs are below.  Thoughts?

 

Current Transcoding Settings

Hardware Acceleration: ​VA API (Experimental)

Hardware Encoding:​ Enabled

Transcoding Thread Count: ​Auto

Enable Throttling: Disabled

H264 Encoding Preset: Very Slow

H264 Encoding CRF: 18

Deinterlacing Method: Bob & Weave

 

 

 

Operating system

Ubuntu Linux 17.10

Time on system

Friday, December 1, 2017 12:59 PM

Kernel and CPU

Linux 4.13.0-16-generic on x86_64

Processor information

Intel® Core i7-6700K CPU @ 4.00GHz, 8 cores

CPU load averages

1.44 (1 min) 0.72 (5 mins) 0.38 (15 mins)

Real memory

15.19 GB total / 9.20 GB used

Virtual memory

15.51 GB total / 140.87 MB used

Edited by darrenkdean
Link to comment
Share on other sites

pir8radio

I cant imagine its a network bottleneck if you have gigabit internet, busy times or not, what kind of ISP?  So to be clear, when your server is setup to direct stream (no real transcoding) it pays fine with 8 streams, but peak internet times you see skipping?     What kind of traceroutes are you seeing?   What kind of video bitrates?

Edited by pir8radio
Link to comment
Share on other sites

SkyBehind

Are you playing on the same players during peak times (times when transcoding) as off-peak hours?  I have a similar setup with an i7-3770 and gigabit internet and don't have any issues.  One of the major differences I see is that I have throttling enabled.  Throttling should only have an effect when streams are transcoding though, not whether they're transcoded or not, so I don't really see an issue there.

 

The only thing I could think about is that maybe if all the streaming requests hit the server at once, and it's not able to throttle the transcoding, it transcodes at a lower bitrate due to it not being able to handle the workload all at the same time.  Again though, this really doesn't explain why it's transcoding at all, unless maybe previously it's actually direct streaming and not direct playing?

Link to comment
Share on other sites

darrenkdean

I cant imagine its a network bottleneck if you have gigabit internet, busy times or not, what kind of ISP? So to be clear, when your server is setup to direct stream (no real transcoding) it pays fine with 8 streams, but peak internet times you see skipping? What kind of traceroutes are you seeing? What kind of video bitrates?

Correct, it's not a local area network or server resource bottleneck, but rather ISP congestion. We have AT&T Fiber here in Atlanta. During peak hours, latency can spike as high as 400ms at the node where AT&T hands off to Cox Networks. I have contacted AT&T to look into this but no telling how long it will take them to address it, if they even will.

 

During peak hours, I can direct stream fine remotely in the Atlanta area. If I however, attempt to stream from Pensacola Beach, FL (for example) during peak hours, Auto (speed) Playback will have playback that periodically freezes. Max stable speed when this happens is 1.5 - 3.0 Mbps.

 

The challenge being, if there are 30 hops between the server & end client due to distance, there will inevitably be latency beyond your control in some of the hops.

 

Is anyone else running into this?

 

Sent from my KFGIWI using Tapatalk

Link to comment
Share on other sites

darrenkdean

Are you playing on the same players during peak times (times when transcoding) as off-peak hours? I have a similar setup with an i7-3770 and gigabit internet and don't have any issues. One of the major differences I see is that I have throttling enabled. Throttling should only have an effect when streams are transcoding though, not whether they're transcoded or not, so I don't really see an issue there.

 

The only thing I could think about is that maybe if all the streaming requests hit the server at once, and it's not able to throttle the transcoding, it transcodes at a lower bitrate due to it not being able to handle the workload all at the same time. Again though, this really doesn't explain why it's transcoding at all, unless maybe previously it's actually direct streaming and not direct playing?

Good point. I just this week disabled throttling in order to test different configurations. Even under Max load, I've never seen the processor over 30%.

 

Remote clients are either Fire Sticks or Fire TV's.

 

I am fairly certain the root cause is latency in some of the ISP hops. The longer the distance from the server, the more likely it is to occur.

 

Hence, why I'm trying to optimize low bitrate transcoding settings, while I work with my ISP to address latency.

 

Sent from my KFGIWI using Tapatalk

Link to comment
Share on other sites

SkyBehind

One thing I've found is there's a much higher likelyhood of transcoding if clients are on wifi.

 

Sent from my Nexus 6 using Tapatalk

Link to comment
Share on other sites

pir8radio

Correct, it's not a local area network or server resource bottleneck, but rather ISP congestion. We have AT&T Fiber here in Atlanta. During peak hours, latency can spike as high as 400ms at the node where AT&T hands off to Cox Networks. I have contacted AT&T to look into this but no telling how long it will take them to address it, if they even will.

 

During peak hours, I can direct stream fine remotely in the Atlanta area. If I however, attempt to stream from Pensacola Beach, FL (for example) during peak hours, Auto (speed) Playback will have playback that periodically freezes. Max stable speed when this happens is 1.5 - 3.0 Mbps.

 

The challenge being, if there are 30 hops between the server & end client due to distance, there will inevitably be latency beyond your control in some of the hops.

 

Is anyone else running into this?

 

Sent from my KFGIWI using Tapatalk

 

Well, not much you can do with that, if your gigabit connection maxes out at 1.5 - 3 Mbps at times.....   that would barely support one stream ..  I don't believe Emby has a dynamic auto bitrate setting at this time.   If it did it probably wouldn't do you much good anyway..   If you had 3 streams running and it auto'ed them down to fit within 1.5 mbps each stream would be down to very low bitrate streams which wouldn't be watchable.    Try using cloudflare (cloudflare.com), your stream could ride on their network, assuming your server is near one of their edge servers.  Most people only have 1-3 hops to my server (globally) once they leave their ISP.  I have pretty low global latency 24-7 using cloudlfare, see below.  Just make sure you search on here for cloudflare to set it up correctly, you also need a domain name to do it correctly. 

You can tracert to my server if you like I'll PM you my domain name. 

 

5a2409dc77a32_Capture.png

Edited by pir8radio
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...