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-amf: Enables a pipeline for texture-based encoding with AMF. #4538

Conversation

OvchinnikovDmitrii
Copy link
Contributor

Description

Adds h264 and hevc texture-based encoders that work via AMF. They are available for selection in advanced settings and does not affect existing AMF encoders.

Updated version of #4228
-Fixed remarks on the previous version
-Changed the default values of some properties
-Removed unnecessary logging

Motivation and Context

To increase the encoding speed.

How Has This Been Tested?

Hardware: Radeon RX Vega 64 | AMD
Operating System: Windows ver. 1809
I recorded the video using new encoders and different settings, and checked the result

Types of changes

New feature
Performance enhancement

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

Usually we recommend force-pushing to the original branch which updates the original PR, rather than opening a second PR.

@WizardCM WizardCM added the Enhancement Improvement to existing functionality label May 12, 2021
@Fenrirthviti Fenrirthviti added the Seeking Testers Build artifacts on CI label Aug 16, 2021
@Pablomx2
Copy link

This PR doesn't 100% work on my 6700 XT using 21.6.1 drivers. Only the recording and low latency presets work and they don't work when you downscale in video settings
If you change something in their settings, DirectX breaks and it doesn't start the encoder, then OBS hangs, here's a log of when it hangs: 2021-08-16 14-31-05.txt

@Pablomx2
Copy link

Also, I noticed that the quality of the encoder does improve a lot by how VBAQ works with the newer SDK. Hopefully you can update this to v1.4.21.0

@flaeri
Copy link
Contributor

flaeri commented Aug 17, 2021

Hello! :)

Driver: 21.6.1
AMD Ryzen 5 4500U APU

I've compiled this PR together with the latest master as of 16.08.2021 (yesterday).

  1. Really needs to log information about the encoder settings/options. This is crucial for support, as we need to know what options have been selected.
  2. Missing some critical features like user set QP in CQP mode
  3. pre-encode option hangs the encoder. (which is enabled by default in the Streaming preset)
    Log: https://obsproject.com/logs/OYBV_IxdnEpjwz5t
  4. OBS crashes if you attempt to use i444 color format -> encode.
    https://hastebin.com/ocipicusaj.apache

As for @Pablomx2's findings, I have no problems scaling, or changing settings. Only the pre-encode option makes it blow up.

@WizardCM WizardCM marked this pull request as draft August 21, 2021 22:43
@OvchinnikovDmitrii
Copy link
Contributor Author

Hello! thank you for your review and research. I added logging of properties, from obs_data_t and the encoder itself for LOG_LEVEL >= DEBUG and corrected some places in the code. In the next commit, I will try to fix the other issues as well.

@cs9kc
Copy link

cs9kc commented Dec 16, 2021

Hello! I'll try to see if I can get a build going with the current changes in it, to test things out. I have an RX 6900 XT on 21.12.1.

It appears that you have incorporated AMF 1.4.21 into this code, which is excellent! Keep up the good work, @OvchinnikovDmitrii! I'm looking forward to this being rolled into OBS Studio proper, as well any newer versions of AMF that you may work on. <3

@e00E
Copy link
Contributor

e00E commented Dec 16, 2021

Since this came up on Discord again today. I also made a rewrite of this plugin. See obsproject/obs-amd-encoder#426 .
Btw I feel this PR should go to that repository too (obsproject/obs-amd-encoder) instead of directly to this repository as the other one is already submoduled into here and the code in this PR builds on the code in the other repo.

@WizardCM
Copy link
Member

Btw I feel this PR should go to that repository too (obsproject/obs-amd/-encoder) instead of directly to this repository as the other one is already submoduled into here and the code in this PR builds on the code in the other repo.

Our goal is to phase out submodules where they're not strictly necessary. I'm personally ok with archiving the amd encoder submodule and merging this pr directly once it's reviewed and in a good state.

@Zeioth
Copy link

Zeioth commented Feb 14, 2022

Currently I can encode videos with AMF on arch linux after installing the package amf-amdgpu-pro.

But I can't select it for video streaming on twitch (only x264/vaapi are listed)
EDIT: It's displayed after installing the plugin obs-streamfx

jp9000 added a commit that referenced this pull request Apr 23, 2022
This version of the AMF encoder is based upon the implementation done by
Luxoft in #4538

Adds support for texture-based AMF encoding, both with H264 and H264
support, as well as HDR support as long as your color format is set to
P010.
jp9000 added a commit that referenced this pull request Apr 23, 2022
This version of the AMD encoder is based upon the implementation done by
Luxoft in #4538

Adds support for texture-based AMD encoding, both with H264 and H264
support, as well as HDR support as long as your color format is set to
P010.
jp9000 added a commit that referenced this pull request Apr 24, 2022
This version of the AMD encoder is based upon the implementation done by
Luxoft in #4538

Adds support for texture-based AMD encoding, both with H264 and H264
support, as well as HDR support as long as your color format is set to
P010.
jp9000 added a commit that referenced this pull request Apr 24, 2022
This version of the AMD encoder is based upon the implementation done by
Luxoft in #4538

Adds support for texture-based AMD encoding, with both H264 and HEVC
support, as well as HDR support as long as your color format is set to
P010.
jp9000 added a commit that referenced this pull request May 6, 2022
This version of the AMD encoder is based upon the implementation done by
Luxoft in #4538

Adds support for texture-based AMD encoding, with both H264 and HEVC
support, as well as HDR support as long as your color format is set to
P010.
jp9000 added a commit that referenced this pull request May 10, 2022
This version of the AMD encoder is based upon the implementation done by
Luxoft in #4538

Adds support for texture-based AMD encoding, with both H264 and HEVC
support, as well as HDR support as long as your color format is set to
P010.
jp9000 added a commit that referenced this pull request May 17, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
jp9000 added a commit that referenced this pull request May 22, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
@RytoEX
Copy link
Member

RytoEX commented Jun 2, 2022

Superseded by #6508.

@RytoEX RytoEX closed this Jun 2, 2022
jp9000 added a commit that referenced this pull request Jun 3, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
jp9000 added a commit that referenced this pull request Jun 5, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
jp9000 added a commit that referenced this pull request Jun 5, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
jp9000 added a commit that referenced this pull request Jun 5, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
jp9000 added a commit that referenced this pull request Jun 6, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
jp9000 added a commit that referenced this pull request Jul 21, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
jp9000 added a commit that referenced this pull request Jul 21, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
jp9000 added a commit that referenced this pull request Jul 21, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
jp9000 added a commit that referenced this pull request Jul 21, 2022
Adds support for texture-based AMD encoding, with both H264, HEVC, and
HDR support. Falls back to FFmpeg when texture-based encoding cannot be
used for whatever reason.

(Jim note: This is based upon #4538 by AMD/Luxoft
with fewer files, FFmpeg fallback for software encoding, and HDR
support. I also went to lengths to ensure that FFmpeg command line
parameters also works with it)

Co-authored-by: Jim <obs.jim@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to existing functionality Seeking Testers Build artifacts on CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants