pulsejet / memories

Fast, modern and advanced photo management suite. Runs as a Nextcloud app.
https://memories.gallery
GNU Affero General Public License v3.0
2.98k stars 79 forks source link

Hardware encoding issues with Intel Arc dGPU #1224

Open major-mayer opened 1 month ago

major-mayer commented 1 month ago

Describe the bug I recently installed an Intel ARC A380 GPU in my system to make use of AV1 hardware-accelerated encoding in Jellyfin. They have a very extensive documentation about how to set this up and in the end everything worked out fine.

Now I wanted to benefit from this success for the Memories app as well, but I am getting some errors in the process. I am not sure if AV1 encoding is supported at all, but if it's just H264 for now, that would be fine for me as well, if it would work. Unfortuantely that's not the case. When I activate hardware acceleration in the Memories settings (with or without low power QSV mode, which works well for Jellyfin), the videos just don't start playing anymore.

To Reproduce Steps to reproduce the behavior:

So I added the graphics card to the go-vod Docker container like this:

services:
  go-vod:
    image: radialapps/go-vod
    init: true
    restart: always
    environment:
      - NEXTCLOUD_HOST=https://nc.example.com
    devices:
      - /dev/dri:/dev/dri
    volumes:
      - /mnt/data/ncfpm:/var/www/html:ro
    group_add:
      - "107"
    ports: 
      - 47788:47788

Then I activated the hardware encoding in Memories' settings like this: image I am exposing the go-vod port and use an IP address instead of the Docker Compose assigned hostname, because go-vod is running outside the VM, where Nextcloud is running (my host OS doesn't support GPU pass-through).

Then I start playing some videos.

Screenshots If applicable, add screenshots to help explain your problem.

Platform:

Additional context Client logs:

