New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly Downmix 5.1 Audio #1986
Comments
For the reference: here's what I use in my pet project: |
This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. |
Any reason not to change the current command to the one you used in your pet project if it's better? |
I think no one is touching it because it can come down to personal preference, or what people are used to.
If people don't want to commit to a new command it might be a good idea to offer it up as a config option. |
@Gr3q reading your SO-linked answer it seems "my" formula is taken from there and already implemented in new enough ffmpeg if you say |
Yes, I agree |
This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. |
up |
This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. |
up |
Hey guys, |
You can replace your ffmpeg path in Jellyfin with a bash script that strips out the parameter and then calls the real ffmpeg with the resulting command. |
I think this is the source you are looking for:
I would be interested in a better generic down-mixing solution. Although, to that end it may be better left to an upstream project. As linked, it looks like ffmpeg is following the spec. so maybe the spec should be improved? |
This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. |
TL;DR: if you have configured an alternative ffmpeg path in Jellyfin, make sure there's an ffprobe binary in the same location with the same file extension. https://blog.jeroenhd.nl/article/jellyfin-rffmpeg-and-confusing-error-messages |
This is the wrapper I've been using. Jellyfin should use this formulae instead of "-ac 2" for optimal downmix to stereo. As a note: If replacing ffmpeg with this wrapper in jellyfin configuration, it should have ffprobe symlink in the same directory. You can do this with: |
In case anyone is trying to get this to work on Roku. It seems like the problem is the audio stream tries to direct play. I.e. My little hack to fix this is (riffing of the help from above... on this issue):
If someone has a cleaner way to get at this result, please share. |
Cleaner way.
This is the best wrapper I've made so far:
|
I was including the downmix as well, not sure if that is needed, not really sure what is going on. But my change does work.
It looks great! Thank you! |
I'm also facing the problem with low voice when playng movies with 5.1 tracks. So I'm trying to implement the workarround suggested in this thread for a better downmix to 2 stereo channels as I don't have any surround system / soundbar. I'm using Jellyfin server 10.7.7 on Debian. This is my configuration:
with /usr/lib/jellyfin-ffmpeg-downmix/ffmpeg.wrap:
and Jellyfin playback/FFmpeg path set to use Now when I try to play a movie with a 5.1 track on it (eac3 or ac3) jellyfin doesn't force the conversion and direct stream to the client (I also can see using htop on the debian machine that there is no ffpeg conversion). As client I use the Android official app. I also have an AndroidTV Box (Mi Box S) with Jellyfin for AndroidTV official app and with this ffmpeg.wrap setup when I try to play the same movie with 5.1 ac3/eac3 all the players (libvlc, exoplayer, external mpv player, external Mx Player) cannot start to play the movie. What I'm doing wrong? Any help would be really appreciated, thanks |
@I-G-1-1 , Some ideas what to check... I do not use this line, please try without it: _args=${_args/-codec:a:0 copy/-codec:a:0 aac} I have ffprob.wrap in the same folder where ffmpeg: Maybe compare file ownership for ffmpeg and ffmpeg.wrap to see if it match. Is there anything in the logs when you test it on Mi Box S? Logs helped to resolve issues that I were facing. For Jellyfin server 10.7.7 on Debian can you try to force subtitles? It should result in forced transcoding. Just I do not remember where was this setting. |
This seems like a pretty hacky workaround for such a big issue. Dialogue is extremely quiet out of the box when downmixing and the official solution is to write a bash script to trick jellyfin into thinking ffmpeg is doing 1 thing when its actually doing something else? Surely you do not expect the average joe running this in docker on their NAS or whatever to do this workaround? Or do we just expect everyone to have native stereo copies of all their content? Or are we just expecting everyone to have 5.1 surround and never want to watch something on their phone or their laptop? I understand this is the default way ffmpeg is handling it when you do |
100% agreed. It is easy to rebuild the docker image with the |
Script breaks in situation when ffmpeg argument contains no spaces, but contains a semicolon. Script needs small modification to add
The particular problem I faced with
Error does not occur with above updated script. |
This should all be unnecessary once #9001 is merged - at least if you just want to use another downmix algorithm. |
Only for this feature, it is true my friend. However the script provided by ManuLinares is excellent way to customize so much more. For example, I use the wrapper to clean up transcoding directory which is having limited space (RAM drive). It has finally made the playback without hiccups. More details on the solution is here: #3929. And even that feature is waiting for merge #8744. Then again, there will be someone like me who is upgrading Jellyfin server once per year, so these workarounds let me benefit today and not wait for upgrade. Jellyfin upgrade is not always smooth - release comes with compatibility for minimum FFMPEG version, which has expected compatibility for GPU drivers (link is here), these compatibility requirements don't change often, but I have faced problem that QNAP didn't had released NVIDIA driver/kernel update for my NAS, hence transcoding was not working at all and I needed to rollback Jellyfin and continue to enjoy workarounds. A further extension for this wonderful idea of FFMPEG WRAP to maintain free space in transcodes directory: Jellyfin-Transcodes-cleanup. |
Disclaimer: could not find the ffmpeg downmix options in the source so I do not know the exact state of this, but I've seen the my logs and jellyfin mostly uses the -ac 2 flag.
Describe the bug
Default downmix option '-ac 2' in ffmpeg produces audio what is not true to the original 5.1 audio.
Logs
An example from my log:
To Reproduce
Watch a movie with 5.1 what is downmixed to stereo
Additional context
There are a couple of alternative formulas tested for 5.1 downmix options here, - while I understand that this could be seen as personal preference - this could be explored further especially when others did the hard work already (and the default '-ac 2' option discards the subwoofer channel entirely).
The text was updated successfully, but these errors were encountered: