Skip to content
This repository was archived by the owner on Mar 22, 2022. It is now read-only.
This repository was archived by the owner on Mar 22, 2022. It is now read-only.

H.264 video quality very low for a long time after startup #107

@fiban-havok

Description

@fiban-havok

By default the H264 encoder code uses the min bitrate as starting bitrate, which leads to very poor image quality at the beginning of the stream. The problem is compounded by the fact that:

  1. the bitrate is changed through stopping the stream, resetting the whole Media Foundation pipeline and restarting the stream; this takes a long time and causes visible stuttering
  2. the min interval between successive resets is set to 15s (supposedly to avoid a lot of stuttering in one go) which has the side effect of making significant rate changes take a very long time.

There are several ways we can address this:

  • avoiding a full pipeline reset by setting https://docs.microsoft.com/windows/desktop/DirectShow/avenccommonmeanbitrate-property instead when only a bitrate change is needed (which is most times)
  • initialize the new pipeline while the old one is still encoding (not sure if this is possible or there are limitations, especially with hardware encoders)
  • expose the start/min bitrate through the native API and have the user/high-level API set it to a higher value (depending on e.g. the resolution).

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions