Jump to content

Question about bitrates


bozrdnag

Recommended Posts

bozrdnag

I've noticed this problem.  I have my Roklu client set to 5Mbps max bitrate and my server is set to allows clients a max of 10 (for testing).  I started playing the Blu-Rayu Goodfellas and it took 13 minutes to climb to 2.2Mbps and then it immediately jumped to 5 and stayed there.  My interenet speed is 400/20 and I tested it multiple times before playing the video to make sure I was getting the pseed I should.  My server is local but I have my Roku set to go out over the internet to reach the server to most closely approximate what my friends and family experience.  I tried the Emby web app on my laptop over wifi and it took maybe 20-25 seconds to reach max bitrate.

 

Also all the Rokus I've tried that have the bitrate set to Auto never seem to exceed 2Mbps even when the bandwidth allows for much higher.

 

I have attached my logs but there seems to be 2 transcode files for the Goodfellas streaming on Roku even though it was uninterrupted.

embyserver.txt

ffmpeg-transcode-1e25533a-ec63-4967-8397-ddb0e8b9dc20_1.txt

ffmpeg-transcode-ca4193b5-6882-4c20-b7a3-046b668742cb_1.txt

Link to comment
Share on other sites

 

 

it took 13 minutes to climb to 2.2Mbps and then it immediately jumped to 5 and stayed there. 

 

Hi there, how are you determining this?

Link to comment
Share on other sites

bozrdnag

by looking at both Stats for Nerds on the client and looking at the stream info in the Manage Server dashboard.

Edited by bozrdnag
Link to comment
Share on other sites

That's just what the transcoder is producing. The source file most likely does not have a constant bitrate. In the same way that the source file bitrate goes up and down throughout, so too will the transcoded output.

Link to comment
Share on other sites

bozrdnag

I'm not saying you're wrong, but it always a slow, steady increase.  It doesn't jump around.  Then when transcoding reaches 100% it jumps to the max bit rate.  I just noticed this while trying to troubleshoot why family streaming from me seems to look worse than it used to.

 

One other question - let's say the max bit rate is set to 2 Mbs and it running at max.  Wouldn't that mean that my WAN upload throughput should be ~2 Mbps assuming no other activity?

Link to comment
Share on other sites

bozrdnag

I stand corrected.  I does seem to be videos that are resumed.  I could have sworn I saw on fresh starts but I can;t reproduce ti now after trying many times.  It still doesn't read max bitrate until transcoding is finished, but I never see Kbps like with resumed videos.  I'm not noticing any video issues testing here at home but I found this trying to troubleshoot why video looked poor at a couple family members' house.  I was only testing so I never let a video play more than 5-10 minutes but it just looked like very low bitrate quality.  So when I saw this anamoly I figured that was the issue.

 

So what bitrate setting do you advise i set them at for the best internet streaming quality in my situation.  I have 20 Mbps upload speed.  I have 5 total users with a max of 3 streaming concurrently (but that is rare.  Usually only 1 or 2),  Four have 100Mbps download and one has 20 Mbps download speed.

Link to comment
Share on other sites

Emby doesn't use adaptive streaming, which would mean automatic bitrate adjustments during streaming, that's why I could be very sure that you weren't actually experiencing varying bitrates.

 

Generally you should be OK with the 'auto' setting in clients. Only make custom settings in the moment when you're experiencing problems. 

Instead, configure the "Internet streaming bitrate limit" at the server side. (either per-user or globally under Network settings).

Link to comment
Share on other sites

bozrdnag

That's what I have been doing but I noticed auto showing relatively low bitrates on the clients under the quality setting.  I would see something like (Auto - 2.26 Mbps) when they have 100 Mbps download and I have the global max set at 5.  

 

I just tried it and auto showed Auto - 2.26 Mbps on the client from the get go and has stayed there.  Once transcoding finished my server reads 2.3Mbps.  Manually increasing it to 5 yields a noticeably better picture and it plays without issue.  I doesn't seem like auto is allowing for optimal picture quality.  I also thought I read somewhere on these forums others saying Auto never allows much more than 2.

Edited by bozrdnag
Link to comment
Share on other sites

That's what I have been doing but I noticed auto showing relatively low bitrates on the clients under the quality setting.  I would see something like (Auto - 2.26 Mbps) when they have 100 Mbps download and I have the global max set at 5.  

 