[...]
Photo has no width or height but using msize helpers.ts:86:14
Will-change memory consumption is too high. Budget limit is the document surface area multiplied by 3 (3076374 px). Occurrences of will-change over the budget will be ignored. memories
VIDEOJS: WARN: The element supplied is not included in the DOM video.es.js:222:45
Invalid URI. Load of media resource  failed. memories
Failed sending heartbeat, got: undefined UserStatus.vue:168
VIDEOJS: WARN: The element supplied is not included in the DOM video.es.js:222:45
Failed sending heartbeat, got: undefined UserStatus.vue:168
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
Failed sending heartbeat, got: undefined 2 UserStatus.vue:168
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-max.m3u8. video.es.js:222:45
Failed sending heartbeat, got: undefined 2 UserStatus.vue:168
Invalid URI. Load of media resource  failed. memories
Photo has no width or height but using msize helpers.ts:86:14
VIDEOJS: WARN: The element supplied is not included in the DOM video.es.js:222:45
Failed sending heartbeat, got: undefined 2 UserStatus.vue:168
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-1080p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 2-1080p.m3u8. Could not determine codecs for playlist. Switching to playlist 3-1440p.m3u8. video.es.js:222:45
Failed sending heartbeat, got: undefined UserStatus.vue:168
VIDEOJS: WARN: Problem encountered with playlist 3-1440p.m3u8. Could not determine codecs for playlist. Switching to playlist 4-max.m3u8. video.es.js:222:45
Failed sending heartbeat, got: undefined UserStatus.vue:168
Invalid URI. Load of media resource  failed. memories
Failed sending heartbeat, got: undefined 4 UserStatus.vue:168
VIDEOJS: WARN: The element supplied is not included in the DOM video.es.js:222:45
MouseEvent.mozPressure is deprecated. Use PointerEvent.pressure instead. video.es.js:2065:14
MouseEvent.mozInputSource is deprecated. Use PointerEvent.pointerType instead. video.es.js:2065:14
VIDEOJS: WARN: Problem encountered with playlist 2-max.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 0-480p.m3u8. video.es.js:222:45
VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists. 
Object { code: 3, message: "Playback cannot continue. No available working or supported playlists." }
video.es.js:222:45
PsVideo: Direct video stream could not be opened, trying HLS PsVideo.ts:226:20
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-max.m3u8. video.es.js:222:45
Failed sending heartbeat, got: undefined UserStatus.vue:168
Invalid URI. Load of media resource  failed. memories
OC.requestToken changed EM7C5E/qAbdiScVQWoFiNR/bW/pZxEaXlMlXegCJB1I=:fPaM0y6uaNAYf6wUGPEoRVCOHbEsgB/Pwo8tKE3ARQQ= index.js:314:9
Failed sending heartbeat, got: undefined 2 UserStatus.vue:168
VIDEOJS: WARN: The element supplied is not included in the DOM video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-max.m3u8. video.es.js:222:45
VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists. 
Object { code: 3, message: "Playback cannot continue. No available working or supported playlists." }
video.es.js:222:45
PsVideo: Direct video stream could not be opened, trying HLS PsVideo.ts:226:20
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-max.m3u8. video.es.js:222:45
VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists. 
Object { code: 3, message: "Playback cannot continue. No available working or supported playlists." }
video.es.js:222:45
Invalid URI. Load of media resource  failed. memories
VIDEOJS: WARN: The element supplied is not included in the DOM video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-max.m3u8. video.es.js:222:45
VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists. 
Object { code: 3, message: "Playback cannot continue. No available working or supported playlists." }
video.es.js:222:45
PsVideo: Direct video stream could not be opened, trying HLS PsVideo.ts:226:20
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
Invalid URI. Load of media resource  failed. memories
Failed sending heartbeat, got: undefined 2 UserStatus.vue:168
VIDEOJS: WARN: The element supplied is not included in the DOM video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-max.m3u8. video.es.js:222:45
VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists. 
Object { code: 3, message: "Playback cannot continue. No available working or supported playlists." }
video.es.js:222:45
PsVideo: Direct video stream could not be opened, trying HLS PsVideo.ts:226:20
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-max.m3u8. video.es.js:222:45
VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists. 
Object { code: 3, message: "Playback cannot continue. No available working or supported playlists." }
video.es.js:222:45
Failed sending heartbeat, got: undefined 2 UserStatus.vue:168
Invalid URI. Load of media resource  failed. memories
VIDEOJS: WARN: The element supplied is not included in the DOM video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-max.m3u8. video.es.js:222:45
VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists. 
Object { code: 3, message: "Playback cannot continue. No available working or supported playlists." }
video.es.js:222:45
PsVideo: Direct video stream could not be opened, trying HLS PsVideo.ts:226:20
VIDEOJS: WARN: Problem encountered with playlist 0-480p.m3u8. Could not determine codecs for playlist. Switching to playlist 1-720p.m3u8. video.es.js:222:45
VIDEOJS: WARN: Problem encountered with playlist 1-720p.m3u8. Could not determine codecs for playlist. Switching to playlist 2-max.m3u8. video.es.js:222:45
OC.requestToken changed eGsQ6FtPCJnHKB1pz5j+XP8Ze+MIiGInTlIb+VwY8GQ=:FFNe3zoLYf69HnQtjei0LLBMPah9zDt/GBRhqxFRsjI= index.js:314:9
VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) Playback cannot continue. No available working or supported playlists. 
Object { code: 3, message: "Playback cannot continue. No available working or supported playlists." }
video.es.js:222:45

Go-vod logs (contains multiple tries):

