linuxserver / docker-jellyfin

GNU General Public License v3.0
630 stars 94 forks source link

ffmpeg/ffprobe: undefined symbol: drmModeGetFB2 #143

Closed kura closed 2 years ago

kura commented 2 years ago

linuxserver.io


Expected Behavior

When running /usr/lib/jellyfin-ffmpeg/(ffmpeg|ffprobe) the binary should exit cleanly.

Current Behavior

When running either ffmpeg or ffprobe an error occurs due to an undefined symbol: drmModeGetFB2 as below

/usr/lib/jellyfin-ffmpeg/ffprobe: symbol lookup error: /usr/lib/jellyfin-ffmpeg/ffprobe: undefined symbol: drmModeGetFB2

Steps to Reproduce

  1. Install latest jellyfin docker image
  2. Run /usr/lib/jellyfin-ffmpeg/ffmpeg

Environment

OS: Ubuntu 20.04 CPU architecture: x86_64 How docker service was installed: apt installed docker from official docker ppa

Command used to create docker container (run/create/compose/screenshot)

docker-compose

version: '3'
services:
  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    devices:
      - /dev/nvidia0:/dev/nvidia0
      - /dev/nvidiactl:/dev/nvidiactl
      - /dev/nvidia-uvm:/dev/nvidia-uvm
    environment:
      - PUID=0
      - PGID=0
      - TZ=Europe/London
      - VERSION=docker
      - NVIDIA_VISIBLE_DEVICES="all"
      - NVIDIA_DRIVER_CAPABILITIES="all"
      - LD_LIBRARY_PATH="/usr/lib/jellyfin-ffmpeg/lib:/usr/local/cuda/lib64:/usr/local/nvidia/lib64"
    ports:
      - 80:80
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /usr/local/nvidia:/usr/local/nvidia
      - /usr/local/cuda:/usr/local/cuda
      - /share/containers/jellyfin:/config
      - /share/public/movies:/media/movies 
      - /share/public/tv:/media/tv
      - /share/public/music:/media/music
      - type: tmpfs
        target: /transcode
        tmpfs:
          size: 26000000000

Docker logs

The only real pertinent logs around this show ffprobe failing


System.Text.Json.JsonException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
 ---> System.Text.Json.JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.
   at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
   at System.Text.Json.Utf8JsonReader.Read()
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   --- End of inner exception stack trace ---
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](JsonReaderState& readerState, Boolean isFinalBlock, ReadOnlySpan`1 buffer, JsonSerializerOptions options, ReadStack& state, JsonConverter converterBase)
   at System.Text.Json.JsonSerializer.ReadAsync[TValue](Stream utf8Json, Type returnType, JsonSerializerOptions options, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.GetMediaInfoInternal(String inputPath, String primaryPath, MediaProtocol protocol, Boolean extractChapters, String probeSizeArgument, Boolean isAudio, Nullable`1 videoType, Boolean forceEnableLogging, CancellationToken cancellationToken)
   at MediaBrowser.Providers.MediaInfo.FFProbeVideoInfo.ProbeVideo[T](T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.RunCustomProvider(ICustomMetadataProvider`1 provider, TItemType item, String logName, MetadataRefreshOptions options, RefreshResult refreshResult, CancellationToken cancellationToken)```
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

aptalca commented 2 years ago

You have way too many extra stuff in your docker arguments. Remove everything that we don't list in our compose sample, except for the media volumes.

kura commented 2 years ago

You have way too many extra stuff in your docker arguments. Remove everything that we don't list in our compose sample, except for the media volumes.

Doing that disables hardware acceleration.

aptalca commented 2 years ago

Well, that's not our recommended or supported method of enabling nvidia hw acceleration. So if you choose to go that route, we can't provide support.

In any case, ffmpeg is provided by the upstream project, so you can ask them about it, but they'll probably say the same thing.

quietsy commented 2 years ago

I also have nvidia with hardware acceleration, couldn't reproduce your issue with this compose:

  jellyfin:
    image: lscr.io/linuxserver/jellyfin
    container_name: jellyfin
    volumes:
      - ${APPSDIR}/jellyfin:/config
      - ${DATADIR}/media:/mnt/media
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=all
    runtime: nvidia
    devices:
      - /dev/dri:/dev/dri
kura commented 2 years ago

No worries, I guess I'll forgo hardware acceleration for now since without the LD_LIBRARY_PATH stuff, even with runtime: nvidia hardware acceleration does not work.

quietsy commented 2 years ago

Make sure that you have nvidia drivers installed on the host, then add the nvidia docker repository, and install the nvidia-docker2 package

aptalca commented 2 years ago

You don't need any of that. You just need to install nvidia docker on your host, then define the runtime and set the nvidia visible devices var.

But you need to use the same compose yaml that quietsy posted to make sure that your additional arguments aren't breaking it.

Trust me, we have tons of users successfully running hw accel with Nvidia on jellyfin, plex and emby

Good luck

kura commented 2 years ago

I know that how it is shown in the readme should work, but for me it does not. I don't know why and I dislike docker so I went with the easiest workaround for me which was to use LD_LIBRARY_PATH to include the right libraries.

It was working until watchtower pulled an update recently and then it broke. It's fine, I'll disable hardware acceleration for now and play around until I get another LD_LIBRARY_PATH set-up working or compile ffmpeg in myself, whichever is easiest.

kura commented 2 years ago

I actually figured it out, if anyone stumbles on this and like me is doing it a weird way.

My LD_LIBRARY_PATH had unnecessary double quotes around it, and I found the missing shared object path, for me anyway; LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/cuda/lib64:/usr/local/nvidia/lib64

hanxinle commented 2 years ago

As kura says. In the cmd window. Type these:

export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/cuda/lib64:/usr/local/nvidia/lib64

then, ffmpeg or ffplay works fine. Thanks