Jump to content

Emby buffers on 4k files


kapkan
 Share

Recommended Posts

kapkan

Hi all, my setup is as follows:

Router: AC 1200

Emby server: Windows 10 (i5 8gb) connected to router via 5 GHz Wi-Fi

Client: Emby next-gen on Vero 4k+ connected via 5 GHz Wi-Fi (connected to lg soundbar via hdmi-in which is connected to LG CX via e-arc hdmi)

I have mostly stable playback, but sometimes there's the annoying buffering/stuttering for high bit rate files (> 30 Mbps with peaks reaching ~100 Mbps). When I look at the send (upload speeds) on my windows machine I see the speed drops to <20 Mbps (even 10 at times). Is this likely because of interference (there are around 2-3  APs (5 GHz) surrounding me in close by channels (40-80 MHz)?

I tried wiring the server/client to the router (router ports capped at 100 Mbps), this is more stable than Wi-Fi mostly, however there's still buffering on high bitrate files (for example on Psycho 4k remux with peaks exceeding 100 Mbps). Can I be sure that Wi-Fi/router is the problem? And would switching to gigabit router (and wiring both client/server) completely solve my problem? I'm attaching a few recent logs for reference.

Thanks in advance for any input!

embyserver-63783503998.txt embyserver.txt ffmpeg-transcode-c5ea727b-d855-48c5-8134-28cd1f5534ba_1.txt

Edited by softworkz
Changed title
Link to comment
Share on other sites

Hello kapkan,

** This is an auto reply **

Please wait for someone from staff support or our members to reply to you.

It's recommended to provide more info, as it explain in this thread:

Thank you.

Emby Team

Link to comment
Share on other sites

Happy2Play

Best guess is the bitrate doubling that happens when changing hevc to h264. (46Mbps to 92Mbps)

-c:v:0 libx264 -g:v:0 72 -maxrate:v:0 93130544 -bufsize:v:0 186261088

21:49:05.860   Duration: 01:49:04.54, start: 0.000000, bitrate: 46565 kb/s
21:49:05.860     Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2076 [SAR 1:1 DAR 320:173], Level 153, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc 


21:49:06.016   Metadata:
21:49:06.016     encoder         : Lavf58.35.100
21:49:06.016     Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1038 [SAR 1:1 DAR 320:173], q=-1--1, 23.98 fps, 90k tbn, 23.98 tbc (default)
21:49:06.016     Metadata:
21:49:06.016       encoder         : Lavc58.62.100 libx264
21:49:06.016     Side data:
21:49:06.016       cpb: bitrate max/min/avg: 93130000/0/0 buffer size: 186261000 vbv_delay: N/A

If you set client playback to a specific playback quality of a lower set bitrate do you get the same results?

But gigabit connection may help here.

Link to comment
Share on other sites

GrimReaper
5 minutes ago, Happy2Play said:

Best guess is the bitrate doubling that happens when changing hevc to h264. (46Mbps to 92Mbps)

-c:v:0 libx264 -g:v:0 72 -maxrate:v:0 93130544 -bufsize:v:0 186261088

21:49:05.860   Duration: 01:49:04.54, start: 0.000000, bitrate: 46565 kb/s
21:49:05.860     Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2076 [SAR 1:1 DAR 320:173], Level 153, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc 


21:49:06.016   Metadata:
21:49:06.016     encoder         : Lavf58.35.100
21:49:06.016     Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1038 [SAR 1:1 DAR 320:173], q=-1--1, 23.98 fps, 90k tbn, 23.98 tbc (default)
21:49:06.016     Metadata:
21:49:06.016       encoder         : Lavc58.62.100 libx264
21:49:06.016     Side data:
21:49:06.016       cpb: bitrate max/min/avg: 93130000/0/0 buffer size: 186261000 vbv_delay: N/A

If you set client playback to a specific playback quality of a lower set bitrate do you get the same results?

But gigabit connection may help here.

Or CPU being underpowered as no HA, few secs in speed is below 1 (fps low 20s):