It's great when clients have a decent downstream, but that's irrelevant when the server's upstream is way below that.

 

For the auto setting behavior, you need to consider the following details:

  • Most clients are measuring bandwidth with the 'auto' setting before a user starts playback

    Obviously, it's only a point-in-time assessment and network conditions can change, but we want to find a value that (hopefully) will allow constant payback without intermediate stopping and stuttering. That means that there's quite a factor by which the measured bandwidth will be reduced.

    .

    what you're experiencing might be rather another issue, though:

    .

  • The H.264 software encoder often does not encode video at the bitrate we're setting (while many hw encoders do).

    What you can try is to increase the encoding  quality by lowering the "H264 encoding CRF" on the transcoding settings page.

 

We're currently reworking these things for the next version to provide more consistent results.

Link to comment
Share on other sites

bozrdnag

I understand about upstream.  I mentioned earlier that I have 20 Mbps upload speeds so I only mentioned the download in my example to show that it wasn't the limiting factor.  I tried increasing that setting a couple different times with no noticeable difference.  It really seems that Auto just selects too low of a bitrate.  I tried other videos and I got 750 Kbps, 1.62 Mbps and 1.58 Mbps.  This with no other activity going on.  My router is showing essentially no data going out and speed tests are showing 22-24 Mbps upload and 440 Mbps download.  I get that any brief moment in time it could measure low bandwidth but it does this constantly.  2.26 is the highest I have seen.  How congested would things have to be to justify 750 Kbps with a 440/22 pipe?

 

So with Emby's Auto choosing those bitrates it is just robbing me of picture quality when there is the bandwidth to handle much more.  I understand it's a balancing act to keep a stable stream and Emby is just end user software and won't be anywhere near perfect but this seriously degrades picture quality when there should be plenty of headroom available. 

Link to comment
Share on other sites

Happy2Play

What is the server log showing?  But you have to take into account the remote connections path to your server also.

 

https://my.server.com:8920/emby/Items/449198/PlaybackInfo?UserId=eb629901695f4044b1cc3bed0f5a73f5&isplayback=true&maxstreamingbitrate=418574&starttimeticks=00000000. UserAgent: Roku/DVP-9.11 (AE9.11E04200A)
2019-12-05 18:24:06.097 Info HttpServer: HTTP GET https://my.server.com:8920/emby/Items/318335/Images/Thumb/0?EnableImageEnhancers=true&tag=949ffb2e75680c5e53c95a207c362440&maxwidth=490&quality=80. UserAgent: Roku/DVP-9.11 (AE9.11E04200A)
2019-12-05 18:24:06.190 Info App: User policy for Media. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
2019-12-05 18:24:06.206 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 1583881, max bitrate: 418574
2019-12-05 18:24:06.206 Info App: Bitrate exceeds DirectStream limit: media bitrate: 1583881, max bitrate: 418574
2019-12-05 18:24:06.206 Info App: RemoteClientBitrateLimit: 2000000, RemoteIp: xxx.xxx.xxx.xxx, IsInLocalNetwork: False

2019-12-05 18:24:07.095 Info HttpServer: HTTP GET h,ttps://my.server.com:8920/emby/videos/449198/master.m3u8?DeviceId=10505848-5bd0-5fb8-abb8-6e2464acfc3e&MediaSourceId=df1c8b702d8a4a44884b768a7a5a2a63&PlaySessionId=f8c97871a82344f28f08bd542b07f67e&VideoCodec=h264,mpeg1video,mpeg2video&AudioCodec=ac3,aac,mp2,mp3,eac3,flac,opus,vorbis,lpcm&VideoBitrate=290574&AudioBitrate=128000&MaxFramerate=60&MaxWidth=3840&MaxHeight=2160&AudioStreamIndex=1&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&SegmentContainer=ts&SegmentLength=3&MinSegments=1&BreakOnNonKeyFrames=True&h264-maxrefframes=16&h264-videobitdepth=8&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&aac-audiochannels=6&eac3-audiochannels=6&ac3-audiochannels=6&flac-audiochannels=6&lpcm-audiochannels=6&mp3-audiochannels=2&mp2-audiochannels=2&vorbis-audiochannels=6&opus-audiochannels=6&TranscodeReasons=ContainerBitrateExceedsLimit

 

I have not done any testing, just observations from logs.  But this doesn't look quite right either. Okay it does as that equal the max bitrate above. 

