Jump to content

Setting bitrate > 1 < 13 Mbps results in direct stream even though the source is 13 Mbps


optimalt

Recommended Posts

optimalt

Hello,

For some reason Emby server seems to think that the bitrate of the TV-stream from Mediaportal  is 1,1 Mbps when it's actually closer to 13-14 Mbps.

This results in no transcoding and thus a 13 Mbps output to all clients that has the their bitrate set higher than 1,1 Mbps.

I can verify that the output stream is in fact 13-14 Mbps in the traffic analyzer in my router.

The file created in the Emby transcoding-temp folder when streaming a TV-channel is also approximately 13 Mbps regardless of bitrate setting above 1 Mbps in the client.

When the client bitrate setting is set to values lower than 1,1 Mbps (1 Mbps for example) the server transcodes as expected.

 

This is a problem for me because the picture quality is bad with 1 Mbps and 13-14 Mbps is too high for my Chromecasts and also consumes too much bandwidth. I would like something in between – maybe 4, 5 or 6 Mbps.

 

I have tried “force transcode” and different mediainfo delays from 80 to 7000 ms in the Mediaportal plugin settings – but the result is more or less the same (sometimes Emby server thinks that the bitrate of the TV-stream from Mediaportal  is 3,1 Mbps instead of 1,1 Mbps).

 

Logs provided when doing this:

1. Start TV-channel in Chrome at 4 Mbps (max available)

# The timeshift file(s) in the MP-timeshift folder is 13-14 Mbps (expected)

# The file in the Emby transcoding temp folder is 13-14 Mbps (not expected, should be 4 Mbps?)

# Control panel in Emby server shows 1,1 Mbps (not expected, should show 4 Mbps?)

# The outgoing stream to the client is 13-14 Mbps according to my router (not expected, should be 4 Mbps?)

 

2. Lowering bitrate in Chrome from 4 to 2 Mbps

# The timeshift file(s) in the MP-timeshift folder is (of course) still 13-14 Mbps (expected)

# New file in the Emby transcoding temp folder, but still 13-14 Mbps (not expected, should be 2 Mbps?)

# Control panel in Emby server shows 1,1 Mbps (not expected, should show 2 Mbps?)

# The outgoing stream to the client is 13-14 Mbps according to my router (not expected, should be 2 Mbps?)

 

3. Lowering bitrate in Chrome from 2 to 1 Mbps

# The file(s) in the MP-timeshift folder is (of course) still 13-14 Mbps (expected)

# New file in the Emby transcoding temp folder with approximately 1 Mbps (expected)

# Control panel in Emby server shows 1000 kbps (expected)

# The outgoing stream to the client is approximately 1 Mbps according to my router (expected)

 

Sample files:

# Copy of file in the Emby transcoding-temp folder when bitrate setting in Chrome was set to 2 Mbps:

https://www.dropbox.com/s/nzhxiflnsrvi5yw/db44cd4910f330d1ea3c9d993065e793.mkv?dl=0

 

# Copy of file in the Emby transcoding-temp folder when bitrate setting in Chrome was set to 1 Mbps

https://www.dropbox.com/s/hpbut8oidwanwwz/a284952ea81bd851264fd554370231f3.mkv?dl=0

 

Appreciate all your help!

 

logs.zip

Link to comment
Share on other sites

The stream is being reported by the media portal plugin as having a bitrate of 1mbps. I don't know if it's getting that value by guessing or via probing the stream. But in any event, that explains the behavior that you're seeing by the core emby server.

Link to comment
Share on other sites

pünktchen

Hi optimalt,

the plugin itself doesn't have any impact on the streaming bitrate if you're using "Direct" as streaming profile. (That's the case from your logs)

The only thing i'm doing at stream request is sending some hardcoded bitrate informations to Emby, depending on the stream resolution:

VideoStream Height <= 576 : Bitrate = 4Mbps
VideoStream Height > 576 or VideoStream Height <= 720 : Bitrate = 7Mbps
VideoStream Height > 720 : Bitrate = 9Mbps

It's of course not the real video stream bitrate i'm sending to Emby. MPExtended doesn't provide one!

Even if MPExtended would do this, it wouldn't make any sense because a live tv stream has always a variable bitrate!

 

@@Luke Is it enough to deliver an overall bitrate of the whole stream or do i have to set it also for every video stream inside the container?

I can see a video bitrate of 1000000 in the transcoding logs but i've never set this within the plugin.

 

@@optimalt You should set "MediaInfo Delay" back to something between 1500 and 2500, otherwise you will get false results about the stream resolution.

"Force Transcode" doesn't change anything other than telling Emby that the stream cannot be direct played or direct streamed.

Link to comment
Share on other sites

pünktchen

@@optimalt

Please give the attached version a try.

Copy the dll over to "C:\Users\<YOUR USERNAME>\AppData\Roaming\Emby-Server\plugins"

and restart Emby server!

Edited by pünktchen
  • Like 1
Link to comment
Share on other sites

optimalt

I think it works! Now when I set the bitrate to 4 Mbps in Crome the Emby server actually serves a 4 Mbps stream.

Thank you for great support!

 

Edit: It's the attached version in post #4 that seems to work (not setting the delay to 1500).

Edited by optimalt
  • Like 1
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...