21:49:12.340 frame=  167 fps= 26 q=28.0 size=    1024kB time=00:00:07.16 bitrate=1358.4kbits/s throttle=off speed=0.957x    
21:49:12.980 frame=  178 fps= 25 q=28.0 size=    1280kB time=00:00:07.70 bitrate=1560.5kbits/s throttle=off speed=0.959x    
21:49:13.402 frame=  186 fps= 25 q=28.0 size=    1280kB time=00:00:07.96 bitrate=1503.3kbits/s throttle=off speed=0.928x    
21:49:13.964 frame=  196 fps= 24 q=28.0 size=    1536kB time=00:00:08.37 bitrate=1702.2kbits/s throttle=off speed=0.913x    
21:49:14.590 frame=  208 fps= 24 q=28.0 size=    1792kB time=00:00:08.89 bitrate=1857.3kbits/s throttle=off speed=0.907x    
21:49:15.090 frame=  218 fps= 24 q=28.0 size=    1792kB time=00:00:09.37 bitrate=1750.9kbits/s throttle=off speed=0.91x    
21:49:15.652 frame=  226 fps= 23 q=28.0 size=    2048kB time=00:00:09.72 bitrate=1920.5kbits/s throttle=off speed=0.897x    
21:49:16.136 frame=  234 fps= 23 q=28.0 size=    2304kB time=00:00:09.97 bitrate=2099.0kbits/s throttle=off speed=0.875x    
21:49:16.752 frame=  244 fps= 22 q=28.0 size=    2560kB time=00:00:10.36 bitrate=2236.8kbits/s throttle=off speed=0.863x    
21:49:17.284 frame=  255 fps= 22 q=28.0 size=    2816kB time=00:00:10.87 bitrate=2333.3kbits/s throttle=off speed=0.869x    
21:49:17.862 frame=  264 fps= 22 q=28.0 size=    2816kB time=00:00:11.25 bitrate=2245.9kbits/s throttle=off speed=0.862x    
21:49:18.440 frame=  274 fps= 22 q=28.0 size=    3072kB time=00:00:11.70 bitrate=2347.6kbits/s throttle=off speed=0.853x    
21:49:19.096 frame=  286 fps= 22 q=28.0 size=    3328kB time=00:00:12.25 bitrate=2420.4kbits/s throttle=off speed=0.857x    
21:49:19.549 frame=  296 fps= 22 q=28.0 size=    3584kB time=00:00:12.53 bitrate=2541.6kbits/s throttle=off speed=0.845x    
21:49:20.049 frame=  307 fps= 22 q=28.0 size=    3840kB time=00:00:13.08 bitrate=2600.6kbits/s throttle=off speed=0.853x    
21:49:20.575 frame=  316 fps= 21 q=28.0 size=    3840kB time=00:00:13.43 bitrate=2527.1kbits/s throttle=off speed=0.846x    
21:49:21.153 frame=  328 fps= 21 q=28.0 size=    4096kB time=00:00:13.97 bitrate=2582.9kbits/s throttle=off speed=0.851x    
21:49:21.716 frame=  339 fps= 21 q=28.0 size=    4352kB time=00:00:14.42 bitrate=2652.8kbits/s throttle=off speed=0.848x    
21:49:22.372 frame=  353 fps= 22 q=28.0 size=    4608kB time=00:00:15.00 bitrate=2693.3kbits/s throttle=off speed=0.854x    
21:49:22.872 frame=  364 fps= 21 q=28.0 size=    4608kB time=00:00:15.41 bitrate=2615.7kbits/s throttle=off speed=0.85x    
21:49:23.356 frame=  375 fps= 21 q=28.0 size=    4864kB time=00:00:15.86 bitrate=2677.8kbits/s throttle=off speed=0.851x    
21:49:23.907 frame=  388 fps= 22 q=28.0 size=    5120kB time=00:00:16.44 bitrate=2713.7kbits/s throttle=off speed=0.857x    
21:49:24.502 frame=  402 fps= 22 q=28.0 size=    5120kB time=00:00:17.01 bitrate=2616.2kbits/s throttle=off speed=0.861x    
21:49:25.049 frame=  416 fps= 22 q=28.0 size=    5376kB time=00:00:17.68 bitrate=2636.6kbits/s throttle=off speed=0.873x    
21:49:25.565 frame=  429 fps= 22 q=28.0 size=    5376kB time=00:00:18.26 bitrate=2548.7kbits/s throttle=off speed=0.88x    
21:49:26.065 frame=  442 fps= 22 q=28.0 size=    5632kB time=00:00:18.71 bitrate=2602.7kbits/s throttle=off speed=0.877x    
21:49:26.582 frame=  456 fps= 22 q=28.0 size=    5632kB time=00:00:19.25 bitrate=2525.1kbits/s throttle=off speed=0.882x    
21:49:27.129 frame=  471 fps= 22 q=28.0 size=    5888kB time=00:00:19.86 bitrate=2554.8kbits/s throttle=off speed=0.888x    
21:49:27.629 frame=  485 fps= 22 q=28.0 size=    5888kB time=00:00:20.60 bitrate=2458.9kbits/s throttle=off speed=0.901x    
21:49:28.269 frame=  502 fps= 23 q=28.0 size=    6144kB time=00:00:21.17 bitrate=2492.7kbits/s throttle=off speed=0.905x    
21:49:28.705 frame=  515 fps= 23 q=28.0 size=    6144kB time=00:00:21.68 bitrate=2431.1kbits/s throttle=off speed=0.907x    
21:49:29.205 frame=  533 fps= 23 q=28.0 size=    6144kB time=00:00:22.52 bitrate=2337.1kbits/s throttle=off speed=0.923x    

 

