So this ffmpeg was built with support for QSV and VAAPI. It does not mean that the server offers also the resources required to use it (namely /dev/dri).
To create a plugin for hardware-accelarated ffmpeg profiles, the starting point would be Théo Le Calvar / peertube-plugin-hardware-transcode-vaapi · GitLab . A year ago, the author tried to generate those ffmpeg options programatically, but the development seemed to be stalled.
This plugin itself is quite crude, but it works and is a very good starting point to any further development. It would be nice to have it as native feature of peertube. Last time I’ve checked it didn’t receive any updates for the last 2 years.
I’m the author of the plugin. As is it should be considered experimental but it worked OK on my hardware (which was equipped with a Intel i5-6500T cpu).
I know a few bugs that I could not fix with the plugin API at the time. It was related to source files that were not compatible with my hardware (the CPU I have cannot hardware decode h265 or av1 files) and I was not able to detect these files with the plugin API at the time (see this issue) so these tasks would fail and Peertube would not try them agin on another profile. I planned to make the feature and update my plugin accordingly but I didn’t find the time with my new job.
I think that once the issue linked above is solved it should not be too hard to update the plugin to check if the input file is compatible with the hardware and accept the transcode task.
The instructions say > Official docker images do not ship with required libraries for hardware transcode.
You can build your own image with this docker compose:< But what immediately follows looks like a Dockerfile, not a docker compose file. A little further down it shows what looks like a docker compose file but it references the regular peertube image, not a built or to be built Docker image. Can someone clarify this a bit?
I updated the readme with newer Dockerfile & the partial docker-compose.yml that I use. The docker-compose.yml expects the Dockerfile to be present in the same directory.
You can browse to the the admin page of Peertube then Configuration > VOD Transcoding > Transcoding Profile at the end of the page. If the plugin is correctly installed you should see a « vaapi » profile.
Selecting it and updating the configuration should be enough to switch to the profile and use hardware acceleration.
You can do something similar for « Live Streaming » if you also want to use the profile for streams.
Ah yes. I didn’t see a vaapi option in that menu when I first logged in but later on it did appear. That said, I can’t get any uploaded videos to actually play, regardless of the setting. I just get the grey spinning circle. I DO see the generated thumbnail.
You should check transcode jobs status in Admin > System > Jobs. You can filter them by selecting « video-transcode » in Job Type.
If they fail you should have access to logs detailing the error.
I looked at your updated instructions and my Dockerfile was far more complicated. So I decided to start over and build the image fresh. Now I’m getting a error.
"err": {
"stack": "Error: ffmpeg exited with code 1: Device creation failed: -22.\nFailed to set value '/dev/dri/renderD128' for option 'vaapi_device': Invalid argument\nError parsing global options: Invalid argument\n\n at ChildProcess.<anonymous> (/app/node_modules/fluent-ffmpeg/lib/processor.js:182:22)\n at ChildProcess.emit (node:events:513:28)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)",
"message": "ffmpeg exited with code 1: Device creation failed: -22.\nFailed to set value '/dev/dri/renderD128' for option 'vaapi_device': Invalid argument\nError parsing global options: Invalid argument\n"
}
I’m using a Q1-17 xeon processor that I believe corresponds with a Gen 7. Intel® HD Graphics P630