matanui159 / ReplaySorcery

An open-source, instant-replay solution for Linux
GNU General Public License v3.0
854 stars 27 forks source link

Cannot get hwaccel to work #158

Closed IronFractal closed 2 years ago

IronFractal commented 2 years ago

Describe the bug

Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'logLevel' to 'info'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'traceLevel' to 'error'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'recordSeconds' to '60'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoInput' to 'kms_service'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoDevice' to 'auto'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoX' to '0'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoY' to '0'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoWidth' to '2560'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoHeight' to '1440'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoFramerate' to '75'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoEncoder' to 'auto'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoProfile' to 'baseline'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoPreset' to 'fast'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoQuality' to '14'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoBitrate' to '2M'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'videoGOP' to '30'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'scaleWidth' to 'auto'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'scaleHeight' to 'auto'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'audioInput' to 'auto'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'audioDevice' to 'auto'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'audioSamplerate' to '44100'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'audioEncoder' to 'auto'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'audioProfile' to 'low'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'audioBitrate' to 'auto'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'controller' to 'auto'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'keyName' to 'r'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'keyMods' to 'ctrl+super'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'outputFile' to '~/Videos/ReplaySorcery/%F_%H-%M-%S.mp4'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Setting 'outputCommand' to 'notify-send ReplaySorcery "Saved replay as %s"'...
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Failed to open config file '/home/<user>/.config/replay-sorcery.conf': No such file or directory
Jun 25 10:20:37 pop-os replay-sorcery[141141]: ReplaySorcery  Copyright (C) 2020-2021  ReplaySorcery developers
Jun 25 10:20:37 pop-os replay-sorcery[141141]: This program comes with ABSOLUTELY NO WARRANTY.
Jun 25 10:20:37 pop-os replay-sorcery[141141]: This is free software, and you are welcome to redistribute it
Jun 25 10:20:37 pop-os replay-sorcery[141141]: under certain conditions; see COPYING for details.
Jun 25 10:20:37 pop-os replay-sorcery[141141]: FFmpeg version: 4.4.2-0ubuntu0.22.04.1
Jun 25 10:20:37 pop-os replay-sorcery[141141]: [h264_vaapi @ 0x564bb26ef380] Filter graph: hwmap=derive_device=vaapi,crop=2560:1440:0:0,scale_vaapi=2560:1440:nv12
Jun 25 10:20:37 pop-os replay-sorcery[141141]: [h264_vaapi @ 0x564bb26ef380] H.264 baseline profile is not supported, using constrained baseline profile instead.
Jun 25 10:20:37 pop-os replay-sorcery[141141]: [h264_vaapi @ 0x564bb26ef380] Driver does not support QVBR RC mode (supported modes: CQP, CBR, VBR).
Jun 25 10:20:37 pop-os replay-sorcery[141141]:  - /mnt/Apps/Applications/ReplaySorcery/src/encoder/ffenc.c:334 (rsFFmpegEncoderOpen)
Jun 25 10:20:37 pop-os replay-sorcery[141141]:  - /mnt/Apps/Applications/ReplaySorcery/src/encoder/vah264enc.c:68 (rsVaapiH264EncoderCreate)
Jun 25 10:20:37 pop-os replay-sorcery[141141]:  - /mnt/Apps/Applications/ReplaySorcery/src/encoder/encoder.c:71 (rsVideoEncoderCreate)
Jun 25 10:20:37 pop-os replay-sorcery[141141]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:182 (main)
Jun 25 10:20:37 pop-os replay-sorcery[141141]: [NULL @ 0x564bb26ef380] Failed to open encoder: Invalid argument
Jun 25 10:20:37 pop-os replay-sorcery[141141]:  - /mnt/Apps/Applications/ReplaySorcery/src/encoder/ffenc.c:335 (rsFFmpegEncoderOpen)
Jun 25 10:20:37 pop-os replay-sorcery[141141]:  - /mnt/Apps/Applications/ReplaySorcery/src/encoder/vah264enc.c:68 (rsVaapiH264EncoderCreate)
Jun 25 10:20:37 pop-os replay-sorcery[141141]:  - /mnt/Apps/Applications/ReplaySorcery/src/encoder/encoder.c:71 (rsVideoEncoderCreate)
Jun 25 10:20:37 pop-os replay-sorcery[141141]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:182 (main)
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Failed to create VA-API encoder: Invalid argument
Jun 25 10:20:37 pop-os replay-sorcery[141141]: Function not implemented
Jun 25 10:20:37 pop-os replay-sorcery[141141]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:238 (main)
Jun 25 10:15:08 pop-os systemd[1]: Started ReplaySorcery KMS service.
Jun 25 10:15:50 pop-os replay-sorcery[139703]: Exiting...
Jun 25 10:15:50 pop-os systemd[1]: Stopping ReplaySorcery KMS service...
Jun 25 10:15:50 pop-os systemd[1]: replay-sorcery-kms.service: Deactivated successfully.
Jun 25 10:15:50 pop-os systemd[1]: Stopped ReplaySorcery KMS service.
Jun 25 10:18:33 pop-os systemd[1]: Started ReplaySorcery KMS service.
Jun 25 10:18:33 pop-os replay-sorcery[140090]: Framerate = 75, Device = auto
Jun 25 10:18:33 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0dd8040] Using plane 55 to locate framebuffers.
Jun 25 10:18:33 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0dd8040] Template framebuffer is 123: 4480x1440 format 34325258 modifier 200000000717b02 flags 2.
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Failed to send message: Connection reset by peer
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/socket.c:184 (rsSocketSend)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:81 (kmsConnection)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:135 (rsKmsService)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:54 (mainCommand)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:165 (main)
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Disconnected: Connection reset by peer
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Framerate = 75, Device = auto
Jun 25 10:18:34 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0dd9f80] Using plane 55 to locate framebuffers.
Jun 25 10:18:34 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0dd9f80] Template framebuffer is 112: 4480x1440 format 34325258 modifier 200000000717b02 flags 2.
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Failed to send message: Connection reset by peer
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/socket.c:184 (rsSocketSend)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:81 (kmsConnection)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:135 (rsKmsService)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:54 (mainCommand)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:165 (main)
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Disconnected: Connection reset by peer
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Framerate = 75, Device = auto
Jun 25 10:18:34 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0ddc340] Using plane 55 to locate framebuffers.
Jun 25 10:18:34 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0ddc340] Template framebuffer is 123: 4480x1440 format 34325258 modifier 200000000717b02 flags 2.
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Failed to send message: Connection reset by peer
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/socket.c:184 (rsSocketSend)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:81 (kmsConnection)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:135 (rsKmsService)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:54 (mainCommand)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:165 (main)
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Disconnected: Connection reset by peer
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Framerate = 75, Device = auto
Jun 25 10:18:34 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0ddc340] Using plane 55 to locate framebuffers.
Jun 25 10:18:34 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0ddc340] Template framebuffer is 112: 4480x1440 format 34325258 modifier 200000000717b02 flags 2.
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Failed to send message: Connection reset by peer
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/socket.c:184 (rsSocketSend)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:81 (kmsConnection)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:135 (rsKmsService)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:54 (mainCommand)
Jun 25 10:18:34 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/main.c:165 (main)
Jun 25 10:18:34 pop-os replay-sorcery[140090]: Disconnected: Connection reset by peer
Jun 25 10:18:35 pop-os replay-sorcery[140090]: Framerate = 75, Device = auto
Jun 25 10:18:35 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0dd9f80] Using plane 55 to locate framebuffers.
Jun 25 10:18:35 pop-os replay-sorcery[140090]: [kmsgrab @ 0x5596d0dd9f80] Template framebuffer is 112: 4480x1440 format 34325258 modifier 200000000717b02 flags 2.
Jun 25 10:18:35 pop-os replay-sorcery[140090]: Failed to send message: Connection reset by peer
Jun 25 10:18:35 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/socket.c:184 (rsSocketSend)
Jun 25 10:18:35 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:81 (kmsConnection)
Jun 25 10:18:35 pop-os replay-sorcery[140090]:  - /mnt/Apps/Applications/ReplaySorcery/src/command/svkmscmd.c:135 (rsKmsService)