2024/06/13 21:24:27 ffmpeg-error: Error reinitializing filters!
2024/06/13 21:24:27 ffmpeg-error: Failed to inject frame into filter network: Input/output error
2024/06/13 21:24:27 ffmpeg-error: Error while processing the decoded data for stream #0:0
2024/06/13 21:24:27 anyghi1efdv0-720p: ffmpeg exited with status: 1
2024/06/13 21:24:27 anyghi1efdv0-max: stopping stream
2024/06/13 21:24:27 anyghi1efdv0-max: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/var/www/html/data/xxx/GH011076_1711207383541.MP4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/anyghi1efdv0-306555676/max-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/13 21:24:28 ffmpeg-error: [h264 @ 0x561afdd52100] Failed to create decode context: 2 (resource allocation failed).
2024/06/13 21:24:28 ffmpeg-error: [h264 @ 0x561afdd52100] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/13 21:24:28 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x561aff476000] Failed to create processing pipeline context: 2 (resource allocation failed).
2024/06/13 21:24:28 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x561aff476000] Failed to configure output pad on Parsed_scale_vaapi_2
2024/06/13 21:24:28 ffmpeg-error: Error reinitializing filters!
2024/06/13 21:24:28 ffmpeg-error: Failed to inject frame into filter network: Input/output error
2024/06/13 21:24:28 ffmpeg-error: Error while processing the decoded data for stream #0:0
2024/06/13 21:24:28 anyghi1efdv0-max: ffmpeg exited with status: 1
2024/06/13 21:25:25 anyghi1efdv0-max: stopping stream
2024/06/13 21:25:25 anyghi1efdv0-480p: stopping stream
2024/06/13 21:25:35 anyghi1efdv0-720p: stopping stream
2024/06/13 21:25:43 &{Version:0.2.5 Configured:true VersionMonitor:true Bind::47788 FFmpeg:/usr/local/bin/ffmpeg FFprobe:/usr/local/bin/ffprobe TempDir:/tmp/go-vod ChunkSize:3 LookBehind:3 GoalBufferMin:1 GoalBufferMax:4 StreamIdleTime:60 ManagerIdleTime:60 QF:30 VAAPI:true VAAPILowPower:true NVENC:false NVENCTemporalAQ:false NVENCScale:cuda UseTranspose:false ForceSwTranspose:false UseGopSize:false}
Fetched https://nc.xxx.xxx/index.php/apps/memories/static/go-vod?arch=x86_64 successfully!
2024/06/13 21:25:55 &{Version:0.2.5 Configured:false VersionMonitor:true Bind::47788 FFmpeg:/usr/local/bin/ffmpeg FFprobe:/usr/local/bin/ffprobe TempDir:/tmp/go-vod ChunkSize:3 LookBehind:3 GoalBufferMin:1 GoalBufferMax:4 StreamIdleTime:60 ManagerIdleTime:60 QF:0 VAAPI:false VAAPILowPower:false NVENC:false NVENCTemporalAQ:false NVENCScale: UseTranspose:false ForceSwTranspose:false UseGopSize:false}
2024/06/13 21:25:55 Starting go-vod 0.2.5 on :47788
2024/06/13 21:26:00 &{Version:0.2.5 Configured:true VersionMonitor:true Bind::47788 FFmpeg:/usr/local/bin/ffmpeg FFprobe:/usr/local/bin/ffprobe TempDir:/tmp/go-vod ChunkSize:3 LookBehind:3 GoalBufferMin:1 GoalBufferMax:4 StreamIdleTime:60 ManagerIdleTime:60 QF:30 VAAPI:true VAAPILowPower:true NVENC:false NVENCTemporalAQ:false NVENCScale:cuda UseTranspose:false ForceSwTranspose:false UseGopSize:false}
2024/06/13 21:26:01 anyghi1efdv0: new manager for /var/www/html/data/xxx/GH011076_1711207383541.MP4
2024/06/13 21:26:02 anyghi1efdv0-480p: stopping stream
2024/06/13 21:26:02 anyghi1efdv0-480p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/var/www/html/data/xxx/GH011076_1711207383541.MP4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=854:h=854" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/anyghi1efdv0-306555676/480p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/13 21:26:02 ffmpeg-error: [h264 @ 0x565426c77fc0] Failed to create decode context: 2 (resource allocation failed).
2024/06/13 21:26:02 ffmpeg-error: [h264 @ 0x565426c77fc0] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/13 21:26:02 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x565428375940] Failed to create processing pipeline context: 2 (resource allocation failed).
2024/06/13 21:26:02 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x565428375940] Failed to configure output pad on Parsed_scale_vaapi_2
2024/06/13 21:26:02 ffmpeg-error: Error reinitializing filters!
2024/06/13 21:26:02 ffmpeg-error: Failed to inject frame into filter network: Input/output error
2024/06/13 21:26:02 ffmpeg-error: Error while processing the decoded data for stream #0:0
2024/06/13 21:26:02 anyghi1efdv0-480p: ffmpeg exited with status: 1
2024/06/13 21:26:03 anyghi1efdv0-720p: stopping stream
2024/06/13 21:26:03 anyghi1efdv0-720p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/var/www/html/data/xxx/GH011076_1711207383541.MP4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=1280:h=1280" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/anyghi1efdv0-306555676/720p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/13 21:26:03 ffmpeg-error: [h264 @ 0x55558b754fc0] Failed to create decode context: 2 (resource allocation failed).
2024/06/13 21:26:03 ffmpeg-error: [h264 @ 0x55558b754fc0] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/13 21:26:04 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x55558ce52940] Failed to create processing pipeline context: 2 (resource allocation failed).
2024/06/13 21:26:04 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x55558ce52940] Failed to configure output pad on Parsed_scale_vaapi_2
2024/06/13 21:26:04 ffmpeg-error: Error reinitializing filters!
2024/06/13 21:26:04 ffmpeg-error: Failed to inject frame into filter network: Input/output error
2024/06/13 21:26:04 ffmpeg-error: Error while processing the decoded data for stream #0:0
2024/06/13 21:26:04 anyghi1efdv0-720p: ffmpeg exited with status: 1
2024/06/13 21:26:04 anyghi1efdv0-max: stopping stream
2024/06/13 21:26:04 anyghi1efdv0-max: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/var/www/html/data/xxx/GH011076_1711207383541.MP4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/anyghi1efdv0-306555676/max-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/13 21:26:04 ffmpeg-error: [h264 @ 0x557fa9801fc0] Failed to create decode context: 2 (resource allocation failed).
2024/06/13 21:26:04 ffmpeg-error: [h264 @ 0x557fa9801fc0] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/13 21:26:05 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x557faaeff8c0] Failed to create processing pipeline context: 2 (resource allocation failed).
2024/06/13 21:26:05 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x557faaeff8c0] Failed to configure output pad on Parsed_scale_vaapi_2
2024/06/13 21:26:05 ffmpeg-error: Error reinitializing filters!
2024/06/13 21:26:05 ffmpeg-error: Failed to inject frame into filter network: Input/output error
2024/06/13 21:26:05 ffmpeg-error: Error while processing the decoded data for stream #0:0
2024/06/13 21:26:05 anyghi1efdv0-max: ffmpeg exited with status: 1
2024/06/13 21:27:01 anyghi1efdv0-480p: stopping stream
2024/06/13 21:27:16 anyghi1efdv0-720p: stopping stream
2024/06/13 21:27:26 anyghi1efdv0-max: stopping stream
2024/06/13 21:28:26 anyghi1efdv0: destroying manager
2024/06/13 21:28:26 anyghi1efdv0-480p: stopping stream
2024/06/13 21:28:26 anyghi1efdv0-720p: stopping stream
2024/06/13 21:28:26 anyghi1efdv0-max: stopping stream
2024/06/13 21:31:12 anyghi1efdv0: new manager for /var/www/html/data/xxx/PXL_20240321_204643130.mp4
2024/06/13 21:31:12 anyghi1efdv0-480p: stopping stream
2024/06/13 21:31:12 anyghi1efdv0-480p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/var/www/html/data/xxx/PXL_20240321_204643130.mp4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=854:h=854" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/anyghi1efdv0-1790391735/480p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/13 21:31:13 ffmpeg-error: [hevc @ 0x561e7918f5c0] Failed to create decode context: 2 (resource allocation failed).
2024/06/13 21:31:13 ffmpeg-error: [hevc @ 0x561e7918f5c0] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/13 21:31:13 ffmpeg-error: [swscaler @ 0x561e7b058840] deprecated pixel format used, make sure you did set range correctly
2024/06/13 21:31:13 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x561e79c74e40] Failed to create processing pipeline context: 2 (resource allocation failed).
2024/06/13 21:31:13 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x561e79c74e40] Failed to configure output pad on Parsed_scale_vaapi_2
2024/06/13 21:31:13 ffmpeg-error: Error reinitializing filters!
2024/06/13 21:31:13 ffmpeg-error: Failed to inject frame into filter network: Input/output error
2024/06/13 21:31:13 ffmpeg-error: Error while processing the decoded data for stream #0:1
2024/06/13 21:31:13 ffmpeg-error: [aac @ 0x561e78f1c740] 2 frames left in the queue on closing
2024/06/13 21:31:14 anyghi1efdv0-480p: ffmpeg exited with status: 1
2024/06/13 21:31:14 anyghi1efdv0-720p: stopping stream
2024/06/13 21:31:14 anyghi1efdv0-720p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/var/www/html/data/xxx/PXL_20240321_204643130.mp4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=1280:h=1280" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/anyghi1efdv0-1790391735/720p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/13 21:31:15 ffmpeg-error: [hevc @ 0x5574d630b5c0] Failed to create decode context: 2 (resource allocation failed).
2024/06/13 21:31:15 ffmpeg-error: [hevc @ 0x5574d630b5c0] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/13 21:31:15 ffmpeg-error: [swscaler @ 0x5574d81d4840] deprecated pixel format used, make sure you did set range correctly
2024/06/13 21:31:15 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x5574d6df0e40] Failed to create processing pipeline context: 2 (resource allocation failed).
2024/06/13 21:31:15 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x5574d6df0e40] Failed to configure output pad on Parsed_scale_vaapi_2
2024/06/13 21:31:15 ffmpeg-error: Error reinitializing filters!
2024/06/13 21:31:15 ffmpeg-error: Failed to inject frame into filter network: Input/output error
2024/06/13 21:31:15 ffmpeg-error: Error while processing the decoded data for stream #0:1
2024/06/13 21:31:15 ffmpeg-error: [aac @ 0x5574d6098740] 2 frames left in the queue on closing
2024/06/13 21:31:16 anyghi1efdv0-720p: ffmpeg exited with status: 1
2024/06/13 21:31:16 anyghi1efdv0-max: stopping stream
2024/06/13 21:31:16 anyghi1efdv0-max: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/var/www/html/data/xxx/PXL_20240321_204643130.mp4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/anyghi1efdv0-1790391735/max-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/13 21:31:16 ffmpeg-error: [hevc @ 0x55d276e99800] Failed to create decode context: 2 (resource allocation failed).
2024/06/13 21:31:16 ffmpeg-error: [hevc @ 0x55d276e99800] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/13 21:31:17 ffmpeg-error: [swscaler @ 0x55d278d7ea40] deprecated pixel format used, make sure you did set range correctly
2024/06/13 21:31:17 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x55d27799b580] Failed to create processing pipeline context: 2 (resource allocation failed).
2024/06/13 21:31:17 ffmpeg-error: [Parsed_scale_vaapi_2 @ 0x55d27799b580] Failed to configure output pad on Parsed_scale_vaapi_2
2024/06/13 21:31:17 ffmpeg-error: Error reinitializing filters!
2024/06/13 21:31:17 ffmpeg-error: Failed to inject frame into filter network: Input/output error
2024/06/13 21:31:17 ffmpeg-error: Error while processing the decoded data for stream #0:1
2024/06/13 21:31:17 ffmpeg-error: [aac @ 0x55d276c43280] 2 frames left in the queue on closing
2024/06/13 21:31:18 anyghi1efdv0-max: ffmpeg exited with status: 1
2024/06/13 21:32:17 anyghi1efdv0-480p: stopping stream
2024/06/13 21:32:27 anyghi1efdv0-720p: stopping stream
2024/06/13 21:32:37 anyghi1efdv0-max: stopping stream

