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

obs-ffmpeg: Disable NVENC/AMF DTS adjustment for AV1 #10996

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

palana
Copy link
Contributor

@palana palana commented Jul 16, 2024

Description

Aligns AV1 DTS and PTS, since AV1 doesn't use b-frame delay (similar to VP9/VP8). AV1 instead handles reordering of frames transparently by outputting frames that aren't displayed in the same encode call; e.g. with b-frames enabled the first time data is returned by these encoders there will generally be a keyframe in the output that can be displayed immediately, and the next time data is returned (with the next dts) will contain various frames that aren't displayed and one frame that is displayed

in the image below, frames with green underline are output in the same encode call:
image

consider also the ertmp (v1 and later) spec https://github.com/veovera/enhanced-rtmp/blob/6445c80106c418ebe6bb18602e1c86645b2c1778/docs/enhanced/enhanced-rtmp-v1.md where PacketTypeCodedFrames for AV1 does not include SI24 = [CompositionTime Offset]

Motivation and Context

AV1 timestamps are currently misaligned for NVENC/AMF in multi codec ladders for Enhanced Broadcasting/Multitrack Video on Twitch

How Has This Been Tested?

Twitch Enhanced Broadcasting Beta, inspected timestamps via broadcast performance metrics logs

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@derrod derrod added the Bug Fix Non-breaking change which fixes an issue label Jul 16, 2024
Copy link
Member

@derrod derrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been wondering about whether or not we need to do this since working on #10436 and learning about show/no-show frames, but didn't have time to look into it. Seems fine to me.

@RytoEX
Copy link
Member

RytoEX commented Jul 17, 2024

Is this something critical? While the NVENC code changed here was added in 30.2 (here 2f55f04), the AMF code is nearly two years old (2e5f900).

@derrod
Copy link
Member

derrod commented Jul 17, 2024

Is this something critical? While the NVENC code changed here was added in 30.2 (here 2f55f04), the AMF code is nearly two years old (2e5f900).

The NVENC code was only moved in 30.2, it has existed like that previously.

Given that this doesn't cause issues with recordings or streaming to YouTube, and Twitch has no plans of allowing AV1 all that soon anyway I do not think this is critical, but good to have for 31.0.

@RytoEX RytoEX added this to the OBS Studio 31 milestone Jul 17, 2024
@RytoEX RytoEX self-assigned this Jul 29, 2024
@RytoEX RytoEX merged commit b2d83ef into obsproject:master Jul 30, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants