Last active
June 19, 2023 01:36
-
-
Save danielfomin96/e79d223d0cb439fadd868edccce9a172 to your computer and use it in GitHub Desktop.
ffmpeg wrapper to customely downmix videos opened by jellyfin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash - | |
#title :ffmpeg | |
#description :This script is a wrapper for jellyfin ffmpeg to downmix audio to stereo using a custom formula | |
#author :Daniel Fomin | |
#date :20230104 | |
#version :0.2 | |
#reference :https://superuser.com/questions/852400/properly-downmix-5-1-to-stereo-using-ffmpeg | |
# | |
# | |
#============================================================================== | |
############################################################################### | |
# Installation Notes: | |
# 1. Put wrapper in directory accessible from jellyfin | |
# 2. `chmod +x path/to/wrapper/dir/ffmpeg` | |
# 3. `ln -s $(which ffprobe) path/to/wrapper/dir/` to the same directory | |
# 4. Point jellyfin to the wrapper directory | |
# | |
############################################################################### | |
function join { local IFS=$'\n'; echo "${*}"; } | |
args=$(join "${@}") | |
match='-ac\n[3-9]' | |
replace='-af\npan=stereo|FL<0.707*FC+0.707*FL+0.707*BL+0.5*LFE|FR<0.707*FC+0.707*FR+0.707*BR+0.5*LFE' | |
ffmpeg="/usr/lib/jellyfin-ffmpeg/ffmpeg" | |
readarray -t new_args < <(sed -z "s/$match/$replace/g" <<<"$args") | |
#echo "Command Rewrite: $ffmpeg $new_args" 1>&2 | |
$ffmpeg "${new_args[@]}" | |
exit $? |
Unless you’re running Jellyfin inside a docker container the answer is no.
This script basically takes the command Jellyfin uses to call ffmpeg and
swaps out the commands in Linux.
On Sun, 22 Jan 2023 at 14:27, ivaylo-mk ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Real noob question, but I stumbled upon your script and I am wondering if
it is possible to use it somehow in Windows, as currently I am experiencing
issues with Jellyfin and 5.1 audio, and want to force downmixing to stereo
of everything that is being played.
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/e79d223d0cb439fadd868edccce9a172#gistcomment-4445163>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMNIULS2RS2J6ETBR3JCUMDWTU7VXBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTCMBUGQ2TMOBXU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
--
--
Mark Cassidy
***@***.***
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Real noob question, but I stumbled upon your script and I am wondering if it is possible to use it somehow in Windows, as currently I am experiencing issues with Jellyfin and 5.1 audio, and want to force downmixing to stereo of everything that is being played.