Jump to content

How to limit transcoding?


cochize1
 Share

Recommended Posts

cochize1

Hi, let me start by saying that I have a very limited knowledge of transcoding, picture quality, containers, bitrates and so on but I would like to ask about some general ground rules to limit transcoding on most devices. 

 

My Emby 4.3 server is on Synology DS218+ with enabled VAAPI and unchecked on the fly captioning (rest of my settings in pictures attached).

 

I have done some testings on one of my users accounts using mobile data on the phone and wifi on other computer (with Chrome browser if that is relevant). Most of my movies/series are simple 1-2 GB sice with 1080p or 720p in mp4/mkv and aac/mp3 format.

 

What I have noticed is that when the user has the quality set to automatic my server is transcoding the video to 480p - 420 kbps (sometimes 720p - 1,5 Mbps) but whenever I change it on the player setting to maximum (1080p - 60 Mbps) the transcoding is gone and it switches to direct play (which is basically what I want all the time). Most of the cases reason for transcoding is "media bitrate exceeds limit".

 

As I said, my knowledge is very limited on that matter but since the user can simply change the quality and this has an effect on the transoding issue, are there any general settings that would help limit transcofing to maximum?

 

5de4e630799ed_1.jpg

5de4e640ae0d2_2.jpg

5de4e650bd0fe_3.jpg

Link to comment
Share on other sites

Hi, well if you really want to prevent transcoding, you can restrict access to that in user permissions. Just be aware that this may cause playback failures if it turns out that transcoding is actually needed to successfully play something.

Link to comment
Share on other sites

cochize1

I don't want to restrict transcoding as such so my users could have problems with playback BUT I want to avoid it when it is not neccessary. And when a simple change (from users point of view) from let's say automatic quality to 20 mbps change the need for transcoding at all (hence the container, audio etc. are ok) there must be some easy way set default settings to limit transcoding in most cases. The "media bitrate exceeds limit" is the most common reason for transcoding in my case. So, is there any configuration of settings like that?

Link to comment
Share on other sites

cochize1

Yes, all users are remote accessing my server via mydomain.com

From what I see most of them use Chrome or Firefox on windows and their android phones (some use safari iPhones and PS4)

Edited by cochize1
Link to comment
Share on other sites

rbjtech

Hi - it's likely the remote users do not have the download bandwidth to successfully direct play the file,  it may be a low performance wi-fi issue or 3/4G mobile data issue their end.  It may also be an upload issue on your end especially if you have a low upload limit, but for a 1-2 Gb file (assuming 1-2hrs video) then that should really not be an issue.  Do you have multiple remote users at once ?

 

The best way to diagnose it, is work with one of your remote users and slowly work up the bitrates until you hit an issue and identify with speedtests where the bottleneck is, is it their end, or yours.

 

There are some good options now in Emby to limit bandwidth per user/limit streams etc - but at the end of the day, you need to put in a little work to tweek how best to utilise your bandwidth availability if you want to direct stream as much as possible.  As a last resort - You may need SD versions of the files if bandwidth (up or down) really is an issue.

Link to comment
Share on other sites

cochize1

I am positive most of my users use fairly good wifi connection at home (def +10Mb per user) or LTE mobile data. Also my fiber internet is 300Mb download and 20Mb upload so with max 5 simultaneously connections from my users under such conditions there should be no bottleneck whatsoever.

 

What I assume at the moment is that default emby setting of “automatic” quality playback can limit the bitrate below it’s actual capacity. My question, is there a setting where I can allow ALL of my users at once use, say 20-30 Mbps, no matter if they use wifi or mobile data? Since none of my videos has a bitrate bigger than that, it should resolve most of the “media bitrate exceeds limit” problem, am I correct?

 

Is that the right option per user:

5de650ee6de19_dd.jpg

 

so when I set the value to 20 does it means it will be set to 20 for this particular user no matter what device he uses OR it is still automatic but just won't exceed 20 Mbps even if that would be possible?

Edited by cochize1
Link to comment
Share on other sites

so when I set the value to 20 does it means it will be set to 20 for this particular user no matter what device he uses OR it is still automatic but just won't exceed 20 Mbps even if that would be possible?

 

It would be a limit of 20 but, based on this:

 

Also my fiber internet is 300Mb download and 20Mb upload so with max 5 simultaneously connections from my users ...

 

Your download speed is irrelevant to this scenario because you are delivering content UP to your users.  So, based on the above, sounds like you should fill in 3 or 4 max for that value (5 x 4 = 20 which is your theoretical maximum and probably over reality).

Link to comment
Share on other sites

rbjtech

I would base the max limit on the typical media you are using.  Look in stats for nerds at your media - there you will see a video bitrate, add audio and add 500Kbps (overhead) - this becomes your typical 'non-transcoded bitrate' and this is what you should set to be the 'per-stream' setting.  The idea being they will 'direct stream'.

 

Divide this into your upload bandwidth and give yourself some headroom for your own usage ;) then set the max streams at this number.

 