Link to comment
Share on other sites

kapkan

Thank you both for the comments!

@Happy2Play, I think you're right, the send speed I'm observing on my windows (task manager network performance) seems to be always double the bit rate. Why does it change hevc to h264 though? Vero 4k+ does support hevc. Anyway to keep it playing with hevc without changing?

And regarding the second point, can I even change the playback quality on direct play? I at least do not see anything in the kodi player on my client. Maybe I should check in the system settings. But in any case, wouldn't changing playback quality lead to transcoding defeating the purpose of direct play?

Link to comment
Share on other sites

6 minutes ago, kapkan said:

Thank you both for the comments!

@Happy2Play, I think you're right, the send speed I'm observing on my windows (task manager network performance) seems to be always double the bit rate. Why does it change hevc to h264 though? Vero 4k+ does support hevc. Anyway to keep it playing with hevc without changing?

TranscodeReasons=VideoCodecNotSupported

6 minutes ago, kapkan said:

And regarding the second point, can I even change the playback quality on direct play?

The log is not DirectPlay. 

And despite from what the parameters are - effectively the output was only 2Mbps and the reason why it didn't play smoothly is slow transcoding and not network related.

Please post a log from a situation where you are actually seeing such high bitrates on the network.

Edited by softworkz
  • Like 1
Link to comment
Share on other sites

Happy2Play
3 minutes ago, kapkan said:

Why does it change hevc to h264 though? Vero 4k+ does support hevc. Anyway to keep it playing with hevc without changing?

Client reports codec not supported.

&VideoCodec=h264&AudioCodec=ac3,aac,mp3

&TranscodeReasons=VideoCodecNotSupported

But is odd no client name listed in ffmpeg log.

App:  

 

5 minutes ago, kapkan said:

And regarding the second point, can I even change the playback quality on direct play?

But it is not Direct Playing it is transcoding do to unsupport codec.

  • Like 1
  • Agree 1
Link to comment
Share on other sites

kapkan
18 minutes ago, Happy2Play said:

But it is not Direct Playing it is transcoding do to unsupport codec.

That's weird! As you can see from the screenshot it is saying  DirectPlay  on the dashboard. Also, I can confirm that I'm getting DTS HD MA audio passed through to my soundbar (unlike the ac3 mentioned in the audio codec) I'm also attaching one more recent log, not sure how to make it create more ffmpeg logs, there are no recent ones from the current playback.

image.png

embyserver.txt

Edited by kapkan
Link to comment
Share on other sites

kapkan
Link to comment
Share on other sites

There were both, transcoded playback and DirectPlay (for which no ffmpeg log is created).

I can't tell exactly why. I don't know that client ap.

Is your e:\ drive on a network location?

Edited by softworkz
Link to comment
Share on other sites

kapkan
1 hour ago, Happy2Play said:

But is odd no client name listed in ffmpeg log.

 

@softworkz, Is it possible that the server is running two parallel playbacks one with no client where it transcodes, and the other the client I'm playing on with direct play. Maybe the parallel stream is creating the bottleneck?

Link to comment
Share on other sites

You mixed up things from two different clients here.

For one it's doing DirectPlay and for the other one it is transcoding. 
The CPU is too slow for transcoding. 

For the slow transcoding, you could use HW acceleration which requires:

  • Emby premiere
  • Updating your graphics drivers
    (you have a pretty old version)

For the bandwidth usage:

Most likely the client is reading more/faster than what it would need. The original file has 38 Mbps which should be playable without problems. When playback is stuttering, then it's something at the client side.

Link to comment
Share on other sites

kapkan

But I'm only playing from one client, I even tried limiting simultaneous video streams to 1. I'm still seeing double the bitrate. Do you think the client is the problem for sure, requesting 2 streams at once and doubling the upload bandwidth?

Link to comment
Share on other sites

1 minute ago, kapkan said:

two parallel playbacks one with no client

"No client" - I don't think so. There are two clients involved, one at .106  ("next gen..") and one at .107. (probably a TV?)

  • Like 1
Link to comment
Share on other sites

kapkan

I do have a TV that accesses the server (via DLNA) from time to time for dolby vision files, but never parallely (as the emby client is also connected to the same TV) (maybe the log is from when I tried switching to the TV), and TV does support hevc (LG CX), so no transcoding should be needed at least for the video.

