Jump to content

Docker bitrate limit


Recommended Posts

Nuitarius
Posted

Hi there,

I am struggling with a new issue I have not seen before, so I am back here on this awesome forum.

I was watching Panic Room today on 4K that I bought and ripped not too long ago.

I am running with Emby in a docker on a Linux server and I have not had similar issue before.

During playback I have had approx. 10 buffer stops during the entire movie. We got through the movie and I am now into full troubleshoot mode.

As a 4K movie, ripped in all its glory, using direct play, it is of course a high bitrate movie 80-ish Gbps.

I use a 19" rack gigabit switch between my Movie server and the Nvidia Shield. I am certain that the Nvidia Shield Pro (newest edition) supports 1 Gbps. My Mobo Z170I Pro Gaming also supports 1Gbps.

I went to the logfile on emby server and found these lines

{"Container":"mp3","Type":"Audio","AudioCodec":"mp3","Protocol":"http","EstimateContentLength":false,"EnableMpegtsM2TsMode":false,"TranscodeSeekInfo":"Auto","CopyTimestamps":false,"Context":"Static","MaxAudioChannels":"2","MinSegments":0,"SegmentLength":0,"BreakOnNonKeyFrames":false,"AllowInterlacedVideoStreamCopy":false,"MaxManifestSubtitles":0,"MaxWidth":0,"MaxHeight":0,"FillEmptySubtitleSegments":false}],"ContainerProfiles":[],"CodecProfiles":[{"Type":"Video","Conditions":[{"Condition":"EqualsAny","Property":"VideoProfile","Value":"Main|Main 10|Rext","IsRequired":false}],"ApplyConditions":[],"Codec":"hevc"},{"Type":"Video","Conditions":[{"Condition":"LessThanEqual","Property":"VideoLevel","Value":"51","IsRequired":false}],"ApplyConditions":[],"Codec":"h264"}],"ResponseProfiles":[],"SubtitleProfiles":[{"Format":"vtt","Method":"Hls"},{"Format":"srt","Method":"External"},{"Format":"ssa","Method":"External"},{"Format":"ass","Method":"External"},{"Format":"smi","Method":"External"},{"Format":"srt","Method":"Embed"},{"Format":"subrip","Method":"Embed"},{"Format":"ass","Method":"Embed"},{"Format":"ssa","Method":"Embed"},{"Format":"dvb_teletext","Method":"Embed"},{"Format":"dvb_subtitle","Method":"Embed"},{"Format":"dvbsub","Method":"Embed"},{"Format":"pgs","Method":"Embed"},{"Format":"pgssub","Method":"Embed"},{"Format":"dvdsub","Method":"Embed"},{"Format":"vtt","Method":"Embed"},{"Format":"sub","Method":"Embed"},{"Format":"idx","Method":"Embed"},{"Format":"smi","Method":"Embed"},{"Format":"mov_text","Method":"Embed"},{"Format":"eia_608","Method":"VideoSideData"},{"Format":"eia_708","Method":"VideoSideData"}]},"EnableDirectPlay":true,"EnableDirectStream":true,"EnableTranscoding":true,"AllowInterlacedVideoStreamCopy":false,"AllowVideoStreamCopy":true,"AllowAudioStreamCopy":true,"IsPlayback":false,"AutoOpenLiveStream":false,"DirectPlayProtocols":["Http"]}
2025-03-17 19:25:51.431 Debug SqliteItemRepository: GetitemById Movie 74322 /mnt/Disk2/UHD/Movies/Panic Room (2002)/Panic Room (2002) - Theatrical.mkv
2025-03-17 19:25:51.435 Info App: User policy for Nuitarius. EnablePlaybackRemuxing: False EnableVideoPlaybackTranscoding: False EnableAudioPlaybackTranscoding: False
2025-03-17 19:25:51.435 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 80295253, max bitrate: 70000000
2025-03-17 19:25:51.435 Info App: Bitrate exceeds DirectStream limit: media bitrate: 80295253, max bitrate: 70000000
2025-03-17 19:25:51.435 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 80295253, max bitrate: 70000000
2025-03-17 19:25:51.435 Info App: Bitrate exceeds DirectStream limit: media bitrate: 80295253, max bitrate: 70000000
2025-03-17 19:25:51.436 Info Server: http/1.1 Response 200 to ‌‍‍10.75.56.196‌. Time: 7ms. POST http://‌‍‍10.75.56.104‌:8096/emby/Items/74322/PlaybackInfo?UserId=d34f74f3db984f21900d7cc48a2a5a5e&StartTimeTicks=0&IsPlayback=false&AutoOpenLiveStream=false&MaxStreamingBitrate=70000000&X-Emby-Client=Emby for Android&X-Emby-Device-Name=SHIELD&X-Emby-Device-Id=266736eef6e1881f&X-Emby-Client-Version=3.4.36&X-Emby-Token=‌91d9f3c2e7cb479a8aee931ec067b84b‌&X-Emby-Language=en-us&reqformat=json
2025-03-17 19:25:57.941 Debug Server: http/1.1 GET http://‌‍‍10.75.56.104‌:8096/emby/Users/d34f74f3db984f21900d7cc48a2a5a5e/Items/Resume

 

