docs: hw transcoding update

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/880/head
Varun Patil 2023-10-18 23:14:35 -07:00
parent 25fee175d8
commit 1b1400babc
1 changed files with 11 additions and 7 deletions

View File

@ -12,7 +12,7 @@ Newer Intel processors come with a feature called QuickSync that can significant
Note: VA-API acceleration may also work with some AMD GPUs.
To configure VAAPI, you need to have `/dev/dri` available to the Nextcloud instance with the `www-data` in the group owning the drivers. You also need the correct drivers and a compatible version of ffmpeg installed (some older versions of ffmpeg are not compatible with modern hardware).
To configure VAAPI, you need to have `/dev/dri` available to the Nextcloud instance with the `www-data` in the group owning the drivers. You also need the correct drivers and a compatible version of ffmpeg installed (older versions may not work with modern hardware).
NVIDIA GPUs support hardware transcoding using NVENC.
@ -30,7 +30,7 @@ NVIDIA GPUs support hardware transcoding using NVENC.
The easiest and recommended way to use hardware transcoding in a docker environment is to use an external transcoder.
This setup utilizes a separate docker container that contains the hardware drivers and ffmpeg.
If you cannot use an external docker container, other installation methods are also possible (see below).
If you cannot do this, other installation methods are also possible (see below).
[go-vod](https://github.com/pulsejet/go-vod), the transcoder of Memories, ships with a Dockerfile that already includes the latest ffmpeg and VA-API drivers. To set up an external transcoder, follow these steps.
@ -113,9 +113,9 @@ Memories ships with an internal transcoder binary that you can directly use. In
### Bare Metal
If you are running Nextcloud on bare metal, you can install the drivers and ffmpeg directly on the host. If you are running nextcloud in a Virtual Magine or LXC container configuration, you will also need to pass through the hardware resource to the nextcloud machine. Some guides that may help with this: [Proxmox VM](https://pve.proxmox.com/wiki/PCI_Passthrough) / [LXC Container](https://gist.github.com/packerdl/a4887c30c38a0225204f451103d82ac5?permalink_comment_id=4471564).
If you are running Nextcloud on bare metal, you can install the drivers and ffmpeg directly on the host. If you are running nextcloud in a Virtual Magine or LXC container configuration, you will also need to pass through the hardware resource to the nextcloud machine. Some helpful guides can be found for [Proxmox VM](https://pve.proxmox.com/wiki/PCI_Passthrough) / [LXC Container](https://gist.github.com/packerdl/a4887c30c38a0225204f451103d82ac5?permalink_comment_id=4471564).
On the nextcloud machine, you need to make sure that the `www-data` user has access to the drivers. You can do this by adding the `www-data` user to the appropriate groups.
On the Nextcloud machine, you need to make sure that the `www-data` user has access to the `/dev/dri` devices. You can do this by adding the `www-data` user to the appropriate groups.
```bash
## Ubuntu
@ -135,9 +135,11 @@ sudo chmod 666 /dev/dri/renderD128
```
You can run a test using a sample video file to check if VA-API is working correctly for the `www-data` user:
Note: It may be best to run the following test from within your nextcloud data directory (often located at `/mnt/ncdata/<user>/files/)
```bash
# It may be best to run the following test from within your
# Nextcloud data directory (e.g. /mnt/ncdata/<user>/files/)
# download sample or or use any other video file
wget https://github.com/pulsejet/memories-assets/raw/main/sample.mp4
chown www-data:www-data sample.mp4
@ -149,9 +151,9 @@ sudo -u www-data \
output-www-data.mp4
```
!!! tip "Beware of old FFMPEG and driver versions"
!!! warning "Beware of old ffmpeg and driver versions"
In some cases, package repositories may distribute old ffmpeg versions that do not support some modern hardware (For example, the available version of the media driver for the current debian image used by Nextcloud only supports up to the 10th generation Intel Ice Lake CPUs). To ensure you have a compatible version, you may want to remove your existing ffmpeg version and build the drivers and `ffmpeg` from source. [This script](https://github.com/pulsejet/go-vod/blob/master/build-ffmpeg.sh) for VA-API or [this one](https://github.com/pulsejet/go-vod/blob/master/build-ffmpeg-nvidia.sh) for NVENC might be useful.
Some package repositories distribute old ffmpeg versions that do not support some modern hardware. (e.g., the VA-API driver installed by `apt` in the current debian image used by Nextcloud only supports up to 10th generation Intel Ice Lake CPUs). To ensure you have a compatible version, you may want to remove your existing ffmpeg version and build the drivers and ffmpeg from source. [This script](https://github.com/pulsejet/go-vod/blob/master/build-ffmpeg.sh) for VA-API or [this one](https://github.com/pulsejet/go-vod/blob/master/build-ffmpeg-nvidia.sh) for NVENC might be useful.
### Docker
@ -223,6 +225,8 @@ If you have trouble with trancoding, try the following steps:
1. If you are using the internal transcoder, make sure you are running a new enough version of ffmpeg (shown in the admin panel). Generally you would need at least ffmpeg v5.x for most modern hardware but many operating systems ship with v4.x. One troubleshooting step is to build ffmpeg and the hardware drivers from source.
1. It may be helpful to run a manual test of ffmpeg in the same environment as the transcoder. See [above](#bare-metal) for instructions. Note that the transcoder output / logs contain the full ffmpeg command used for each transcode.
### Logging
When running an **external transcoder**, the logs go to the container's stdout. You can view them using