Ranbato / nextpvr-ccextractor

Custom build of NextPVR docker container
3 stars 1 forks source link

how to enable vaapi in nas? #2

Closed chminsc closed 5 months ago

chminsc commented 6 months ago

thanks

Ranbato commented 5 months ago

You just need to give access to the hardware on your host. You may have to give the Docker engine user access to the /dev/dri folder.

Here is a compose example:

    image: marklambert/nextpvr-ccextractor:latest
    container_name: nextpvr
    networks:
      - services
    environment:
      HOST_IP: "192.168.5.1"
    volumes:
      - /volume/config/nextpvr:/config
      - /volume/video/nextpvr/recordings:/recordings
      - /volume/video/nextpvr/buffer:/buffer
      - /volume/video/Video:/kodi
    ports:
      - 8866:8866
      - 8020-8030:8020-8030/udp
      - 16891:16891/udp
    devices:
      - /dev/dri:/dev/dri
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8866/login.html"]
      interval: 2m29s
      timeout: 20s
      retries: 3
      start_period: 41s
    env_file:
      - ./.env

Then your command would look something like:


ffmpeg -y \
  -loglevel info \
  -init_hw_device vaapi=foo:/dev/dri/renderD128 \
  -hwaccel vaapi \
  -hwaccel_device foo \
  -hwaccel_output_format vaapi \
  -i "$1" \
  -f matroska \
  -filter_hw_device foo \
  -vf 'format=nv12|vaapi,hwupload,deinterlace_vaapi' \
   -c:v h264_vaapi \
   -preset slower \
   -profile:v 100 \
   -rc_mode 1 \
   -quality 1 \
   -b_depth 2 \
   -bf 3 \
   -qp 20 \
  -c:a copy \
  -c:s copy \
  "$outputFull"
chminsc commented 5 months ago

thanks guy. i already mapped the device, succeed. i failed using the official docker image. i think its because of ffmpeg version. your version works well