"Failed to send message: Connection reset by peer" ?????

libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Mesa Gallium driver 22.0.1 for AMD Radeon RX 5500 XT (navi14, LLVM 13.0.1, DRM 3.44, 5.17.5-76051705-generic)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Desktop:

Configuration: Please upload your copy of /usr/local/etc/replay-sorcery.conf (/usr/etc/replay-sorcery.conf on Arch) and a copy of ~/.config/replay-sorcery.conf if it exists.

# Possible values: trace, debug, verbose, info, warning, error, fatal, panic, quiet
# Default value: info
logLevel = info

# The minimum log-level to add stacktraces to
# Possible values: trace, debug, verbose, info, warning, error, fatal, panic, quiet
# Default value: error
traceLevel = error

# The duration of the recording in seconds
# Default value: 30
recordSeconds = 60

# The video input backend to use for video recording
# Possible values: auto, hwaccel, x11, kms, kms_service
# Default value: auto
videoInput = kms_service

# The name of the input video device
# For kms and kms_service, see `replay-sorcery kms-devices`
# Possible values: auto, or a device string
# Default value: auto
videoDevice = auto

# The X, Y, width and height of recording rectangle
# Default value: 0, 0
videoX = 0
videoY = 0
# Possible values: a positive integer or auto
# Default value: auto, auto
videoWidth = 2560
videoHeight = 1440

