From 8cb09cf9e88d529d5d0e46a756cafc0fca243993 Mon Sep 17 00:00:00 2001 From: MeIchthys Date: Tue, 17 Oct 2023 16:06:43 -0400 Subject: [PATCH 1/2] Clarify need for updated ffmpeg version Also add bare-metal helpful links/notes for VM/Container use cases. --- docs/hw-transcoding.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/hw-transcoding.md b/docs/hw-transcoding.md index e7e761bf..246d9724 100644 --- a/docs/hw-transcoding.md +++ b/docs/hw-transcoding.md @@ -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. +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). NVIDIA GPUs support hardware transcoding using NVENC. @@ -28,7 +28,7 @@ NVIDIA GPUs support hardware transcoding using NVENC. !!! success "Recommmended Configuration" - The easiest and recommended way to use hardware transcoding is to use an external transcoder. + 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). @@ -99,7 +99,7 @@ You can specify the image to build in the `docker-compose.yml` file. ## Internal Transcoder -Memories ships with an internal transcoder binary that you can directly use. In this case, you must install the drivers and ffmpeg on the same host as Nextcloud, and Memories will automatically handling starting and communicating with go-vod. This is also the default setup when you enable transcoding without hardware acceleration. +Memories ships with an internal transcoder binary that you can directly use. In this case, you must install the drivers and ffmpeg on the same host as Nextcloud, and Memories will automatically handle starting and communicating with go-vod. This is also the default setup when you enable transcoding without hardware acceleration. !!! danger "Advanced usage only" @@ -113,7 +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. 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. +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). + +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. ```bash ## Ubuntu @@ -133,6 +135,7 @@ 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//files/) ```bash # download sample or or use any other video file @@ -146,7 +149,9 @@ sudo -u www-data \ output-www-data.mp4 ``` -In some cases, you may need to build the drivers and `ffmpeg` from source. For example, the available version of the media driver for the current debian image used by Nextcloud only supports upto Ice Lake CPUs. [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. +!!! tip "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. ### Docker From 1b1400babc05dc299f23d9c6983caf8348547377 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 18 Oct 2023 23:14:35 -0700 Subject: [PATCH 2/2] docs: hw transcoding update Signed-off-by: Varun Patil --- docs/hw-transcoding.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/hw-transcoding.md b/docs/hw-transcoding.md index 246d9724..86862e53 100644 --- a/docs/hw-transcoding.md +++ b/docs/hw-transcoding.md @@ -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//files/) ```bash +# It may be best to run the following test from within your +# Nextcloud data directory (e.g. /mnt/ncdata//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