It seems I am hitting a bitrate limitation somewhere, or am I misreading the log?

Can someone help me with figuring out if this is a setting I can change or if it is a HW limit, where it is? :)

I appreciate any help. Thank you

embyserver (copy).txt

Posted
Quote

It seems I am hitting a bitrate limitation somewhere, or am I misreading the log?

You're not hitting a limit.

The app is configured to a quality setting of 70 mbps, so normally this would cause transcoding to occur, but you've got that restricted in user permissions so that can't happen.

There is nothing wrong here other than the fact that it seems data is not getting to the device quickly enough, thus leading to the stuttering.

Nuitarius
Posted
58 minutes ago, Luke said:

You're not hitting a limit.

The app is configured to a quality setting of 70 mbps, so normally this would cause transcoding to occur, but you've got that restricted in user permissions so that can't happen.

There is nothing wrong here other than the fact that it seems data is not getting to the device quickly enough, thus leading to the stuttering.

Hmmm okay.
So I would rather not have transcoding, which is why I have set it up to not allow for it.
How do I remove the bottleneck? You say it is not getting there fast enough, but I am unsure why.

Nuitarius
Posted

Could it be that docker is limiting my network to 100mbps?

Posted

Right well that is the big question. Does the problem occur with lower bitrate content?

Posted
Just now, Nuitarius said:

Could it be that docker is limiting my network to 100mbps?

I've not heard of that, but obviously anytime you add an extra layer into the mix such as Docker, it just creates another thing that needs to be investigated when you have a problem that is hard to hunt down. Are you at least using host networking mode on the container?

Nuitarius
Posted
1 minute ago, Luke said:

Right well that is the big question. Does the problem occur with lower bitrate content?

No it does not. I have watched at least 8 other blu ray movies the past 2 weeks, and they never buffered.

Nuitarius
Posted
Just now, Luke said:

I've not heard of that, but obviously anytime you add an extra layer into the mix such as Docker, it just creates another thing that needs to be investigated when you have a problem that is hard to hunt down. Are you at least using host networking mode on the container?

"host networking mode"... :D If only I knew what that was. So my first guess would be a no :) 

Posted

Well how did you configure the docker container? it is either host or bridge networking mode. If you don't know, then you're probably on host as bridge is much more complicated to get everything working with.

Nuitarius
Posted

image.thumb.png.b121d07affc99414fd2a3bcb36ee8b12.png

Does this bridging on my docker container mean anything to you?

Nuitarius
Posted (edited)

I went through a MacVlan setup of my container so to give my container an IP on the network.

docker network create -d macvlan \
  --subnet=10.75.56.0/24 \
  --ip-range=10.75.56.32/27 \
  --gateway=10.75.56.1 \
  -o parent=enp0s31f6 \
  my-macvlan-net


sudo ip link add mynet-shim link enp0s31f6 type macvlan  mode bridge  
sudo ip addr add 10.75.56.63/32 dev mynet-shim
sudo ip link set mynet-shim up
sudo ip route add 10.75.56.32/27 dev mynet-shim

Edited by Nuitarius
Q-Droid
Posted

This is what @Luke is talking about. You seem to have a limit set, check your app playback settings.

Quote

2025-03-17 18:46:37.185 Info App: User policy for Nuitarius. EnablePlaybackRemuxing: False EnableVideoPlaybackTranscoding: False EnableAudioPlaybackTranscoding: False
2025-03-17 18:46:37.185 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 80295253, max bitrate: 70000000
2025-03-17 18:46:37.185 Info App: Bitrate exceeds DirectStream limit: media bitrate: 80295253, max bitrate: 70000000
2025-03-17 18:46:37.185 Info App: Bitrate exceeds DirectPlay limit: media bitrate: 80295253, max bitrate: 70000000
2025-03-17 18:46:37.185 Info App: Bitrate exceeds DirectStream limit: media bitrate: 80295253, max bitrate: 70000000


 

Posted
2 minutes ago, Q-Droid said:

This is what @Luke is talking about. You seem to have a limit set, check your app playback settings.


 

He has restricted transcoding access, so the fact that there is a limit set doesn't end up mattering.

Nuitarius
Posted
2 minutes ago, Q-Droid said:

