linuxserver / docker-documentation

The repo behind...
https://docs.linuxserver.io
GNU General Public License v3.0
172 stars 29 forks source link

My fix for HW encoding. Symlink for ffmpeg. #246

Closed blumoreno closed 2 months ago

blumoreno commented 2 months ago

I am running the latest version at this time, running docker compose in Ubuntu with a GTX1080. I had trouble getting HW encoding working and hope my solution could be added to the official image.

When running ffmpeg -version inside the container, I got "ffmpeg: command not found", but I know it is included with the image. I found the location of ffmpeg with find / -name ffmpeg 2>/dev/null

ffmpeg was in /usr/lib/jellyfin-ffmpeg/ffmpeg but not where is should be: /usr/bin/ffmpeg My resolution was creating a symlink by running ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/bin/ffmpeg

My jellyfin is now successfully transcoding, and nvidia-smi on the host shows ffmpeg in GPU utilization.

My docker compose:

---
services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    runtime: nvidia
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
      - NVIDIA_VISIBLE_DEVICES=all
      - JELLYFIN_PublishedServerUrl=redacted
    volumes:
      - /home/mikey/docker/jellyfin/library:/config
      - /mnt/media/Shows:/data/tvshows
      - /mnt/media/Movies:/data/movies
      - /dev/dri:/dev/dri
    ports:
      - 8096:8096
      - 8920:8920 #optional
      - 7359:7359/udp #optional
      - 1902:1900/udp #optional
    restart: unless-stopped
aptalca commented 2 months ago

This is not the correct repo.