Feel free to ask for more debug logs. I am happy to help :)

major-mayer commented 1 month ago

So I tried to discover some differences between Jellyfin's usage of FFMPEG and Memories'. I was using QSV before in Jellyfin, but now switched to VAAPI and it's still working (at least for H264). Here is the command in Memories:

2024/06/17 15:02:24 9wwyug98adf0-480p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "xxx.mp4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=854:h=854" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/9wwyug98adf0-3572383653/480p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -

And here in Jellyfin:

MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -ss 00:07:54.000 -noaccurate_seek -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i file:"/xxx.avi" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -rc_mode VBR -b:v 4787848 -maxrate 4787848 -bufsize 9575696 -profile:v:0 high -sei -a53_cc -force_key_frames:0 "expr:gte(t,n_forced*3)" -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24" -codec:a:0 libfdk_aac -ac 2 -ab 256000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "84dc08317b85632aca45044e95c7d373-1.mp4" -start_number 158 -hls_segment_filename "/cache/transcodes/84dc08317b85632aca45044e95c7d373%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/cache/transcodes/84dc08317b85632aca45044e95c7d373.m3u8"

In the case of Jellyfin, I don't get this [swscaler @ 0x561e7b058840] deprecated pixel format used, make sure you did set range correctly error/ warning, so I guess there is something wrong with format=nv12:w=854:h=854.

