Saltar a contenido

Hardware Acceleration

You can use hardware acceleration with custom ffmpeg stream profiles. This will require mapping your hardware to the container and setting up a custom ffmpeg stream profile.

Mapping Hardware

Example
services:
  dispatcharr:
    # build:
    #   context: .
    #   dockerfile: Dockerfile
    image: ghcr.io/dispatcharr/dispatcharr:latest
    container_name: dispatcharr
    ports:
      - 9191:9191
    volumes:
      - dispatcharr_data:/data
    environment:
      - DISPATCHARR_ENV=aio
      - REDIS_HOST=localhost
      - CELERY_BROKER_URL=redis://localhost:6379/0
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
volumes:
  dispatcharr_data:
  • Add a devices section to your docker-compose.yml
Example
services:
  dispatcharr:
    # build:
    #   context: .
    #   dockerfile: Dockerfile
    image: ghcr.io/dispatcharr/dispatcharr:latest
    container_name: dispatcharr
    ports:
      - 9191:9191
    volumes:
      - dispatcharr_data:/data
    environment:
      - DISPATCHARR_ENV=aio
      - REDIS_HOST=localhost
      - CELERY_BROKER_URL=redis://localhost:6379/0
    devices:
      - /dev/dri:/dev/dri

volumes:
  dispatcharr_data:
  • Install the NVIDIA Driver Package plugin from community apps if not already installed
  • Edit the Dispatcharr docker container in Unraid
    • Toggle Advanced View On
    • Go to Extra Parameters
      • Add --runtime=nvidia
    • Scroll down and click "Add another Path, Port, Variable, Label or Device"
      • Config Type: Variable
      • Name: NVIDIA_VISIBLE_DEVICES
      • Key: NVIDIA_VISIBLE_DEVICES
      • Value: all
    • Click Save
    • Again click "Add another Path, Port, Variable, Label or Device"
      • Config Type: Variable
      • Name: NVIDIA_DRIVER_CAPABILITIES
      • Key: NVIDIA_DRIVER_CAPABILITIES
      • Value: all
    • Click Save
  • Edit the Dispatcharr docker container in Unraid
  • Scroll down and click "Add another Path, Port, Variable, Label or Device"
    • Config Type: Device
    • Name: /dev/dri
    • Key: /dev/dri
    • Description: Intel GPU
  • Click Save

Custom Stream Profiles

  • Open Dispatcharr
  • Navigate to Settings > Add Stream Profile

    • Name it anything you like
    • Command ffmpeg
    • Parameters will vary based on your hardware type and streaming needs
    • Visit our discord for more user-submitted ffmpeg parameters

    Example

    • Parameters: -user_agent {userAgent} -hwaccel cuda -i {streamUrl} -c:v h264_nvenc -c:a copy -f mpegts pipe:1

    Example

    • Parameters: -user_agent {userAgent} -hwaccel vaapi -hwaccel_output_format vaapi -hwaccel_device /dev/dri/renderD128 -i {streamUrl} -c:a aac -c:v h264_vaapi -f mpegts pipe:1

    Example

    • Parameters: -hwaccel qsv -user_agent {userAgent} -i {streamUrl} -c:v h264_qsv -c:a aac -f mpegts pipe:1