Zabooby / mpv-config

Personal mpv config files aiming to get the best quality and viewing experience
https://mpv.io
229 stars 12 forks source link

5.1 Surround Downmixer Profile Doesn't Work for DD E-AC3/AC3 Format #38

Open DrieHarry opened 3 days ago

DrieHarry commented 3 days ago

The profile did well downmixing the AAC format, which uses BR (Back Right) and BL (Back Left) channels, but the AC3 format uses SR (Surround Right) and SL (Surround Left) channels. Is there a way for the profile to read the format instead?

You can also see in the log that there's no value for i4 and i5 for E-AC3 (the value is different from the original config because I edited it).

Log for AAC format (Furiosa Web-DL AAC 5.1) [ 0.456][d][ffmpeg] Parsed_pan_0: o0 = 1 i0 + 0 i1 + 0.7 i2 + 0.15 i3 + 0.3 i4 + 0 i5 [ 0.456][d][ffmpeg] Parsed_pan_0: o1 = 0 i0 + 1 i1 + 0.7 i2 + 0.15 i3 + 0 i4 + 0.3 i5 Log for DD EAC3 format (The Beekeeper BluRay DD 5.1) [ 1.180][d][ffmpeg] Parsed_pan_0: o0 = 1 i0 + 0 i1 + 0.7 i2 + 0.15 i3 + 0 i4 + 0 i5 [ 1.180][d][ffmpeg] Parsed_pan_0: o1 = 0 i0 + 1 i1 + 0.7 i2 + 0.15 i3 + 0 i4 + 0 i5

DrieHarry commented 2 days ago

For reference, could use Dolby Pro Logic II Downmix for downmix which support all format

[dplii] profile-desc="downmix 5.1 surround to Dolby Pro Logic II compatible stereo"

swresample method

audio-swresample-o=matrix_encoding=dplii,lfe_mix_level=1 audio-channels=stereo

lavrresample method

af='pan="stereo| FL = FL + 0.7071FC + LFE + -0.7071BL + -0.7071BR | FR = FR + 0.7071FC + LFE + 0.7071BL + 0.7071BR"'

Both should produce the same output sound according to here the lavrresample method could be used if you want to configure it manually

Zabooby commented 2 days ago

Could you first try adding a new profile in profiles.conf with the following condition: profile-cond=string.match(get("audio-codec-name", ""), "ac3") ~= nil

If that doesn't work I'll test the profile above. Thanks for all the suggestions.