Also, I have a cleaner log go-vod now, that is not as polluted with hardware initialization/ resource allocation errors:

2024/06/17 15:02:05 Starting go-vod 0.2.5 on :47788
2024/06/17 15:02:23 &{Version:0.2.5 Configured:true VersionMonitor:true Bind::47788 FFmpeg:/usr/local/bin/ffmpeg FFprobe:/usr/local/bin/ffprobe TempDir:/tmp/go-vod ChunkSize:3 LookBehind:3 GoalBufferMin:1 GoalBufferMax:4 StreamIdleTime:60 ManagerIdleTime:60 QF:30 VAAPI:true VAAPILowPower:true NVENC:false NVENCTemporalAQ:false NVENCScale:cuda UseTranspose:false ForceSwTranspose:false UseGopSize:false}
2024/06/17 15:02:24 9wwyug98adf0: new manager for /xxx.mp4
2024/06/17 15:02:24 9wwyug98adf0-480p: stopping stream
2024/06/17 15:02:24 9wwyug98adf0-480p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/xxx.mp4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=854:h=854" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/9wwyug98adf0-3572383653/480p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/17 15:02:24 ffmpeg-error: [h264 @ 0x55e3358e6f40] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/17 15:02:24 ffmpeg-error: [swscaler @ 0x55e338b618c0] deprecated pixel format used, make sure you did set range correctly
2024/06/17 15:02:24 ffmpeg-error: [swscaler @ 0x55e338ed78c0] deprecated pixel format used, make sure you did set range correctly
2024/06/17 15:02:35 9wwyug98adf0-720p: stopping stream
2024/06/17 15:02:35 9wwyug98adf0-720p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/xxx.mp4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=1280:h=1280" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/9wwyug98adf0-3572383653/720p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/17 15:02:35 ffmpeg-error: [h264 @ 0x557596658f40] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/17 15:02:35 ffmpeg-error: [swscaler @ 0x5575998d38c0] deprecated pixel format used, make sure you did set range correctly
2024/06/17 15:02:35 ffmpeg-error: [swscaler @ 0x557599c498c0] deprecated pixel format used, make sure you did set range correctly
2024/06/17 15:02:46 9wwyug98adf0-1080p: stopping stream
2024/06/17 15:02:46 9wwyug98adf0-1080p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/xxx.mp4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=1920:h=1920" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/9wwyug98adf0-3572383653/1080p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/17 15:02:46 ffmpeg-error: [h264 @ 0x555d8d871f40] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/17 15:02:46 ffmpeg-error: [swscaler @ 0x555d90aec8c0] deprecated pixel format used, make sure you did set range correctly
2024/06/17 15:02:46 ffmpeg-error: [swscaler @ 0x555d90e628c0] deprecated pixel format used, make sure you did set range correctly
2024/06/17 15:02:57 9wwyug98adf0-1440p: stopping stream
2024/06/17 15:02:57 9wwyug98adf0-1440p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "/xxx.mp4" -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=2560:h=2560" -map "0:v:0" "-c:v" h264_vaapi -global_quality 30 -low_power 1 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/9wwyug98adf0-3572383653/1440p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/06/17 15:02:57 ffmpeg-error: [h264 @ 0x55c0b61cdf40] Failed setup for format vaapi: hwaccel initialisation returned error.
2024/06/17 15:02:57 ffmpeg-error: [swscaler @ 0x55c0b94488c0] deprecated pixel format used, make sure you did set range correctly
2024/06/17 15:02:57 ffmpeg-error: [swscaler @ 0x55c0b97be8c0] deprecated pixel format used, make sure you did set range correctly
2024/06/17 15:03:24 9wwyug98adf0-480p: stopping stream
2024/06/17 15:03:24 9wwyug98adf0-480p: ffmpeg exited with status: -1
2024/06/17 15:03:34 9wwyug98adf0-720p: stopping stream
2024/06/17 15:03:44 9wwyug98adf0-1080p: stopping stream
2024/06/17 15:03:54 9wwyug98adf0-1440p: stopping stream
2024/06/17 15:04:54 9wwyug98adf0: destroying manager
2024/06/17 15:04:54 9wwyug98adf0-720p: stopping stream
2024/06/17 15:04:54 9wwyug98adf0-1080p: stopping stream
2024/06/17 15:04:54 9wwyug98adf0-1440p: stopping stream
2024/06/17 15:04:54 9wwyug98adf0-480p: stopping stream
2024/06/17 15:04:54 9wwyug98adf0-max: stopping stream
2024/06/17 15:16:56 &{Version:0.2.5 Configured:true VersionMonitor:true Bind::47788 FFmpeg:/usr/local/bin/ffmpeg FFprobe:/usr/local/bin/ffprobe TempDir:/tmp/go-vod ChunkSize:3 LookBehind:3 GoalBufferMin:1 GoalBufferMax:4 StreamIdleTime:60 ManagerIdleTime:60 QF:30 VAAPI:false VAAPILowPower:true NVENC:false NVENCTemporalAQ:false NVENCScale:cuda UseTranspose:false ForceSwTranspose:false UseGopSize:false}
pulsejet commented 1 month ago

[swscaler @ 0x561e7b058840] deprecated pixel format used, make sure you did set range correctly

This is a harmless warning. It still seems to be unable to initialize the hardware.

go-vod actually uses the same image as jellyfin, but maybe it isn't new enough. I'd check if there's any difference in the way the device gets mounted to the container; no experience with this.

major-mayer commented 1 month ago

Hmm okay, then I don't know where the error comes from...

My config for Jellyfin and for Memories looks pretty much the same:

services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    network_mode: "host"
    user: 1000:1000
    volumes:
      - /mnt/data/jellyfin/config:/config
      - /mnt/data/jellyfin/cache:/cache
      - /mnt/data/filme:/media:ro
    devices:      
      - /dev/dri/renderD128:/dev/dri/renderD128
    restart: "unless-stopped"
    environment:
      - JELLYFIN_PublishedServerUrl=https://jellyfin.example
     ports: 
      - 8096:8096/tcp
      - 1900:1900/udp
      - 7359:7359/udp
    group_add:
      - "107"
services:
  go-vod:
    image: radialapps/go-vod
    init: true
    restart: "unless-stopped"
    environment:
      - NEXTCLOUD_HOST=https://nc.example
    devices:
      - /dev/dri/renderD128:/dev/dri/renderD128
    volumes:
      - /mnt/data/ncfpm:/var/www/html:ro
    group_add:
      - "107"
    ports: 
      - 47788:47788

One thing that i noticed, is that Memories (1st) creates a different "type of load" (?) when observing it with intel_gpu_top than Jellyfin (2nd) and my GPU doesn't seem to be able to handle this one: grafik grafik

So maybe the container image is too old indeed.