Jellyfin Forum
Transcoding fails with FFmpeg exit code 187 - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Transcoding fails with FFmpeg exit code 187 (/t-transcoding-fails-with-ffmpeg-exit-code-187)

Pages: 1 2


RE: Transcoding fails with FFmpeg exit code 187 - TheDreadPirate - 2024-09-18

How did you install Jellyfin? And how are you starting it?

I didn't noticed this the first time, but your transcode cache is being written to your home directory which tells me this is either a portable install or you're starting jellyfin by typing, literally, "jellyfin". The fact that you had vanilla ffmpeg before has me leaning towards a portable install.

Code:
/home/stefa9/.cache/jellyfin/transcodes/

Regardless if you're using a portable install or not, whatever user you are using to run jellyfin needs to be part of the render group. Which is, I think, the current roadblock.


RE: Transcoding fails with FFmpeg exit code 187 - stef4n24 - 2024-09-18

I did it using the bash script:
curl https://repo.jellyfin.org/install-debuntu.sh | sudo bash


RE: Transcoding fails with FFmpeg exit code 187 - TheDreadPirate - 2024-09-18

And how are you starting jellyfin? Jellyfin does not use your home directory by default.


RE: Transcoding fails with FFmpeg exit code 187 - stef4n24 - 2024-09-18

Made a service for it:

[Unit]
Description=jellyfin service

[Service]
User=stefa9
ExecStart=/usr/lib/jellyfin/bin/jellyfin --ffmpeg /usr/lib/jellyfin-ffmpeg/ffmpeg

[Install]
WantedBy=default.target


RE: Transcoding fails with FFmpeg exit code 187 - TheDreadPirate - 2024-09-18

When you install Jellyfin via apt, which is what the script you used does, it also creates the service. And it includes a boot load of other options that yours isn't using. Remove the service file you created and use the one that is already present.

/etc/systemd/system/multi-user.target.wants/jellyfin.service

Code:
[Unit]
Description = Jellyfin Media Server
After = network-online.target

[Service]
Type = simple
EnvironmentFile = /etc/default/jellyfin
User = jellyfin
Group = jellyfin
WorkingDirectory = /var/lib/jellyfin
ExecStart = /usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS
Restart = on-failure
TimeoutSec = 15
SuccessExitStatus=0 143

[Install]
WantedBy = multi-user.target



RE: Transcoding fails with FFmpeg exit code 187 - stef4n24 - 2024-09-18

I've tried running it using this service, I didn't know how to run it from /multi-user.target.wants though
I get the following error when checking the status of the service:
× jellyfin.service - Jellyfin Media Server
Loaded: loaded (/etc/systemd/system/jellyfin.service; enabled; preset: enabled)
Active: failed (Result: core-dump) since Wed 2024-09-18 20:15:02 EEST; 1s ago
Duration: 279ms
Process: 17230 ExecStart=/usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS> Main PID: 17230 (code=dumped, signal=ABRT)
CPU: 148ms

Sep 18 20:15:02 legiunea systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 5.
Sep 18 20:15:02 legiunea systemd[1]: jellyfin.service: Start request repeated too quickly.
Sep 18 20:15:02 legiunea systemd[1]: jellyfin.service: Failed with result 'core-dump'.
Sep 18 20:15:02 legiunea systemd[1]: Failed to start jellyfin.service - Jellyfin Media Server.


RE: Transcoding fails with FFmpeg exit code 187 - stef4n24 - 2024-09-18

I found out why:
Unhandled exception. System.UnauthorizedAccessException: Access to the path '/var/log/jellyfin' is denied.

New error now:


RE: Transcoding fails with FFmpeg exit code 187 - stef4n24 - 2024-09-18

Alright, fixed this one too, I still had Low power Intel HEVC encoding. Switched it off and now it works. Thanks for all the help Smiling-face


RE: Transcoding fails with FFmpeg exit code 187 - TheDreadPirate - 2024-09-18

After using the install script you ran, it should have started and enabled the jellyfin service.  Enabled = auto-starts on boot.

sudo systemctl <start/stop/restart/status> jellyfin

(2024-09-18, 05:25 PM)stef4n24 Wrote: I found out why:
Unhandled exception. System.UnauthorizedAccessException: Access to the path '/var/log/jellyfin' is denied.

New error now:

Code:
sudo chown -R jellyfin: /etc/jellyfin /var/lib/jellyfin /var/cache/jellyfin /var/log/jellyfin
sudo systemctl restart jellyfin

Looks like you still have it on VAAPI. Switch it back to QSV. It is more performant.