Smiley-McSmiles / jellyman

Jellyman is a set of scripts to install/manage and update the jellyfin-combined tar.gz generic linux package
GNU General Public License v3.0
92 stars 4 forks source link

Path for the ffmpeg binary is not correct in jellyfin.sh #56

Closed hobby-lc closed 9 months ago

hobby-lc commented 9 months ago

The ffmepg binary is not located in the folder "/usr/share/ffmpeg" for Ubuntu 22.04. Jellyfin service will start normally (with error message only) until the need of transcoding the video during play. FYI.

It would be better to use "$(which jellyfin)" to pass the ffmepg binary location in the jellyfin.sh.

https://github.com/Smiley-McSmiles/jellyman/blob/14711dbc07f0be3b867532ffc9e35d81dd50913b/scripts/jellyfin.sh#L10

ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
hobby-lc commented 9 months ago

And, it seems that Jellyfin called "ffprobe" instead of "ffmpeg" sometimes during play.

[2024-01-08 11:26:34.605 +08:00] [ERR] Error in "ffprobe"
System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/usr/share/ffmpeg/ffprobe' with working directory '/opt/jellyfin'. No such file or directory
   at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.StartProcess(ProcessWrapper process)
   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.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)

https://forum.jellyfin.org/t-ffmpeg-path-jellyfin-10-8-13?pid=11058#pid11058 According to the above discussion, adding the following lines in encoding.xml should fix the ffprobe problem: (it seems that the cmdline option "--ffmpeg" will modfiy the "EncoderAppPathDisplay" only)

`/path/to/bin/ffmpeg

/path/to/bin/ffmpeg` Thank you very much for jellyman. Please consider adding an option for using the jellyfin-ffmpeg.
Smiley-McSmiles commented 9 months ago

Unfortunately your solution would not work, for example this is my output on my system for that.

echo $(which jellyfin)
which: no jellyfin in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/var/lib/snapd/snap/bin)

However it would be better perhaps to use $(which ffmpeg). Maybe that's what you meant?

hobby-lc commented 9 months ago

Unfortunately your solution would not work, for example this is my output on my system for that.

echo $(which jellyfin)
which: no jellyfin in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/var/lib/snapd/snap/bin)

However it would be better perhaps to use $(which ffmpeg). Maybe that's what you meant?

Sorry for the typo, and yes I mean '$(which ffmpeg)' for locating the ffmpeg binary path.

Smiley-McSmiles commented 9 months ago

I still haven't tested this on my system, I would like to make sure this works in every situation on all the distros I mentioned I tested it on before continuing. As for specific Ubuntu support for jellyfin-ffmpeg, anyone with a reasonable understanding of linux would easily be able to install jellyfin-ffmpeg on their ubuntu machine with my script. I'm just not so sure that it's completely necessary to add code specifically for ubuntu and that specific use case of their version of ffmpeg. Feel free to write up some code to include the automatic installation for jellyfin-ffmpeg as a pull request, and I may merge it.