Skip to content
This repository was archived by the owner on Dec 23, 2022. It is now read-only.

Conversation

mjc
Copy link
Contributor

@mjc mjc commented Sep 20, 2019

ffmpeg has this open issue about mapping channels correctly with libopus.

[libopus @ 0x56555780a0c0] Invalid channel layout 5.1(side) for specified mapping family -1.
Error initializing output stream 0:1 -- Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

I suspect the correct fix for this is to have our own mappings for these but for now this PR at least let the encode continue and I figured I would open the discussion so I can fix this PR to do whatever is decided on a weekend.

ffmpeg channel maps (from ffmpeg -layouts):
mono: FC
stereo: FL+FR
2.1: FL+FR+LFE
3.0: FL+FR+FC
3.0(back): FL+FR+BC
4.0: FL+FR+FC+BC
quad: FL+FR+BL+BR
quad(side): FL+FR+SL+SR
3.1: FL+FR+FC+LFE
5.0: FL+FR+FC+BL+BR
5.0(side): FL+FR+FC+SL+SR
5.1: FL+FR+FC+LFE+BL+BR
5.1(side): FL+FR+FC+LFE+SL+SR
6.0: FL+FR+FC+BC+SL+SR
6.0(front): FL+FR+FLC+FRC+SL+SR
hexagonal: FL+FR+FC+BL+BR+BC
6.1: FL+FR+FC+LFE+BC+SL+SR
6.1(back): FL+FR+FC+LFE+BL+BR+BC
6.1(front): FL+FR+LFE+FLC+FRC+SL+SR
7.0: FL+FR+FC+BL+BR+SL+SR
7.0(front): FL+FR+FC+FLC+FRC+SL+SR
7.1: FL+FR+FC+LFE+BL+BR+SL+SR
7.1(wide): FL+FR+FC+LFE+BL+BR+FLC+FRC
7.1(wide-side): FL+FR+FC+LFE+FLC+FRC+SL+SR

opus follows vorbis channel ordering
stereo: L+R
3ch: L+C+R
4ch: FL+FR+RL+RR
5ch: FL+C+FR+RL+RR
5.1: FL+C+FR+RL+RR+LFE
6.1: FL+C+FR+SL+SR+RC+LFE
7.1: FL+C+FR+SL+SR+RL+RR+LFE

It looks like just overriding 5.1(side) to 5.1 is fine but I'm not so sure about most of the other cases

@FallingSnow
Copy link
Owner

Thanks for the pull, poked my to check out the other pull requests.

I think pull #127 by @upekshapriya, specifically https://github.com/FallingSnow/h265ize/pull/127/files#diff-b5aeacf0b0e89c4ad9316070981779a4R819, will fix the problem sufficiently, don't you? Let's see what happens with his pull first.

I will take the debug fix though! Thank you.

@mjc
Copy link
Contributor Author

mjc commented Sep 21, 2019

It may. I'll make a new PR with just the debug commit.

@mjc mjc closed this Sep 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants