Skip to content

vlc-video: Fix 5.1(back) & 7.1 channel ordering#12601

Open
pkviet wants to merge 2 commits into
obsproject:masterfrom
pkviet:vlcfix2
Open

vlc-video: Fix 5.1(back) & 7.1 channel ordering#12601
pkviet wants to merge 2 commits into
obsproject:masterfrom
pkviet:vlcfix2

Conversation

@pkviet

@pkviet pkviet commented Sep 7, 2025

Copy link
Copy Markdown
Member

Description

VLC source misorders 5.1(back) & 7.1 channel order.
It delivers for LC-AAC, HE-AAC, PCM sources for 5.1: FL FR BL BR FC LFE instead of FL FR FC LFE BL BR.
And for 7.1: FL FR SL SR BL BR FC LFE instead of FL FR FC LFE BL BR SL SR
This fixes the issue by calling swresample and providing it with a channel matrix to do an explicit channel swap.

Motivation and Context

Fixes #12579.

How Has This Been Tested?

Used Fraunhoffer 5.1(back) & 7.1 test sources with VLC Source and checked that the ordering is now correct.

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 kind/bug Categorizes issue or PR as related to a bug. Seeking Testers Build artifacts on CI labels Sep 7, 2025
@pkviet pkviet force-pushed the vlcfix2 branch 3 times, most recently from 56181d9 to adb74ff Compare September 8, 2025 11:00
@Ezriilc

Ezriilc commented Sep 10, 2025

Copy link
Copy Markdown

I've tested this version and the VLC Video Source seems to work perfectly [with 5.1] — all audio channels are playing in the correct speakers. I'd call this fixed!
EDIT: This test was only for the 5.1 speaker layout.

@pkviet

pkviet commented Sep 12, 2025

Copy link
Copy Markdown
Member Author

Updated to fix 7.1 which was also misordered by vlc source

@Ezriilc

Ezriilc commented Sep 12, 2025

Copy link
Copy Markdown

I think I have this latest version ("OBS 32.0.0-beta2-9-geac8e61ba", right?) and it also works fine with the Fraunhofer 5.1 file.

@pkviet pkviet changed the title vlc-video: Fix 5.1(back) channel ordering vlc-video: Fix 5.1(back) & 7.1 channel ordering Sep 23, 2025
@pkviet pkviet force-pushed the vlcfix2 branch 2 times, most recently from 9dee710 to 7d44623 Compare September 30, 2025 05:06
@Warchamp7 Warchamp7 added this to the OBS Studio 32.2 milestone May 6, 2026
Comment thread plugins/vlc-video/vlc-video-source.c Outdated
Comment thread plugins/vlc-video/vlc-video-source.c Outdated
Comment thread plugins/vlc-video/vlc-video-source.c Outdated
Comment thread plugins/vlc-video/vlc-video-source.c Outdated
@pkviet pkviet force-pushed the vlcfix2 branch 2 times, most recently from f4e7076 to ae230e9 Compare May 8, 2026 20:39
Comment thread libobs/media-io/audio-resampler-ffmpeg.c Outdated
pkviet added 2 commits June 24, 2026 15:57
This adds a function allowing to set a custom channel matrix, allowing
channel rerouting. This is useful when sources provide layouts not
supported by obs or to correct incorrect channel assignments.

Signed-off-by: pkv <pkv@obsproject.com>
This fixes the 5.1(back) channel order from:
FL FR BL BR FC LFE to FL FR FC LFE BL BR.
Fixes obsproject#12579.
This also fixes the 7.1 channel order from
FL FR SL SR BL BR FC LFE to FL FR FC LFE BL BR SL SR
Signed-off-by: pkv <pkv@obsproject.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. Seeking Testers Build artifacts on CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VLC Video Source Surround Audio Channels are Swapped

4 participants