Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more control over encoder #6

Closed
bmegli opened this issue Jan 29, 2019 · 4 comments
Closed

add more control over encoder #6

bmegli opened this issue Jan 29, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@bmegli
Copy link
Owner

bmegli commented Jan 29, 2019

Things like:

  • h.264 profile
  • key frame interval
  • speed/size control
  • bitrate

This needs extending hve_config or adding some other means but library needs to remain deadly simple.

@bmegli bmegli added the enhancement New feature or request label Jan 29, 2019
@bmegli
Copy link
Owner Author

bmegli commented Feb 9, 2019

Internally the profile can be selected with e.g:

avctx->profile=FF_PROFILE_H264_CONSTRAINED_BASELINE;

What is causing most lag are B frames (by default encoder is lagging by 2 frames).

To disable B frames:

avctx->max_b_frames=0;

@bmegli
Copy link
Owner Author

bmegli commented Feb 11, 2019

Added some basic control in 274662e

There are more possibilities but this is enough for my needs now.

@bmegli bmegli closed this as completed Feb 11, 2019
@bmegli
Copy link
Owner Author

bmegli commented Apr 2, 2020

More control is possible:

The high level information may be found in:

Definite information is in implementation:

The support varies with hardware, VAAPI driver version/libva and FFmpeg.

For FFmpeg releases code may be inspected in the links above.

@bmegli bmegli reopened this Apr 2, 2020
bmegli added a commit that referenced this issue Apr 2, 2020
- add compression_level configuration option
- 0 for default
- 1 for the highest quality
- 7 for the fastest

The default in my tests is not set to highest quality.

On my 2017 KabyLake with 848x480@30 HEVC Main10 encoding
, the difference between default and highest quality is:
- 15%/25% GPU render busy
- 7-9 ms/10-12 ms per frame

Related to #6
bmegli added a commit that referenced this issue Apr 10, 2020
- extend hardware config with input_width, input_height fields
- if specified and different from width/height perform hardware accelerated scaling before encoding
- update examples
- update docs
- update readme

Adds dependency on libavfilter.

Closes #24
Makes #5 more complex
Indirectly related to #25
Indirectly related to #6
@bmegli
Copy link
Owner Author

bmegli commented Apr 19, 2020

This is enough for my needs, closing for now.

It is worth noting that:

  • it is possible to use more modes (aprart from VBR/CQP)
  • accelerated denoising/sharpening is possible

Some of those only with newer hardware/software stack.

@bmegli bmegli closed this as completed Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant