obsproject / obs-amd-encoder

AMD Advanced Media Framework Encoder Plugin for Open Broadcaster Studio
https://obsproject.com/forum/threads/amd-advanced-media-framework-encoder-plugin-for-obs-studio.52305/
GNU General Public License v2.0
454 stars 87 forks source link

obs amd amf encoder crash (arch linux) #429

Closed DiarrheaMcgee closed 2 years ago

DiarrheaMcgee commented 2 years ago

if i try to record anything using amf then it freezes for a couple of seconds and crashes

since typing this it now says Starting the output failed. Please check the log for details. Note: If you are using the NVENC or AMD encoders, make sure your video drivers are up to date.

(and outputs [h264_amf @ 0x56401f54bac0] CreateComponent(AMFVideoEncoderVCE_AVC) failed with error 1 error: [StreamFX] Unexpected exception in function '_create': Encoder not found. into the terminal if i open it from the terminal)

arguments: env VK_ICD_FILENAMES=/opt/amdgpu-pro/amd_pro_icd64.json obs

output:

info: [StreamFX] [h264_amf] Configuration:
info: [StreamFX] [h264_amf]   FFmpeg:
info: [StreamFX] [h264_amf]     Custom Settings: 
info: [StreamFX] [h264_amf]     Standard Compliance: Normal
info: [StreamFX] [h264_amf]     Threading: None (with 1 threads)
info: [StreamFX] [h264_amf]   Video:
info: [StreamFX] [h264_amf]     Input: 1920x1080 nv12 BT.709 Full
info: [StreamFX] [h264_amf]     Output: 1920x1080 nv12 BT.709 Full
info: [StreamFX] [h264_amf]     On GPU Index: -1
info: [StreamFX] [h264_amf]     Framerate: 60/1 (60.000000 FPS)
info: [StreamFX] [h264_amf]   Keyframes: 
info: [StreamFX] [h264_amf]     Distance: 120 frames
info: [StreamFX] [h264_amf]   AMD AMF:
info: [StreamFX] [h264_amf]     Usage: transcoding <Default>
info: [StreamFX] [h264_amf]     Preset: balanced
info: [StreamFX] [h264_amf]     Rate Control: cbr
info: [StreamFX] [h264_amf]       Look-Ahead: Disabled <Default>
info: [StreamFX] [h264_amf]       Frame Skipping: Disabled <Default>
info: [StreamFX] [h264_amf]       Filler Data: Enabled
info: [StreamFX] [h264_amf]       Bitrate:
info: [StreamFX] [h264_amf]         Target: 6000000 bits/sec
info: [StreamFX] [h264_amf]         Maximum: 0 bits/sec <Default>
info: [StreamFX] [h264_amf]         Buffer: 12000000 bits
info: [StreamFX] [h264_amf]       Quantization Parameters:
info: [StreamFX] [h264_amf]         I-Frame: -1  <Default>
info: [StreamFX] [h264_amf]         P-Frame: -1  <Default>
info: [StreamFX] [h264_amf]     Other:
info: [StreamFX] [h264_amf]       Reference Frames: -1 Frames
info: [StreamFX] [h264_amf]       Enforce HRD: Disabled <Default>
info: [StreamFX] [h264_amf]       VBAQ: Disabled <Default>
info: [StreamFX] [h264_amf]       Access Unit Delimiter: Disabled <Default>
info: [StreamFX] [h264_amf]         Maximum Size: 0  <Default>
info: [StreamFX] [h264_amf]       Half-Pel Motion Estimation: Enabled <Default>
info: [StreamFX] [h264_amf]       Quarter-Pel Motion Estimation: Enabled <Default>
info: [StreamFX] [h264_amf]     H.264/AVC:
info: [StreamFX] [h264_amf]       Profile: high
info: [StreamFX] [h264_amf]       Level: auto <Default>
zsh: segmentation fault (core dumped)  obs

output of ffmpeg -encoders | grep amf


ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
 V....D h264_amf             AMD AMF H.264 Encoder (codec h264)
 V....D hevc_amf             AMD AMF HEVC encoder (codec hevc)```

specs:
Operating System: Arch Linux
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.17.5-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: AMD Radeon RX 6900 XT
WizardCM commented 2 years ago

The errors are coming from the third party plugin StreamFX, not this encoder plugin.

DiarrheaMcgee commented 2 years ago

how do i use amd amf in (arch) linux then since when i remove streamfx it disapears

DiarrheaMcgee commented 2 years ago

when i set it to custom output and set it to h264 amf then it says: An unspecified error occurred while recording.

Failed to open video codec: Encoder not found

DiarrheaMcgee commented 2 years ago

its fixed turns out the error message was coming from ffmpeg because of a broken driver downgrading to driver version 21.50.2 fixes it for some reason

DiarrheaMcgee commented 2 years ago

as of a few days ago the issue started happening again

qiuyaoboy commented 2 years ago

I executed the ffmpeg to perform transcoding test and got same issue. My system configurations are as follows: GPU: Radeon Pro W6800 AMDGPU Driver verison: 21.50.2/22.10.2 OS: Ubuntu 20.04.4

qiuyaoboy commented 2 years ago

After downgrading my GPU driver to 21.40.2, downgrading AMF to 1.4.23, recompiling ffmpeg v4.4.1, everything was back to normal.

DiarrheaMcgee commented 2 years ago

that worked for me too (although i used vulkan-amdgpu-pro v21.30_1290604-1)