So lets say your average media is 4.5Mbit/sec  - set your max stream to 5 Mbit - and set your max streams to 3.  ie 3 x 5 = 15 Mbit/sec leaving 5 for you in a worst case scenario.

 

For media using a HIGHER bitrate than 4.5Mbit/sec, then it will of course transcode - so it really is a balance - remembering that utilising your upload is free but a transcode will cost you.. 

 

The option I went down when I had a low upload, was to encode a low bitrate copy (utilising the multi-version feature of emby) kept below the above threshold to ensure no transcoding.

 

Native h265 is going to help massively with this 'balance' - because the upload limit can be reduced, but quality can remain..

Link to comment
Share on other sites

cochize1

Thanks for all the tips. But what do you mean by "set to be the 'per-stream' setting"? Is that the 'quality' setting under the cog in playback? And if so, how can I set it lets say to 5 Mbit per user to all users (as by default it is automatic I guess). Or is there any other emby setting I should look into?

Link to comment
Share on other sites

rbjtech

Thanks for all the tips. But what do you mean by "set to be the 'per-stream' setting"? Is that the 'quality' setting under the cog in playback? And if so, how can I set it lets say to 5 Mbit per user to all users (as by default it is automatic I guess). Or is there any other emby setting I should look into?

 

For Global Settings -

 

Network > Internet Streaming Bitrate.  This is where you set it to 5.

Network > Max streams = TOTAL maximum streams.  This is where you would set it to 3.

 

For User Settings -

 

Users > Profile > Internet Streaming Bitrate (note this will overwrite the Global setting, so for yourself or your favourite users, set it higher  ;) )

Users > Profile > Max streams for that user - I set mine to 1 to restrict streaming from a single device from that user at a time.

 

I hope this helps.

Link to comment
Share on other sites

cochize1

But isn't that "Network > Internet Streaming Bitrate.  This is where you set it to 5." will simply limit the max bitrate for all users while playing the video but still will stay as default automaticin settings?

 

Will of course try that but I don't think that the internet connection on my side is the problem since warning "media bitrate exceeds limit" happens even when there is only one active user.

 

Thanks anyways:)

Link to comment
Share on other sites

rbjtech

 

Will of course try that but I don't think that the internet connection on my side is the problem since warning "media bitrate exceeds limit" happens even when there is only one active user.

 

 

The number of users is not the issue here - it's the bitrate of the video vs your upload internet bandwidth that I believe is the issue.

 

I have just tested this to satisfy my own doubts  ;)

 

- My user limit is 15 Mbit

- I play a 5Mbit video, on the Android client over 4G, set to Auto - as expected, it plays Direct Play.

- I force the Android client to 2Mbit - as expected it now Transcodes (to 2 Mbit/sec, as the client requested) - the Client has the bitrate control.

- If I put the Android Client back to Auto, and now change the 'per user' stream limit to 2 Mbit, again it transcodes - this time the Server has the bitrate control.

- Put them back as they were, it Direct Plays again.

  • Like 1
Link to comment
Share on other sites

The automatic quality setting will generally be on the conservative side. If auto is picking a low value you can always raise it in the app settings.

Link to comment
Share on other sites

cochize1

Yes, but is there a way to set a default value, i.e. 3 mbps as minimum that would be sufficient for most of my users. Since auto is picking the lower value then it is why I (as a 'host') get hit by transcoding even though my users' internet capacity is bigger. I'd rather have them decrease the value in app settings (forcing transcoding) if for some reason they have a problem with playback.

Link to comment
Share on other sites

cochize1

So I harrased 2 of my users while they were streaming from my server and did some testing. One was using XBox Emby client and one was using Chrome in Android phone. I asked both to set up quality to 1080p - 10 Mbps and it went from transcoding to direct play right away without any drawback on the quality or buffering on their end.

 

It bugs me that there is a simple solution to limit transcoding and stress on my server but it can only be done manually by the user and not by me. Therefore I must ask every of my users to change their settings on every device they use AND since the quality settings are stored in cached memory ask them to redo that whenever they clear their history browser for example. 

 

I understand that there may not be a simple solution to that but I would like to have some control. And switching the transoding off is not an option because sometimes it is needed, i.e. to play mkv files over Android devices (if I am correct). 

 

So, asking each user to change the quality on their side in every device they use is the only solution to limit transcoding right now? I cannot set it remotly logging to their accounts, right?

Edited by cochize1
Link to comment
Share on other sites

cochize1

Don't get me wrong, I am full of admiration for all the work you do Luke and hopefully this will also be resolved among other issues and requests but please tell me this, for now, asking users to change the quality settings on their side is the best option to avoid "media bitrate exceeds limit" reason for transcoding, right? If so, I will do that (and maybe this will be a temporary solution for other emby users out there).

 

EDIT: It just bugs me a little. One of my users just today watched something on Xbox, Ipad and Chrome and I had to ask him 3 times to change the quality settings... and it worked every single time.

Edited by cochize1
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
 Share

×
×
  • Create New...