Closed joshinils closed 1 month ago
You can't pass -af
through extra options because ffmpeg-normalize internally sets up a complex filtergraph, and any addition to that would have to be made through the --pre-filter
and --post-filter
options.
Also, didn't we have a discussion about opus not supporting surround sound properly? https://github.com/slhck/ffmpeg-normalize/issues/237#issuecomment-1580288823
I think it would make sense to first try to reproduce the issue with raw ffmpeg commands, just to figure out what is actually going on. In other words, when you manually run your input file through ffmpeg and re-encode, can you get it to output the correct channel map (without normalizing anything)? Once you have that figured out, what happens when you apply the normalization manually, i.e., run it once with the loudnorm
filter?
Because the processing pipeline in ffmpeg-normalize is more or less static, it's going to be hard to accommodate all these special cases. Especially when ffmpeg doesn't output properties similar to its input, it's going to be even more effort …
Also, didn't we have a discussion about opus not supporting surround sound properly? #237 (comment)
Specifically, opus was the problem there, not libopus.
I think it would make sense to first try to reproduce the issue with raw ffmpeg commands, just to figure out what is actually going on. In other words, when you manually run your input file through ffmpeg and re-encode, can you get it to output the correct channel map (without normalizing anything)?
Yeah, this isn't an issue with ffmpeg-normalize, but the regular ffmpeg.
It just doesn't seem to "understand" that the input 4.1 is not the same as what I want it to also output as 4.1, it also re-organizes the channels the same way as above.
I don't know how to tell it what I want it to do.
ffmpeg -layouts
spits out one 4.1 mapping: 4.1 FL+FR+FC+LFE+BC
which is what the input is, but ffmpeg only produces Channel layout : L R Lb Rb LFE
.
No matter what I specify, for example ffmpeg -i input.mkv -map 0:a:0 -c:a libopus -filter_complex "channelmap=channel_layout=4.1:map=FL-FL|FR-FR|FC-FC|LFE-LFE|BC-BC[out]" -map "[out]" -ac 5 out.mka -y
, the output has a different mapping, which I do not understand.
See section 5.1.1.2 in https://www.rfc-editor.org/rfc/rfc7845.html#section-5.1.1.2
5 channels: 5.0 surround (front left, front center, front right, rear left, rear right).
meaning Opus can not produce 4.1 audio.
The original is fine when played back in my stereo headphones with VLC, the normalized is not – it is louder on my right side.
I have a rare file which is encoded like this: original mediainfo
original ffprobe
normalized mediainfo:
normalized ffprobe:
this is the command my script used:
The problem is that the output is 5.0 instead of 4.1, the input Channel layout is "L R C LFE Cb" the output is "L R Lb Rb LFE" which is the same amount, but the wrong channel layout.
I've tried appending a
-af channelmap=channel_layout=4.1
to the above command. But that led to this error message:I've tried swapping the channels from the above normalized output;
that is better, but also wrong.
What can I do to correctly normalize this file?