Jump to content

Confused about bitrate and scaling choices


Happy2Play

Recommended Posts

Happy2Play

@softworkz I am confused then as I have bitrate limit of 7.75Mbps and client on auto and this scaling 720x404

Global Remote Bitrate Limit: 7,750,000 bps

>>>>>>  Video Processing Steps for [0:0]: H.265 (HEVC)
        Step                    HW-Context   Format       SW-Format           Size   Next
        HEVC_QSV             >> QSV          qsv          p010           3840x2160 >> vpp_qsv
        vpp_qsv              >> QSV          qsv          p010             720x404 >> setparams
        setparams            >> QSV          qsv          p010             720x404 >> hwmap
        hwmap                >> OPENCL       opencl       p010             720x404 >> tonemap_opencl
        tonemap_opencl       >> OPENCL       opencl       nv12             720x404 >> hwmap
        hwmap                >> QSV          qsv          nv12             720x404 >> 

But setting client quality to max quality I get scaling 1920x1080

Global Remote Bitrate Limit: 7,750,000 bps

>>>>>>  Video Processing Steps for [0:0]: H.265 (HEVC)
        Step                    HW-Context   Format       SW-Format           Size   Next
        HEVC_QSV             >> QSV          qsv          p010           3840x2160 >> vpp_qsv
        vpp_qsv              >> QSV          qsv          p010           1920x1080 >> setparams
        setparams            >> QSV          qsv          p010           1920x1080 >> hwmap
        hwmap                >> OPENCL       opencl       p010           1920x1080 >> tonemap_opencl
        tonemap_opencl       >> OPENCL       opencl       nv12           1920x1080 >> hwmap
        hwmap                >> QSV          qsv          nv12           1920x1080 >> 

 

Link to comment
Share on other sites

Happy2Play

@softworkz Okay but per other question this does seem to apply.

Quote

 Would applying client quality differently honor resolution but keep bitrate limit?

As scaling is totally different per client quality.

So I would question if SoGX changed client quality would it correct the issue?

Link to comment
Share on other sites

16 minutes ago, Happy2Play said:

So I would question if SoGX changed client quality would it correct the issue?

The bitrate doesn't matter, but as soon as SogX will hit the point where Emby decides not to downscale the video, the aliasing of the edges will disappear.

It's like a computer game with bad antialiasing - increasing the quality doesn't help, but increasing resolution does.

Link to comment
Share on other sites

You can see from the image that I've posted that even at half of the bitrate, you get a perfect output with downscaling.

