Jump to content

Conversion bitrate not honored


Recommended Posts

justinrh
Posted (edited)

original post title: Conversion bitrate not honored

When I convert this file, the selected bitrate is not even close on the output file.

original

image.png.9b9dcaaa39d388791a6c1f65ac15c5b7.png

 

8Mbps selected

image.png.d493dea2d085ce1a97fe39383ead0c1d.png

 

4Mbps selected

image.png.0f2f3ebe4db265c9f1b508e16bca92f1.png

Edited by justinrh
Posted

Hi there, let's look at an example conversion:

Thanks.

justinrh
Posted

I thought we just did  :-)  Are you asking for a transcode log or what?

Happy2Play
Posted

Need the corresponding logs to see what Emby did as MediaInfo is really irrelevant.  But am pretty sure there are other topics on this and will attach if I find them.

Posted

Try resetting these back to default:

>>>>>  Non-Default Encoder Parameters
Warning EncoderParametersH264LibX.ConstantRateFactor: Original: 23 Actual: 28
Warning EncoderParametersH264LibX.Preset: Original: veryfast Actual: faster

 

justinrh
Posted

@Luke

19 hours ago, Luke said:

Try resetting these back to default:

How do I do that?

Happy2Play
Posted
3 minutes ago, justinrh said:

@Luke

How do I do that?

That would suggest Conversion is using Transcode options then so Dashboard-Transcoding.

justinrh
Posted (edited)

Changed settings per Luke's direction.  Logs attached.

Still, the video is ~1.5Mbps.

ffmpeg-transcode.txtembyserver.txt

 

Edited by justinrh
Happy2Play
Posted

@Luke @softworkzwasn't there a discussion about maxrate conversions as the conversion sits at about 1.5Mps instead of the set quality?

-c:v:0 libx264 -g:v:0 180 -maxrate:v:0 3520000

 

Posted

The quality setting is really a maximum. It just so happens that the software encoder doesn't come quite as close to the requested max as the hardware encoders do. Not at default settings at least.

Posted
16 hours ago, Happy2Play said:

@Luke @softworkzwasn't there a discussion about maxrate conversions as the conversion sits at about 1.5Mps instead of the set quality?


-c:v:0 libx264 -g:v:0 180 -maxrate:v:0 3520000

 

Yes, this is something we haven't come to work on yet. For libx264, we're using the CRF (constant rate factor) mode which isn't working in a way to hit the desired bit rate.

The options for getting closer are:

1. Use lower CRF Values

Means lower than the default (23), e.g. 16-22

2. Try ABR Mode

To activate, you need to install the "Emby Diagnostics" plugin and adjust the encoding parameters of the libx264 encoder under "Advanced Transcoding":

image.png.eb405f0d2eeed41fb67f55b023a61dc6.png

 

We've documented this a number of times, but received just minimal feedback so far.
(which might explain the prioritization)

As I always said: feedback on playing around with this is welcome!

softworkz

 

  • Thanks 1
justinrh
Posted

Help me understand this correctly.  The quality settings (Mbps) are basically not working at all?

Posted

Just roughly, meaning that higher values will produce higher output bandwidth, but not hitting those values like in case with hw encoders.

justinrh
Posted

@softworkz It seems to me you are trying to control too many factors, as they all do the same thing, so which wins?

CRF and preset both determine quality output.  Consider Handbrake's UI - only one or the other (bitrate or CRF) can be set, but not both; then a preset is just a prescribed CRF.  We have too many inputs acting at the same time.

Given this UI, what quality value is the user actually going to get?

image.png.9f622a2b7009ec94c8dc46417a253d06.png

Posted (edited)
5 minutes ago, justinrh said:

CRF and preset both determine quality output.  Consider Handbrake's UI - only one or the other (bitrate or CRF) can be set, but not both; then a preset is just a prescribed CRF.  We have too many inputs acting at the same time.

That's not correct. A preset is not a prescribed CRF!

In simple words:

  • CRF determines the output rate ("constant rate factor") 
  • The presets determine the amount of compute resources to use for encoding
    (you can have better and worse quality at the same encoded bitrate)

 

Edited by softworkz
justinrh
Posted

Then maybe Emby's use of 'preset' is different than Handbrake's use of 'preset'.  In HB, selecting a preset changes the CRF to a certain value, then the user can adjust from there overriding the preset value.

Either way, how is a user supposed to grasp these two settings?  Both are said to determine "quality".  There is no way to correlate.

Posted

Both affect quality: one by increased file size and the other one by increased CPU usage

I agree that these settings are confusing. It's not even clear that these apply to software encoding only, but not when hw acceleration is used.

  • Like 1
justinrh
Posted (edited)

I set CRF = 18 (preset = veryfast).  "8Mbps" -> 6.5Mbps (1920x1080), "4Mbps" -> 2.8Mbps (1280x720).  Much closer!  The visual quality is much better.

I'm curious as to why the frame size changes - another variable not shown to the user!

Tomorrow I'll play with the diags plugin if I have time.

Edited by justinrh
Posted
10 minutes ago, justinrh said:

I'm curious as to why the frame size changes - another variable not shown to the user!

This is because the conversion uses the same logic as for playback: for playback, we have the bandwidth as input parameter (either auto-detected or set by the user). 
Going from there, we need to find the best way to present a video, and with a given bandwidth, there are certain steps where the overall result will be better at a lower resolution instead of keeping the resolution and reducing the bitrate only.

  • Thanks 1
justinrh
Posted

I installed the diag plugin and don't see anything for libx264 in these pages:

image.png.0d9c01bceb669a3ac5d04a5c7e2a405c.png

Posted

Got to "Transcoding", choose "Advanced" and Save.

Got to "Advanced Transcoding", scroll down to libx264 Encoder and click on the gear button.

justinrh
Posted

There is no 'advanced' on the Transcoding page.

Happy2Play
Posted
1 minute ago, justinrh said:

There is no 'advanced' on the Transcoding page.

You do not see this drop down box?

image.png.0c73451fae2f7032db4d317f639d8720.png

Painkiller88
Posted (edited)

Yes we already had a discussion like that about the set bitrate also for transcoding streams.

The Problem is, The Client can overrule this setting (lower, but not higher)

eg. If you set all clients to allow 10MBIT but the client on his phone is set to AUTO it will result in exactly the same bitrate you have on your images.

If you set the Users Phone Settings to exactly 10MBIT like you allows to him, he will get about 6-8MBIT in his streams instead of the waned 10MBIT

Setting the Users Phone Settings from AUTO to 12MBIT will result in the 10MBIT you are granting him, because he can't go higher as you allow him.

I know this is confusing as the configured Bitrate is not working as it should, but this is what i recorgnized in my time using emby how you get your desired Bitrate.

I would say it is NOT working correctly but the answer in another Thread was, this is like it should be...  so i just tell all my friends to set the bitrate a bit higher than i allowed them to use it. This solved it so far.

Edited by Painkiller8818

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