# The framerate of the recording
# Default value: 30
videoFramerate = 75

# The video encoder backend to use for video recording
# Possible values: auto, hevc, x264, openh264, x265, vaapi_h264, vaapi_hevc
# Default value: auto
videoEncoder = auto

# The H.264 profile to use for video encoding
# Possible values: baseline, main, high
# Default value: baseline
videoProfile = baseline

# A high-level preset for video encoding performance
# Possible values: fast, medium, slow
# Default value: fast
videoPreset = fast

# The quality to use for video encoding, lower is better
# Possible values: 1-51 or auto
# Default value: 28
videoQuality = 14

# The bitrate to use for video encoding
# Possible values: a positive integer ending in an SI prefix (eg. 1M) or auto
# Default value: auto
videoBitrate = 2M

# The number of frames between IDR frames
# Default value: 30
videoGOP = 30

# The width and height to scale the video to
# Possible values: a positive integer or auto
# Default value: auto, auto
scaleWidth = auto
scaleHeight = auto

# The audio input backend to use for audio recording
# Possible values: none, auto, pulse
# Default value: auto
audioInput = auto

# The name of the input audio device
# For pulse, see `pactl list sources`
# Possible values: auto, system, or a device string
# Default value: auto
audioDevice = auto

# The samplerate to use for audio recording
# Default value: 44100
audioSamplerate = 44100

# The audio encoder backend to use for audio recording
# Possible values: auto, aac, fdk
# Default value: auto
audioEncoder = auto

# The AAC profile to use for audio encoding
# Possible values: low (LC), main, high (HE)
# Default value: low
audioProfile = low

# The bitrate to use for audio encoding
# Possible values: a positive integer ending in an SI prefix (eg. 1K) or auto
# Default value: auto
audioBitrate = auto

# The controller backend to use for detecting key presses
# Possible values: auto, debug, x11
# Default value: auto
controller = auto

# The key name and key modifiers (as a set of flags) to press to save a video
# Default value: r
keyName = r
# Possible values: ctrl, shift, alt, super
# Default value: ctrl+super
keyMods = ctrl+super

# Where to save the output file
# Possible values: a strftime formatted file path
# Default value: ~/Videos/ReplaySorcery_%F_%H-%M-%S.mp4
outputFile = ~/Videos/ReplaySorcery/%F_%H-%M-%S.mp4

# A command to run when a video is successfully saved
# Possible values: a printf formatted command
# Default value: notify-send ReplaySorcery "Saved replay as %s"
outputCommand = notify-send ReplaySorcery "Saved replay as %s"

Logs: Please run journalctl --user -eu replay-sorcery -n 100 > replay-sorcery.log and upload the result.

matanui159 commented 2 years ago

Setting both videoBitrate and videoQuality when using the VA-API encoder will require the device to support "Quality-defined Variable-Bitrate" (QVBR), which your device does not seem to support. You will have to set one of those two options to auto