&VideoBitrate=290574&AudioBitrate=128000
So the question is why is such a low max bitrate being returned from the client? Edited by Happy2Play
Link to comment
Share on other sites

I understand about upstream.  I mentioned earlier that I have 20 Mbps upload speeds so I only mentioned the download in my example to show that it wasn't the limiting factor.  I tried increasing that setting a couple different times with no noticeable difference.  It really seems that Auto just selects too low of a bitrate.  I tried other videos and I got 750 Kbps, 1.62 Mbps and 1.58 Mbps.  This with no other activity going on.  My router is showing essentially no data going out and speed tests are showing 22-24 Mbps upload and 440 Mbps download.  I get that any brief moment in time it could measure low bandwidth but it does this constantly.  2.26 is the highest I have seen.  How congested would things have to be to justify 750 Kbps with a 440/22 pipe?

 

So with Emby's Auto choosing those bitrates it is just robbing me of picture quality when there is the bandwidth to handle much more.  I understand it's a balancing act to keep a stable stream and Emby is just end user software and won't be anywhere near perfect but this seriously degrades picture quality when there should be plenty of headroom available. 

 

Yes, I agree with you. That's why I had written "what you're experiencing might be rather another issue, though" 

Please read what I had written below that line.

 

Also, have you tried increasing the 5 Mbit server limit - e.g to 10 ?

Link to comment
Share on other sites

bozrdnag

What is the server log showing?  But you have to take into account the remote connections path to your server also.

 

https://my.server.com:8920/emby/Items/449198/PlaybackInfo?UserId=eb629901695f4044b1cc3bed0f5a73f5&isplayback=true&maxstreamingbitrate=418574&starttimeticks=00000000. UserAgent: Roku/DVP-9.11 (AE9.11E04200A)
2019-12-05 18:24:06.097 Info HttpServer: HTTP GET https://my.server.com:8920/emby/Items/318335/Images/Thumb/0?EnableImageEnhancers=true&tag=949ffb2e75680c5e53c95a207c362440&maxwidth=490&quality=80. UserAgent: Roku/DVP-9.11 (AE9.11E04200A)
2019-12-05 18:24:06.190 Info App: User policy for Media. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
2019-12-05 18:24:06.206 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 1583881, max bitrate: 418574
2019-12-05 18:24:06.206 Info App: Bitrate exceeds DirectStream limit: media bitrate: 1583881, max bitrate: 418574
2019-12-05 18:24:06.206 Info App: RemoteClientBitrateLimit: 2000000, RemoteIp: xxx.xxx.xxx.xxx, IsInLocalNetwork: False
 

I have not done any testing, just observations from logs.  But this doesn't look quite right either. Okay it does as that equal the max bitrate above. 

&VideoBitrate=290574&AudioBitrate=128000
So the question is why is such a low max bitrate being returned from the client?

 

 

I have no idea but Auto seems to be very limited.

Link to comment
Share on other sites

bozrdnag

Yes, I agree with you. That's why I had written "what you're experiencing might be rather another issue, though" 

Please read what I had written below that line.

 

Also, have you tried increasing the 5 Mbit server limit - e.g to 10 ?

 

I'm sorry I wasn't more clear but I caught what you said and I replied to it with my comment:

 

"I tried increasing that setting a couple different times with no noticeable difference."

 

I have also tried increasing the Max to 10 and I still get the same results when set to auto.  

Link to comment
Share on other sites

bozrdnag

I think I am understanding all of that.  Right now I have the server max (Internet streaming bitrate limit)  set to 10 Mbps and I even set each user to 10  on the server (usually set to 5 on both).  All client apps are set to Auto and the max it ever shows is around 2.  Am I missing another setting somewhere?

 

I should note that the Web GUI on my Windows laptop shows Auto 1080p - 6Mbs every time I try with the same settings.  Still lower that I would expect but nowhere near as low as the Roku.  Both are using the same Wifi connection so that shouldn't be the issue.

Edited by bozrdnag
Link to comment
Share on other sites

Yes, again those server values are only upper limits. The auto quality settings in the apps will generally be on the conservative side when you are outside your home network. You can always use the in-app settings to increase it if desired.

Link to comment
Share on other sites

@@bozrdnag - If you post some ffmpeg logs of different situations, we could tell what max bandwidths the clients are requesting and what the encoder finally makes out of it.

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