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

When are keyframes generated? #158

Closed
aboba opened this issue Apr 13, 2023 · 1 comment · Fixed by #167
Closed

When are keyframes generated? #158

aboba opened this issue Apr 13, 2023 · 1 comment · Fixed by #167

Comments

@aboba
Copy link
Contributor

aboba commented Apr 13, 2023

Keyframe generation in WebRTC-PC is an under-specified side effect of other operations.

  • Key frames may be generated when changing scaleResolutionDownBy and re-setting active=true after active=false. As noted below, this may not be necessary if the receiver supports resolution scaling.
  • Keyframes typically aren't generated when setting active = false (e.g. turning off the highest simulcast layer) or dropping the highest SVC spatial layer. This causes SFU to switch participants to a lower layer, but without a keyframe or layer refresh they won’t be able to decode it.

The current text relating to scaleResolutionDownBy and active does not provide much detail about what happens when a value of scaleResolutionDownBy is present in setParameters() or when active is changed. For example:

  • Is a keyframe automatically generated when the scaleResolutionDownBy value is changed or when active is set to true? Can a keyframe be automatically generated in other situations (e.g. when scaleResolutionDownBy is set, regardless of whether it has changed, when active is set to false in a simulcast layer)?
  • If a keyframe is not automatically generated, what happens if the decoder doesn't support the ability to do spatial prediction, that is, using frames of a resolution different than the current resolution as dependencies? In this circumstance a change in the scaleResolutionDownBy value can be expected to result in a decoder error and a PLI.

Note: the Media Capabilities API makes it possible to discover whether a decoder supports spatial prediction via the spatialScalability attribute. This was introduced because some (hardware) decoders were found to be unable to do spatial prediction, and therefore would produce a decoder error on encountering an encoding using spatial prediction.

@aboba aboba self-assigned this Apr 13, 2023
@aboba aboba changed the title setParameters: changing scaleResolutionDownBy When are keyframes generated? May 14, 2023
@dontcallmedom-bot
Copy link

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

Successfully merging a pull request may close this issue.

2 participants