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 support for variable framerate encodings #3381

Open
sdroege opened this issue May 22, 2024 · 1 comment
Open

Add support for variable framerate encodings #3381

sdroege opened this issue May 22, 2024 · 1 comment
Labels

Comments

@sdroege
Copy link
Contributor

sdroege commented May 22, 2024

Describe the bug

Currently rav1e assumes that every frame's duration is one unit of time_base. This is only correct for fixed framerate streams.

To Reproduce

Using rav1e to encode a stream coming from a normal webcam or some other source with a variable framerate causes rate control to not work correctly.

Expected behavior

It should be possible to provide timestamps for each frame (in time_base units) and this would be used by rate control to figure out how much time each frame represents.

Prior art can be found in aom (aom_codec_encode() PTS and duration parameters) or libvpx (vpx_codec_encode() PTS and duration parameters). Both seem to work correctly if the duration is just an estimate (you don't necessarily know it yet without waiting for the next frame) and use the PTS as main source of truth.

@sdroege sdroege added the bug label May 22, 2024
@lu-zero
Copy link
Collaborator

lu-zero commented May 22, 2024

Passing the information would be easy either adding fields to FrameParameters or adding yet another IntoFrame implementation.
But it requires the rate control to deal correctly with that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants