Nextcloud Snap VA-API Hardware Acceleration Memories App Help

Nextcloud version: 27.1.7
Operating system and version: Ubuntu 22.04.4 LTS
Apache or nginx version: unsure (bundled with snap)
PHP version: unsure (bundled with snap)

The issue you are facing: I’m not sure how to enable hardware acceleration in the Nextcloud Snap. I tried installing the drivers as described here, but it didn’t seem to help. Is there any documentation on how to enable this with the snap package, or is this something that needs to be bundled with the snap?

Is this the first time you’ve seen this error? No

Steps to replicate it:

  1. Install the Nextcloud Memories App to Nextcloud Snap
  2. Check the “Enable Acceleration with VA-API” in the Memories app settings
  3. Attempt to play a video in Memories

The output of your Nextcloud log in Admin > Logging:

Error	memories	Transcode failed: Transcoder returned 408		2024-03-11T23:04:00-0400
Error	memories	Transcode failed: Transcoder returned 408		2024-03-11T23:03:50-0400
Error	memories	Transcode failed: Transcoder returned 408		2024-03-11T23:03:43-0400
Error	memories	Transcode failed: Transcoder returned 408		2024-03-11T23:03:33-0400
Error	memories	Transcode failed: Transcoder returned 408		2024-03-11T23:03:22-0400
Error	memories	Transcode failed: Transcoder returned 408		2024-03-11T23:03:22-0400

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php  
$CONFIG = array (  
'apps_paths' =>  
array (  
0 =>  
array (  
'path' => '/snap/nextcloud/current/htdocs/apps',  
'url' => '/apps',  
'writable' => false,  
),  
1 =>  
array (  
'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',  
'url' => '/extra-apps',  
'writable' => true,  
),  
),  
'supportedDatabases' =>  
array (  
0 => 'mysql',  
),  
'memcache.locking' => '\\OC\\Memcache\\Redis',  
'memcache.local' => '\\OC\\Memcache\\Redis',  
'redis' =>  
array (  
'host' => '/tmp/sockets/redis.sock',  
'port' => 0,  
),  
'log_type' => 'file',  
'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',  
'logfilemode' => 416,  
'passwordsalt' => '[REDACTED]',  
'secret' => '[REDACTED]',  
'trusted_domains' =>  
array (  
0 => 'localhost',  
1 => '[REDACTED]',  
2 => '[REDACTED]',  
),  
'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',  
'dbtype' => 'mysql',  
'version' => '27.1.4.1',  
'overwrite.cli.url' => 'http://localhost',  
'dbname' => 'nextcloud',  
'dbhost' => 'localhost:/tmp/sockets/mysql.sock',  
'dbport' => '',  
'dbtableprefix' => 'oc_',  
'mysql.utf8mb4' => true,  
'dbuser' => 'nextcloud',  
'dbpassword' => '[REDACTED]',  
'installed' => true,  
'instanceid' => '[REDACTED]',  
'maintenance' => false,  
'loglevel' => 2,  
'theme' => '',  
'memories.exiftool' => '/var/snap/nextcloud/38457/nextcloud/extra-apps/memories/bin-ext/exiftool-amd64-glibc',  
'memories.vod.path' => '/var/snap/nextcloud/38457/nextcloud/extra-apps/memories/bin-ext/go-vod-amd64',  
'memories.gis_type' => 1,  
'memories.ffmpeg_path' => '/var/snap/nextcloud/bin/ffmpeg',  
'memories.ffprobe_path' => '/var/snap/nextcloud/bin/ffprobe',  
'ffmpeg' => '/var/snap/nextcloud/bin/ffmpeg',  
'enabledPreviewProviders' =>  
array (  
0 => 'OC\\Preview\\Movie',  
1 => 'OC\\Preview\\Image',  
),  
'memories.vod.ffmpeg' => '/var/snap/nextcloud/bin/ffmpeg',  
'memories.vod.ffprobe' => '/var/snap/nextcloud/bin/ffprobe',  
'memories.vod.vaapi.low_power' => true,  
);
1 Like

Snap is a nightmare, I just recommend Docker if you need to do anything non-trivial

1 Like

I actually had the same thought and tried this with Nextcloud AIO and it worked. However, unfortunately, it flips the video sideways when VAAPI is enabled, and the official workaround does not work because my CPU is too old to support transposing. But at least I know how to get it working once I upgrade.

1 Like

Didnt’ know this was a thing. Probably won’t help but it might be worth a shot to try the external transcoder docker image if you’re not using that; it has a newer version of ffmpeg which might work …

1 Like

Yeah, I was using the community container for memories.

I thought that here you were implying that older intel CPUs would not support transposing, but maybe I misunderstood. These are the logs I’m getting in the memories container with VAAPI and the transpose workaround enabled:

2024/03/20 19:58:18 d674hxp71lf0-max: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -noautorotate -i /mnt/ncdata/admin/files/Photos/PXL_20240301_184347722.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12,transpose_vaapi=1" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -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/d674hxp71lf0-3173730601/max-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/03/20 19:58:18 ffmpeg-error: [AVHWDeviceContext @ 0x55a2d6ab3200] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed
2024/03/20 19:58:19 ffmpeg-error: [Parsed_transpose_vaapi_3 @ 0x55a2d91a2000] VAAPI driver doesn't support transpose
2024/03/20 19:58:19 ffmpeg-error: [Parsed_transpose_vaapi_3 @ 0x55a2d91a2000] Failed to configure output pad on Parsed_transpose_vaapi_3
2024/03/20 19:58:19 ffmpeg-error: Error reinitializing filters!
2024/03/20 19:58:19 ffmpeg-error: Failed to inject frame into filter network: Invalid argument
2024/03/20 19:58:19 ffmpeg-error: Error while processing the decoded data for stream #0:2
2024/03/20 19:58:19 d674hxp71lf0-max: ffmpeg exited with status: 1

I just realized though that a different video (a screen recording) works just fine with transpose. Not sure what’s going on:

2024/03/20 20:00:57 d674hxp71lf0-max: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -noautorotate -i /mnt/ncdata/admin/files/Photos/screen-20240320-083744.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 24 -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/d674hxp71lf0-4089083534/max-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/03/20 20:00:57 ffmpeg-error: [AVHWDeviceContext @ 0x556b0dd6f680] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed
2024/03/20 20:00:57 ffmpeg-error: [mpegts @ 0x556b0f181340] Packets poorly interleaved, failed to avoid negative timestamp -57910 in stream 0.
2024/03/20 20:00:57 ffmpeg-error: Try -max_interleave_delta 0 as a possible workaround.
2024/03/20 20:00:57 d674hxp71lf0-max: recv max-000000.ts
2024/03/20 20:00:57 d674hxp71lf0-max: recv max-000001.ts
2024/03/20 20:00:57 d674hxp71lf0-max: recv max-000002.ts
2024/03/20 20:00:58 d674hxp71lf0-max: recv max-000003.ts
2024/03/20 20:00:58 d674hxp71lf0-max: recv max-000004.ts
2024/03/20 20:00:58 d674hxp71lf0-max: goal satisfied: 4
2024/03/20 20:00:58 d674hxp71lf0-max: resuming transcoding
2024/03/20 20:00:58 d674hxp71lf0-max: recv max-000005.ts
2024/03/20 20:00:58 d674hxp71lf0-max: recv max-000006.ts
2024/03/20 20:00:58 d674hxp71lf0-max: recv max-000007.ts
2024/03/20 20:00:59 d674hxp71lf0-max: recv max-000008.ts
2024/03/20 20:00:59 d674hxp71lf0-max: goal satisfied: 8
2024/03/20 20:00:59 d674hxp71lf0-max: resuming transcoding
2024/03/20 20:00:59 d674hxp71lf0-max: recv max-000009.ts
2024/03/20 20:00:59 d674hxp71lf0-max: recv max-000010.ts
2024/03/20 20:00:59 d674hxp71lf0-max: recv max-000011.ts
2024/03/20 20:00:59 d674hxp71lf0-max: recv max-000012.ts
2024/03/20 20:00:59 d674hxp71lf0-max: goal satisfied: 12
1 Like

oh it looks like transpose is never needed for the second video - if I disable it, the video plays at the correct orientation.

1 Like

That seems pretty explicit then, looks like no fix here :frowning:

1 Like

Unfortunate. Thank you anyway for your time and advice!

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.