Anyways, I just disabled DLNA, still see double bit rate (on upload speed) while playing only on the emby next-gen client (Vero 4k+) I'm quite confused, at my wit's end trying to solve this for the past few days 🥲

Link to comment
Share on other sites

Does it happen when you play from the start? (i.e. no resume)

When you start playback (from the start), then play a few seconds and pause (not stop) - how long does the network load continue (and at which bandwidth)?

When the load is gone and you continue playback (I mean unpause - not resume) - what do you see on the network then?

Link to comment
Share on other sites

kapkan

So tried a completely different movie (~40 Mbps) from the start, it also maxed out the upload to 100 Mbps. I paused it, and upload stayed at 100 for a few seconds. After resuming, it stayed at 0 for almost minute before again reaching to > 95

Link to comment
Share on other sites

Happy2Play

Sounds like you rotate the server Settings-Scheduled Tasks-Rotate server log and reproduce the issue.

But to me there does look like some weird DLNA activity in that log.

 

Link to comment
Share on other sites

15 minutes ago, kapkan said:

So tried a completely different movie (~40 Mbps) from the start, it also maxed out the upload to 100 Mbps. I paused it, and upload stayed at 100 for a few seconds. After resuming, it stayed at 0 for almost minute before again reaching to > 95

OK, then the client is just buffering. Maybe something like the next 5 minutes. Of course the client doesn't care about your bandwidth. It just takes it as fast as it gets it.

The next thing you do is this: Watch the full movie from start to end and record the network activity. Most likely it will go down after a while.
In the end you will know whether the movie was transferred once or twice..

  • Like 1
Link to comment
Share on other sites

kapkan

Indeed, the activity drops off after a bit. It spikes again after I skip to a different segment, which is expected as it loading more buffer again. But then what is the reason for buffering that I experience when watching normally? Is just the inability of the client to react and load properly? In my case it's vero 4k+ (using emby next gen) supposed to be one of the best media players for 4k HDR playback next to shield.

I'll try to do a full test again tomorrow playing a movie completely, and recording network activity. Is there a way to to also make a log for exactly a specific timeframe (for example when I play the movie) on the emby server?

Link to comment
Share on other sites

22 hours ago, kapkan said:

Indeed, the activity drops off after a bit. It spikes again after I skip to a different segment, which is expected as it loading more buffer again. But then what is the reason for buffering that I experience when watching normally? Is just the inability of the client to react and load properly? In my case it's vero 4k+ (using emby next gen) supposed to be one of the best media players for 4k HDR playback next to shield.

I'll try to do a full test again tomorrow playing a movie completely, and recording network activity. Is there a way to to also make a log for exactly a specific timeframe (for example when I play the movie) on the emby server?

Hi, best thing to do is just attach the complete contents of all log files that were written to during that time. Thanks.

Link to comment
Share on other sites

kapkan

Hi @Luke, I had the same problem again while testing yesterday even with everything wired directly to the router. I'm attaching all the logs during playback.

When I look at the network performance (task manager on windows) during this buffering, I see that the send (upload) speed is highly varying (abrupt ups and downs ranging from 2 Mbps to 30). I’m thinking :

If the client (Vero 4k+) is the problem (i.e throttling while receiving packets), then at least I shouldn’t see the problem, using the DLNA on my TV, but it also buffers there

The server (my windows pc) cannot be the problem as it is all direct play and no transcoding involved. But can it be the problem somehow?

Finally, is the router the problem? Can it be the reason for fluctuating uploads/downloads in LAN? I do not have any problems with it using the internet (also all fine while testing with iperf3)!

How do I narrow this down? Any help is appreciated!

embyserver-63783581282.txt hardware_detection-63783581241.txt hardware_detection-63783580328.txt hardware_detection-63783580323.txt hardware_detection-63783580300.txt embyserver-63783586638.txt hardware_detection-63783581314.txt

Link to comment
Share on other sites

You could try rebooting the router and exploring any of it's options that might impact this such as qos. You may just end up having to lower the quality setting to reduce the bitrate via transcoding.

Link to comment
Share on other sites

visproduction

I noticed that the first hardware detection file lists several different profile options.  In this file, there is a listing: Videodecoders Intel (r) HD graphics 5500 MPEG-2 driver.  The .NET Core 3.1.21 listed in this driver was released Nov 8 2021.  There are other settings like:

Supports10BitProcessing":false,"SupportsNativeToneMapping":false

Hmmm... Do you need those set to true? Did you update .NET or drivers recently?

Could a hardware profiles be set to baseline, which looks like it is a profile setup for video conferencing?  Or some other setting that causes a bottleneck? Could that be affecting the throughput speeds needed to encode smoothly?  

I have not set this type of encoding hardware up, so this is really just a guess.

 

 

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