UniversalMediaServer / UniversalMediaServer/UniversalMediaServer

UMS unable to transcode with Nvidia 4070 GPU - Ubuntu 23.10 - UMS 14.2.1

Open
#4,851 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
2.7k
Forks
528
Avg merge
2d 22h
Merged PRs (30d)
23

Description

I'm having issues, I believe for at least the last 3 versions of UMS but only now managed to identify what looks to be the root cause, of UMS being unable to transcode any file using the Nvidia GPU. I am running Ubuntu 23.10.

I never previously had issues with this at all including with GPU acceleration, and apart from UMS, the GPU works fine and has no issues in any other app or media players. I first noticed the issue when attempting to resume any videos in UMS, which would fail to result with a perpetual "buffering" and errors thrown in UMS. As I had transcoding disabled for MKV (since my devices natively handle most my videos, it would rarely need to do transcoding upfront) - the first play of a video would work perfectly. However, trying to resume the video would fail 100% of the time, since the resume file would be a transcoded variant of the original, which was not working due to this issue, so I believe.

Upon digging into the logs, I discovered that mencoder was being used to transcode due to subtitle configuration and the challenges of video resuming on DLNA (or how I understand it) - but it was complaining of issues saying that the audio channel configuration was unsupported (ac3 @ 0x7980cb435360]Specified channel layout '2 channels' is not supported: Couldn't open codec ac3, br=384.), thus failing the transcode for that reason. I believe this was a furphy though, as the error was caused by the fact it wasn't receiving an input stream from ffmpeg, since the HW acceleration seems to be broken, so mencoder has nothing to compare the input channels against. Or so I believe (I'm no expert in transcoding!).

Anyway, digging further, I noticed the build of ffmpeg included in UMS 14.2.1 seems to have not been built with nvenc in it:

Is it possible that UMS's included ffmpeg version is simply missing the compiler flags for Nvidia HW acceleration?

$/opt/ums/ums-14.2.1$ linux/ffmpeg -encoders |grep -i nvidia
ffmpeg version 7.0.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100

If I get time, I might try compiling ffmpeg myself with the nvidia flags and drop it in the UMS linux folder...

ums_dbg_2024-07-26-15-04.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the bundled linux/ffmpeg binary and reproduce the reported linux/ffmpeg -encoders | grep -i nvidia check, then inspect how that binary is built. Done means establishing whether Nvidia acceleration is included and confirming that GPU-based transcoding and video resuming no longer fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, ubuntu
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.