(except when the encoder doesn't work properly)

Link to comment
Share on other sites

Happy2Play
3 minutes ago, softworkz said:

increasing the quality doesn't help, but increasing resolution does.

Is that not what is happening above with 720x404 vs 1920x1080

Link to comment
Share on other sites

34 minutes ago, Happy2Play said:

@softworkz I am confused then as I have bitrate limit of 7.75Mbps and client on auto and this scaling 720x404

But setting client quality to max quality I get scaling 1920x1080

I can't answer that immediately - that's why I split it out.

Will need to see the full case with logs.

Link to comment
Share on other sites

Just now, Happy2Play said:
5 minutes ago, softworkz said:

increasing the quality doesn't help, but increasing resolution does.

Is that not what is happening above with 720x404 vs 1920x1080

What I mean is: With the defective decoder you get a subjectively better result with a higher resolution, irrespectively of the bitrate setting (in the ffmpeg command line)

Link to comment
Share on other sites

Happy2Play
2 minutes ago, softworkz said:

Will need to see the full case with logs.

Here are the logs in my test just looking at scaling differences when client quality changed from Auto to 1080p-8Mbs.  With Global at 7.75.Mbps.

ffmpeg-transcode-0eb28ac9-e212-4927-8ab1-21d8ace9a593_1.txtffmpeg-transcode-ed8bb79c-6745-4cf1-9fee-d221f79023e1_1.txt

Link to comment
Share on other sites

The client does this, when you choose "Auto":

image.png.9ac139da1a0d2b79b6f683c37b7956f4.png

 

That value should actually be based on some bandwidth measurement, it was broken for a long time. Don't know the current status of it...

@Luke?

  • Like 1
Link to comment
Share on other sites

Happy2Play

So Auto is defaulting to a coded value of about 5Mbps.

Retested at with a Global of 5Mbps to be in line with other topic and the client quality did not matter as they both scaled to 720x404.  

Changing Global to 5.5 changes to 1280X720 and 7.75 to 1920x1080 with client set to 1080p-8Mbs.

So bitrate sets the scaling threshold.

So the begs to question the Client Quality setting If they are not going to honored.

image.png.6fcca43dff118eb40b401d1ebf0ddf0a.png

Setting to 720p-2Mbps gets scaled to 640x360

 

Link to comment
Share on other sites

7 minutes ago, Happy2Play said:

So bitrate sets the scaling threshold.

Yes, correct.

7 minutes ago, Happy2Play said:

So the begs to question the Client Quality setting If they are not going to honored.

What is honored is the bitrate part in that list. The other part (720, 1080) is more of informational nature.

I know it appears odd, but no longer once you think it through:

  • The primary and most important parameter for video streaming (non-local) is the available bandwidth
    This is he starting point. A well-behaving client measures the available bandwidth and tells (in Auto mode) the server about it
  • But for the server, it's not that easy to determine which resolution to use for a given bandwidth
    It cannot simply go by a table (like the list of quality selections in the clients) - because there is no linear relation between bandwidth and video size height(!)
    The server needs to consider this:
    • Video framerate
      At a given frame size, videos with a higher frame rate take a higher bandwidth
    • Video widths
      The list shows only heights (720, 1080) - but what about widths?
      Videos can be 4:3 or cinemascope, from one to the other, it can be the double amount of pixels
    • The source video content
      This is taken into account by looking at the source video bandwidth and the codec (iirc)
  • The way how these choices are made have evolved over time based on experience
    The only little issue that I'm aware of is that HEVC source videos are weighed a bit too strong in the calculations

What's really unfortunate though, is that the quality selection list in the clients is creating a wrong impression.

Link to comment
Share on other sites

Happy2Play
10 minutes ago, softworkz said:

What's really unfortunate though, is that the quality selection list in the clients is creating a wrong impression.

Yes, I believe this is a key factor as the listed resolution is irrelevant and creates the question why am I not getting that resolution?

I guess it should be documented somewhere the biterate resolution variables.

? to ? scales to 640x360

? to 5.25Mbps scales to 720x404

5.5Mbs to 7.5Mbps scales to 1280X720

7.75Mbps to ? scales to 1920x1080

? to ?   scales to 3840x2160

Link to comment
Share on other sites

1 minute ago, Happy2Play said:

? to ? scales to 640x360

? to 5.25Mbps scales to 720x404

5.5Mbs to 7.5Mbps scales to 1280X720

7.75Mbps to ? scales to 1920x1080

? to ?   scales to 3840x2160

???

I've just explained that no such kind of relation exists and why..

Link to comment
Share on other sites

Happy2Play
2 minutes ago, softworkz said:

???

I've just explained that no such kind of relation exists and why..

I have tested 2 to 7.75Mbps and get scaling at specific values though.  So bitrate dictates scaling at least in this test.

Link to comment
Share on other sites

Compare 

  • An HEVC source file and an MPEG2Video source file (same framerate)
  • A source file with 24fps and one with 60fps (same source codec)

and see whether output scaling switches at the same thresholds.

Link to comment
Share on other sites

  • 1 month later...
lightsout
On 7/20/2022 at 5:28 PM, softworkz said:

The client does this, when you choose "Auto":

image.png.9ac139da1a0d2b79b6f683c37b7956f4.png

 

That value should actually be based on some bandwidth measurement, it was broken for a long time. Don't know the current status of it...

@Luke?

Helpful thread, on an unrelated note what software is that in the screen shot?

Link to comment
Share on other sites

Happy2Play
7 minutes ago, lightsout said:

Helpful thread, on an unrelated note what software is that in the screen shot?

It is a support tool softworkz created for troubleshooting.

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