This is what @Luke is talking about. You seem to have a limit set, check your app playback settings.


 

I am sorry if this is a dumb question, but what setting would I be looking for? :D
image.thumb.png.d09f8a5ed51352111d5d25f2fb067499.png

 

This one seems to be oddly low?

Q-Droid
Posted
Just now, Luke said:

He has restricted transcoding access, so the fact that there is a limit set doesn't end up mattering.

So it should still play instead of throwing "No compatible stream..." messages?

 

Q-Droid
Posted (edited)
2 minutes ago, Nuitarius said:

I am sorry if this is a dumb question, but what setting would I be looking for? :D
 

This one seems to be oddly low?

Playback settings are per app/per user. In this case that would be settings on the Shield but according to @Luke this might not be the issue.

 

 

Edited by Q-Droid
Posted
3 minutes ago, Q-Droid said:

So it should still play instead of throwing "No compatible stream..." messages?

 

It will try to, but of course it might fail if there is a problem.

Q-Droid
Posted

I guess you could try WiFi on the Shield. If for anything just to see if the playback changes. It might help you isolate the problem. Also play other media of the same or higher bitrate if you have it to eliminate a possible bad rip.

 

 

 

Nuitarius
Posted

I have some observations after some testing.

- Nvidia Shield internet speed test. Result. 250mbps up and down which is identical to the speed I have bought and also identical to same test done from host machine and my main PC

- Docker bridge mode changed to host. Result: No effect. Well except that in bridged mode I had equal up and down load while streaming, but in host mode I only have upload. Odd?

- Running 4K movie in one room with direct play and transcoding a 4K movie in another room. Result: No impact on quality in either room.

- I have some (okay, read "a lot of") permission denied on writing to disk from my log. Could these be the reason? How would I go about fixing that?

2025-03-17 18:46:35.677 Error ProviderManager: UnauthorizedAccessException: Emby Server is being denied write access to /mnt/Disk1/EmbyServerMetadata/metadata/people/Jared Leto-tmdb-7499/folder.jpg. Please check your file permissions.
2025-03-17 18:46:35.678 Error Server: Error processing request
    *** Error Report ***
    Version: 4.8.8.0
    Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
    Operating system: Linux version 5.10.0-34-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1
    Framework: .NET 6.0.25
    OS/Process: x64/x64
    Runtime: system/System.Private.CoreLib.dll
    Processor count: 8
    Data path: /config
    Application path: /system
    System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/Disk1/EmbyServerMetadata/metadata/people/Jared Leto-tmdb-7499' is denied.
     ---> System.IO.IOException: Permission denied
       --- End of inner exception stack trace ---
       at Emby.Providers.Manager.ImageSaver.SaveImage(BaseItem item, LibraryOptions libraryOptions, IImageSource source, ReadOnlyMemory`1 mimeType, ImageType type, Nullable`1 imageIndex, Nullable`1 saveLocallyWithMedia, Int64[] generatedFromItemIds, IDirectoryService directoryService, Boolean updateImageCache, CancellationToken cancellationToken)

 

  • Thanks 1
Posted

I don't think the permission denied errors will affect this, although they would certainly be nice to cleanup. Essentially you need to ensure that emby server has write access to that location.

Happy2Play
Posted

Yes there would appear to be a recursive issue with your custom path.

2025-03-17 00:00:10.640 Info App: Internal metadata path: /mnt/Disk1/EmbyServerMetadata/metadata

 

Nuitarius
Posted
11 minutes ago, Happy2Play said:

Yes there would appear to be a recursive issue with your custom path.

2025-03-17 00:00:10.640 Info App: Internal metadata path: /mnt/Disk1/EmbyServerMetadata/metadata

 

Could you please elaborate for me whatthis means and do you have a suggestion for what I can do? :) 

Nuitarius
Posted
39 minutes ago, Luke said:

I don't think the permission denied errors will affect this, although they would certainly be nice to cleanup. Essentially you need to ensure that emby server has write access to that location.

I think I solved this issue now. I had an issue with scheduled backup of database, and after used  my media group (1001) and emby user of that group (1002) in the run of the docker that issue is gone, so I assume that I got a handle on it. Thanks

  • Thanks 1
Nuitarius
Posted

I assume that this is no longer a HW issue as I have ruled out the Shield and its OS, the cables, the switches, the HDD's and the host machine.

This leaves the following things that I have not ruled out:
- The emby app on the shield
- Docker
- Emby server
- The movie file

I will look into seeing if I can rule out the movie somehow, but is there any way of ruling out the others in the list? And maybe someone can suggest more stuff I have not ruled out?

Posted

Can you try running the server using our native package on the host machine?

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