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

Update FFmpeg to 4.4.1 and add libaom, librist & svt-av1 deps for Windows #86

Merged
merged 2 commits into from
Jan 1, 2022

Conversation

pkviet
Copy link
Member

@pkviet pkviet commented Dec 20, 2021

Description

For windows obs-deps, this:

  • adds librist dependency to FFmpeg,
  • adds libaom & svt-av1 dependecy to FFmpeg (x64 only),
  • updates FFmpeg from 4.2.4 to 4.4.1.
  • updates ffnvcodec dependency to FFmpeg (from sdk 9.0 to sdk 11.1).

For mac FFmpeg dep, cherry picks are added and instead od downloading an archive one uses git.

Motivation and Context

Update FFmpeg dll.

How Has This Been Tested?

This was tested by running the cross-compile script for windows deps.
Runs successfully and creates an archive.
I haven't tested if x86 builds correctly. I'll let CI check it for us.

Types of changes

  • New feature (non-breaking change which adds 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.

@WizardCM
Copy link
Member

WizardCM commented Dec 20, 2021

For the Nvidia headers:

Corresponds to Video Codec SDK version 11.0.10.

Minimum required driver versions:
Windows: 471.41 (June 2021) or newer

This bumps it from the previous minimum of 418.81 (Feb 2019) or newer

@RytoEX
Copy link
Member

RytoEX commented Dec 21, 2021

For the Nvidia headers:

Corresponds to Video Codec SDK version 11.0.10.

Minimum required driver versions:
Windows: 471.41 (June 2021) or newer

This bumps it from the previous minimum of 418.81 (Feb 2019) or newer

Wanted to ask about this. Does this exclude any graphics cards? If so, which ones?

@pkviet
Copy link
Member Author

pkviet commented Dec 21, 2021

For the Nvidia headers:

Corresponds to Video Codec SDK version 11.0.10.

Minimum required driver versions:
Windows: 471.41 (June 2021) or newer

This bumps it from the previous minimum of 418.81 (Feb 2019) or newer

Wanted to ask about this. Does this exclude any graphics cards? If so, which ones?

i'm reverting to nvidia sdk 9 since we haven't found any info about which devices are supported by the SDK 11 and the relevant drivers.

@RytoEX
Copy link
Member

RytoEX commented Dec 21, 2021

As far as I can tell, NVIDIA dropped Fermi support in April 2018. It seems that the R390 driver series was the last to support Fermi, with R410 supporting only Kepler and newer. R470 was the last driver series to support Kepler. If I'm understanding this correctly, R410 through R470 should support the same hardware, with Kepler remaining as the oldest supported. Once the requirement moves beyond R470, we would be dropping Kepler support, which should only happen on a major release and should be coordinated and communicated ahead of time.

As an aside, nv-codec-headers tag n11.1.5.0 says:

Corresponds to Video Codec SDK version 11.0.10.

Minimum required driver versions:
Linux: 470.57.02 or newer
Windows: 471.41 or newer

While tag n11.0.10.1 says:

Corresponds to Video Codec SDK version 11.0.10.

Minimum required driver versions:
Linux: 455.28 or newer
Windows: 456.71 or newer

I'm guessing the former is a slight typo, and it meant to say "Corresponds to Video Codec SDK version 11.1.5.". Indeed, "Video Codec SDK 11.1 is supported on R470 and above drivers on Windows and Linux".

@pkviet pkviet force-pushed the ffmpeg-update branch 9 times, most recently from 3750a8c to 69b2849 Compare December 21, 2021 03:04
Copy link
Member

@RytoEX RytoEX 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 requested some changes. I've also left some "thinking aloud" comments possibly to address at a later time, but I wanted to write down to better commit them to memory.

CI/include/build_support_windows_cross.sh Outdated Show resolved Hide resolved
CI/windows/build_librist.sh Outdated Show resolved Hide resolved
CI/windows/build_librist.sh Outdated Show resolved Hide resolved
win-install-tools.sh Outdated Show resolved Hide resolved
CI/windows/build_librist.sh Outdated Show resolved Hide resolved
CI/windows/build_librist.sh Outdated Show resolved Hide resolved
CI/windows/build_librist.sh Outdated Show resolved Hide resolved
@pkviet pkviet force-pushed the ffmpeg-update branch 7 times, most recently from 57eb67b to a71f9c5 Compare December 22, 2021 23:36
@pkviet pkviet changed the title Update FFmpeg to 4.4.1 and add librist dep for Windows Update FFmpeg to 4.4.1 and add libaom, librist & svt-av1 deps for Windows Dec 23, 2021
@pkviet pkviet force-pushed the ffmpeg-update branch 4 times, most recently from 481979f to f5fa58d Compare December 23, 2021 02:22
CI/windows/build_svt-av1.sh Outdated Show resolved Hide resolved
@WizardCM WizardCM added the enhancement New feature or request label Dec 24, 2021
@PatTheMav
Copy link
Member

So I've been checking the configuration scripts for libvpx and libaom and figured out how to make them both "ignore" any available pthread library and use their built-in shims.

Required adding additional lines to the patches for libvpx and adding a fresh patch for libaom, specifically targeting cross-compile scenarios. In my tests no pthread DLL was linked to the shared libs with these changes.

https://gist.github.com/PatTheMav/5708ff44c40ff8591cde3b7f2fe8e24d

@PatTheMav
Copy link
Member

So I did a cross compile run today with my patch applied and checked the DLLs - looks like no stray mingw DLLs being linked to anymore:

https://gist.github.com/PatTheMav/0d399fba9d059ca6d8cd1db0d9091f78

@pkviet
Copy link
Member Author

pkviet commented Dec 28, 2021

Update (28 dec 2021):

  • I've integrated Pat's patch for libaom and libvpx so that winpthread is not used at all.
  • disabled winpthread in librist in favour of their thread shim.
  • Apart from aja, which is implemented separately, this achieves parity with Jim's custom FFmpeg builds and relies only on win32-pthread or a shim. There's no use of winpthread.

Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

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

The first commit message subject should be: "windows: Update FFmpeg to 4.4.1 and add aom, librist, svt-av1". Please fix the bulleted list in that commit message.

The third commit message should mention that it's on Linux when setting up the cross-compile tools. It doesn't actually take place on Windows. If you include the changes in win-install-tools.sh, it doesn't need the CI or windows prefix.

All other review comments are nitpicks or clarifying questions which hopefully will not result in major changes.

CI/include/build_support_windows_cross.sh Outdated Show resolved Hide resolved
CI/build-deps-windows-cross.sh Outdated Show resolved Hide resolved
CI/include/build_support_windows_cross.sh Outdated Show resolved Hide resolved
CI/macos/build_ffmpeg.sh Outdated Show resolved Hide resolved
CI/windows/build_ffmpeg.sh Outdated Show resolved Hide resolved
@pkviet pkviet force-pushed the ffmpeg-update branch 3 times, most recently from cfc8b00 to 935d1c1 Compare December 28, 2021 22:11
@pkviet
Copy link
Member Author

pkviet commented Dec 28, 2021

New push after removing the cherry picks from FFmpeg.
One could go back for macOS to @PatTheMav initial implementation. Unless instructed otherwise by Pat, I'll leave the build_setup_git for macOS FFmpeg script in case a cherry pick is needed in the future and because this aligns windows and mac scripts.

Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

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

Checking over this again. Hopefully my last review, and anything else can be left to follow-ups.

CI/windows/patches/librist/librist.patch Outdated Show resolved Hide resolved
CI/windows/build_svt-av1.sh Outdated Show resolved Hide resolved
@pkviet
Copy link
Member Author

pkviet commented Dec 30, 2021

I checked on windows 10 x64 with obs master that:

  • aom encodes fine with obs standard recording output,
  • same with svt-av1,
  • rist protocol works fine for streaming to a server (a client plays fine).
    I didn't check x86.

pkviet and others added 2 commits December 31, 2021 20:56
For Windows obs-deps:
 - Add librist, libaom (x64 only), and SVT-AV1 (x64 only) to FFmpeg
 - Update FFmpeg from 4.2.4 to 4.4.1
 - Use a shim instead of winpthreads for libaom and libvpx (PatTheMav)

Co-authored-by: pkv <pkv@obsproject.com>
Co-authored-by: PatTheMav <PatTheMav@users.noreply.github.com>
Co-authored-by: WizardCM <git@wizardcm.com>
Allows cherry picking in the future and aligns implementation with
Windows.

Co-authored-by: PatTheMav <PatTheMav@users.noreply.github.com>
Co-authored-by: pkv <pkv@obsproject.com>
@RytoEX
Copy link
Member

RytoEX commented Mar 17, 2022

@pkviet
I somehow missed this when reviewing, but why did this need to add yasm? We had previously been building without it, using nasm instead, if I understand correctly.

@pkviet
Copy link
Member Author

pkviet commented Mar 17, 2022

@pkviet
I somehow missed this when reviewing, but why did this need to add yasm? We had previously been building without it, using nasm instead, if I understand correctly.

It is required by svt-av1 according to its build instructions.
Did Jim build it with nasm ?
I haven't tested and don't know if it is possible.

@pkviet
Copy link
Member Author

pkviet commented Mar 17, 2022

So i checked the CMakeLists.txt for svt-av1 and nasm can be used but it requires a cmake flag to be set. So yasm is their recommended choice on default

@pkviet pkviet deleted the ffmpeg-update branch May 21, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Seeking Testers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants