Skip to content
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

libobs & obs-ffmpeg: Surround sound fixes #10642

Merged
merged 2 commits into from May 9, 2024

Conversation

pkviet
Copy link
Member

@pkviet pkviet commented May 5, 2024

Description

This fixes two bugs with surround sound (blame Rodney !).
(1)
Commit [1] added ALAC & PCM support.
But 7.1 ALAC encoding fails.
This fixes the issue by assigning the correct 7.1 layout supported by FFmpeg ALAC encoder (7.1(wide)).

[1] 3ae9851

(2) This commit [2] uses the av_channel_layout_default & av_get_default_channel_layout which set 5.0
as layout for 5 audio channels; but obs sets 4.1 speaker layout for 5 channels.
The second commit of this PR fixes that.

[2] 567e35a

Motivation and Context

Fix a bug.
I came upon this bug while reviewing Rodney's hybrid mp4 muxer.
#10608
The bug is due to the fact that FFmpeg ALAC encoder uses 7.1(wide) layout which changes the back speakers
to side ones.
@derrod pointed out then that probably his commit [2] above would need some fixing.
@norihiro also suggested that there might be fixes needed elsewhere.
That was a correct expectation.

How Has This Been Tested?

There's no error popup anymore, the recording works fine.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@pkviet pkviet added the Bug Fix Non-breaking change which fixes an issue label May 5, 2024
@pkviet pkviet changed the title obs-ffmpeg: Fix 7.1 ALAC encoding libobs & obs-ffmpeg: Surround sound fixes May 6, 2024
@pkviet
Copy link
Member Author

pkviet commented May 6, 2024

Additional fix added.

libobs/media-io/media-remux.c Outdated Show resolved Hide resolved
@pkviet
Copy link
Member Author

pkviet commented May 6, 2024

Changes following Ryan's review.
I added more comments, for the sake of future readibility when applying FFmpeg fixes for channel layouts that we require.

pkviet added 2 commits May 9, 2024 10:10
Commit [1] added ALAC & PCM support.
But 7.1 ALAC encoding fails.
This fixes the issue by assigning the correct 7.1 layout supported by
FFmpeg ALAC encoder (7.1(wide)).

[1] obsproject@3ae9851

Signed-off-by: pkv <[email protected]>
FFmpeg has 5.0 as default layout for 5 channels.
But obs-studio uses 4.1. This is a fix when remuxing.

Signed-off-by: pkv <[email protected]>
@RytoEX RytoEX added this to the OBS Studio (Next Version) milestone May 9, 2024
@RytoEX RytoEX self-assigned this May 9, 2024
@RytoEX RytoEX merged commit 5b2e2a9 into obsproject:master May 9, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants