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

build(ffmpeg): update to FFmpeg 7.1 #359

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

cgutman
Copy link
Contributor

@cgutman cgutman commented Oct 5, 2024

Description

This PR rebases from FFmpeg 6.1 to FFmpeg 7.1.

Notable changes:

  • A replacement for 01-amf-colorspace-v3.patch was upstreamed in FFmpeg 7.1, but it requires a fixup to pass-through the proper colorspace into the bitstream for HEVC and AV1. I replaced it with the patch I sent to ffmpeg-devel, but upstream will probably take a better fix that handles both internal RGB->YUV conversion and pre-converted YUV input
  • A replacement for 02-idr-on-amf.patch was upstreamed but missed the 7.1 cut, so this patch is replaced with my upstreamed version. This requires changes on the Sunshine side to set the forced_idr option for AMF like we do for QSV and NVENC.
  • A replacement for 05-amfenc-new-av1-usages.patch was upstreamed for FFmpeg 7.1, so that patch is dropped completely
  • Some minor changes were required to the CBS stuff to adapt to the new VP8 CBS support in FFmpeg 7.1 and the relocation of HEVC-related headers
  • 05-vaapi-customized-surface-alignment.patch needed to be reworked due to upstream refactoring of common VAAPI/D3D12VA/Vulkan encoding logic into a single base class

Testing checklist:

  • Software
  • QSV
  • NVENC (Linux)
  • AMF
  • VideoToolbox
  • VAAPI (Intel)
  • VAAPI (AMD + alignment fix)

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

@cgutman cgutman requested a review from ReenigneArcher October 5, 2024 05:31
@cgutman cgutman mentioned this pull request Oct 5, 2024
10 tasks
@cgutman
Copy link
Contributor Author

cgutman commented Oct 5, 2024

There seems to be an extra frame of latency introduced in NVENC that causes a "decoder did not produce IDR frame" warning when the client requests an IDR frame. I don't see anything obvious in upstream changes that would explain it, so I'll probably have to bisect.

@cgutman
Copy link
Contributor Author

cgutman commented Oct 5, 2024

OK, I'm not sure why the behavior changed in FFmpeg, but it looks like setting surfaces=1 for NVENC solves it.

This is ready for merge. I'll open up the Sunshine PR after merge to update the submodule and add the new options for NVENC and AMF.

@ReenigneArcher ReenigneArcher merged commit ff50cf8 into LizardByte:master Oct 5, 2024
12 checks passed
@DistantThunder
Copy link

I don't know if it's of any incidence but FFMPEG release/7.1 branch isn't at the same commit as actual tag release

@ReenigneArcher
Copy link
Member

@DistantThunder we are following the release/7.1 branch: https://github.com/FFmpeg/FFmpeg/commits/release/7.1/

@moi952
Copy link

moi952 commented Oct 7, 2024

Hi,
What does FFmpeg 7.1 bring to the use of sunshine?
I saw that vulkan had been implemented but not for encoding is that right?
Thanks and sorry for the inconvenience

@ReenigneArcher
Copy link
Member

The notes in this PR should help answer that: #359

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

Successfully merging this pull request may close these issues.

4 participants