Skip to content

VLC Video Source Surround Audio Channels are Swapped #12579

Open

Description

@Ezriilc

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

31.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/oBEtroBsAwlkY5JI

OBS Studio Crash Log URL

No response

Expected Behavior

5.1 surround channels should play in the proper, individual speakers.

Current Behavior

When playing a file with OBS's built-in VLC Video Source, the Front-Center channel is swapped with the Rear-Left and the Subwoofer/LFE is swapped with the Rear-Right.

Put another way, the sound for the Front-Center channel plays in the Rear-Left speaker, and the sound for the Subwoofer/LFE channel plays in the Rear-Right speaker, and vice-versa; the channels are swapped.

EDIT: To be clear, this behavior exists with ANY 5.1 layout, including Rear-Surround or Mid-Surround.

Steps to Reproduce

  1. Start OBS and add a built-in source from the list called "VLC Video Source".
  2. Go to "Advanced Audio Properties" and turn on the Monitor for that source.
  3. Load and play any media file that has a 5.1 sound track. I've attached a video here that calls out the channels visually and verbally, and I've tested other files too.
    https://github.com/user-attachments/assets/b063c404-fd28-4585-8eb9-8dba99fcb456
  4. Observe that the channels are swapped as described.

Anything else we should know?

It may be important to note that this only happens with the "VLC Video Source" source and all of the others seem to work fine.

I was instructed to create this issue by a smart person in the Discord windows-support channel, and I'm nerdily thrilled that I may have actually found an actual bug. I hope this helps!

Activity

  1. pkviet commented on Sep 3, 2025

    @pkviet
    Member

    Hello
    Thanks for your report.
    There are various 5.1 speaker layouts.
    What we support in obs is:
    SPEAKERS_5POINT1, /**< Channels: FL, FR, FC, LFE, RL, RR */

    But there is also a 5.1 with SL SR instead of RL RR.
    So FFmpeg will distinguish 5.1 from 5.1 back.
    What the vlc plugin is doing is that it is naively counting the number of channels and then affecting a speaker layout.
    This is indeed too naive.
    I will check if vlc api allows a retrieval of the speaker layout. Not sure about that.
    But on your side , is your source a 5.1 back audio ?
    Run ffmpeg -i file and report back what FFmpeg says.
    In the mean time, if you want a better speaker management, use Media source instead of VLC.

  2. self-assigned this
    on Sep 3, 2025
  3. pkviet commented on Sep 3, 2025

    @pkviet
    Member

    After checking libvlc, it seems vlc does not expose the speaker layout ...
    So we can't do anything if your source is not 5.1 back.
    If your source is indeed 5.1 back, check that with Media Source all is fine.
    Are you sure the speakers are well set on os side ?
    I want to be sure it is an issue on our side or not. I will try to confirm on my side.

  4. Ezriilc commented on Sep 3, 2025

    @Ezriilc
    Author

    Hello Thanks for your report. There are various 5.1 speaker layouts. What we support in obs is: SPEAKERS_5POINT1, /**< Channels: FL, FR, FC, LFE, RL, RR */

    But there is also a 5.1 with SL SR instead of RL RR. So FFmpeg will distinguish 5.1 from 5.1 back. What the vlc plugin is doing is that it is naively counting the number of channels and then affecting a speaker layout. This is indeed too naive. I will check if vlc api allows a retrieval of the speaker layout. Not sure about that. But on your side , is your source a 5.1 back audio ? Run ffmpeg -i file and report back what FFmpeg says. In the mean time, if you want a better speaker management, use Media source instead of VLC.

    Thanks for your attention!

    I'm aware of the various 5.1 (and 7.1, etc.) layouts and this behavior happens with all of them, but only in OBS's "VLC Video Source" and not in VLC itself. I've tried different speaker layouts in Windoze as well, and even different audio devices. I've tried videos with various surround layouts. If you play them with the wrong layout, the surround channels may be less defined or even missing, but never swapped with the Center or Sub. Regardless of Middle vs. Rear, the behavior is the same all around.

    EDIT: Clarified that it's OBS's "VLC Video Source" that is the only problem.

    The fact that this happens only in OBS (always) and not in VLC itself (never) makes my gut think it's OBS, not VLC. In fact, I cannot duplicate this behavior in anything other than OBS. I bet you a raspberry jelly donut it's OBS. O.o

    I appreciate the suggestion to use Media Source and that seems to work well, but I like the features of the VLC Video Source (e.g. subtitles), and I was hoping to help the community with what I've learned as I found very little info on OBS surround sound out there. I'd like to work this out if possible.

    Here's my ffmpeg command output for the file I attached that has Rear Surround ("3F2R/LFE"), as requested, and I've also run that command on a movie file with Mid Surround ("3F2M/LFE"). Both movies play perfectly in VLC itself, but both have the same exact problem in OBS.

    File 1 with Rear Surround ("3F2R/LFE")

    ffmpeg -i "D:\MyDocs2\Shared\5.1-Test_ChID-BLITS-EBU.mp4"
    ffmpeg version N-94383-g3883c9d147 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 9.1.1 (GCC) 20190716
    configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
    libavutil 56. 32.100 / 56. 32.100
    libavcodec 58. 55.100 / 58. 55.100
    libavformat 58. 30.100 / 58. 30.100
    libavdevice 58. 9.100 / 58. 9.100
    libavfilter 7. 58.100 / 7. 58.100
    libswscale 5. 6.100 / 5. 6.100
    libswresample 3. 6.100 / 3. 6.100
    libpostproc 55. 6.100 / 55. 6.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\MyDocs2\Shared\5.1-Test_ChID-BLITS-EBU.mp4':
    Metadata:
    major_brand : avc1
    minor_version : 0
    compatible_brands: isomavc1
    creation_time : 2012-05-17T00:54:33.000000Z
    Duration: 00:00:46.63, start: 0.000000, bitrate: 188 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 800x600, 26 kb/s, 8 fps, 8 tbr, 8 tbn, 16 tbc (default)
    Metadata:
    creation_time : 2012-05-17T00:54:33.000000Z
    handler_name : GPAC ISO Video Handler
    Stream #0:1(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, 5.1, fltp, 159 kb/s (default)
    Metadata:
    creation_time : 2012-05-17T00:56:13.000000Z
    handler_name : GPAC ISO Audio Handler
    At least one output file must be specified

    File 2 with Middle Surround ("3F2M/LFE"):

    ffmpeg -i "D:\MyDocs2\Shared\A.Minecraft.Movie.2025.2160p.iT.WEB-DL.DDP5.1.Atmos.DV.HDR.H.265.mkv"
    ffmpeg version N-94383-g3883c9d147 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 9.1.1 (GCC) 20190716
    configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
    libavutil 56. 32.100 / 56. 32.100
    libavcodec 58. 55.100 / 58. 55.100
    libavformat 58. 30.100 / 58. 30.100
    libavdevice 58. 9.100 / 58. 9.100
    libavfilter 7. 58.100 / 7. 58.100
    libswscale 5. 6.100 / 5. 6.100
    libswresample 3. 6.100 / 3. 6.100
    libpostproc 55. 6.100 / 55. 6.100
    Guessed Channel Layout for Input Stream #0.1 : 5.1
    Input #0, matroska,webm, from 'D:\MyDocs2\Shared\A.Minecraft.Movie.2025.2160p.iT.WEB-DL.DDP5.1.Atmos.DV.HDR.H.265.mkv':
    Metadata:
    encoder : libebml v1.4.5 + libmatroska v1.7.1
    Duration: 01:40:53.84, start: 0.000000, bitrate: 24963 kb/s
    Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2076 [SAR 1:1 DAR 320:173], 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
    Metadata:
    BPS : 24189286
    DURATION : 01:40:53.840000000
    NUMBER_OF_FRAMES: 145147
    NUMBER_OF_BYTES : 18304758700
    _STATISTICS_WRITING_APP: mkvmerge v90.0 ('Hanging On') 64-bit
    _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1, fltp (default)
    Metadata:
    BPS : 768000
    DURATION : 01:40:53.824000000
    NUMBER_OF_FRAMES: 189182
    NUMBER_OF_BYTES : 581167104
    _STATISTICS_WRITING_APP: mkvmerge v90.0 ('Hanging On') 64-bit
    _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    At least one output file must be specified

  5. pkviet commented on Sep 5, 2025

    @pkviet
    Member

    With vlc source, i see indeed with the fraunhoffer file an ordering issue with:

    • SL == ch3 instead of FC
    • SR == ch4 instead of LFE
    • FC == ch5 instead of BL
    • LFE == ch6 instead of BR

    It seems to stem from a difference between SMPTE which orders 5.1 back as: FL FR FC LFE BL BR
    while AAC spec has: FC FL FR BL BR LFE

    I have no such issue with Media Source.
    This is indeed a bug, but not easy to fix. VLC (the app) must do some rematrixing in between the audio receiving and the audio decoding. But it is not exposed in libvlc. I will have to dig more.
    The proper fix would be to reorder the channels as i did with the Decklink source but this is a lot of code; not sure i want to follow that recipe. It would be much better if the decoding received from libvlc was correct.
    So as things stand, the issue is imo on libvlc side (not vlc app, since it seems to work according to your tests). We give libvlc a proper 5.1 back file; it doesn't decode in correct order. While FFmpeg does. (since Media Source works).

  6. added
    issue/confirmed
    on Sep 5, 2025
  7. pkviet commented on Sep 5, 2025

    @pkviet
    Member

    sidenote: the project goal is eventually to remove VLC Source in favor of Media Source when parity is reached. So, not sure i want to invest time in fixing this bug. This will have to be discussed internally with the other devs in the team.

  8. Ezriilc commented on Sep 5, 2025

    @Ezriilc
    Author

    This is indeed a bug

    Woohoo! Nailed it.

    Thanks for humoring me. I appreciate your time and I can see how putting energy into VLC Video Source is a waste of it, so of course don't worry about fixing it on my account. I'll switch to Media Source, (or use the VLC app in a Window Capture) and patiently look forward to any more features that may be in the works.

    Y'all rock!

  9. added a commit that references this issue on Sep 7, 2025
    1b7af7f
  10. Ezriilc commented on Sep 7, 2025

    @Ezriilc
    Author

    I don't know my way around GitHub very well, but I think I have the right download, and that seems to work perfectly - the Fraunhofer surround test video plays as expected. Well done indeed.

    Thanks for the quick fix! I'll let you close this if you wish.

  11. pkviet commented on Sep 7, 2025

    @pkviet
    Member

    I will make some more changes tomorrow to the fix to make it more general.
    As it stands now it requires libobs changes which are too narrow.

  12. added 3 commits that reference this issue on Sep 8, 2025
    e1e368d
    56181d9
    adb74ff
  13. 9 remaining items

  14. Ezriilc commented on Sep 25, 2025

    @Ezriilc
    Author

    if you use libvorbis, i asume it's through our custom ffmpeg output

    That's correct. I use the ffmpeg output to "stream" (record) to Icecast.

  15. added 2 commits that reference this issue on Sep 29, 2025
    474d887
    7d44623
  16. Ezriilc commented on Oct 7, 2025

    @Ezriilc
    Author

    Is there a way for me to know if/when this fix will be incorporated into a release? I've updated to v32.0.1 and this bug still remains in it.

  17. Fenrirthviti commented on Oct 7, 2025

    @Fenrirthviti
    Member

    This PR hasn't been merged yet, so it would not have been included in any release. It would first need to be merged, which would mean it would be included in the next release. You can monitor when that is as the change will be listed in that next release's patch notes.

  18. added a commit that references this issue on Jan 14, 2026
    5d60d39
  19. theking2 commented on Apr 3, 2026

    @theking2
    ChID-BLITS-EBU.mp4

    Test file

  20. added this to the OBS Studio 32.1 milestone on Apr 3, 2026
  21. Ezriilc commented on Apr 3, 2026

    @Ezriilc
    Author

    sidenote: the project goal is eventually to remove VLC Source in favor of Media Source when parity is reached. So, not sure i want to invest time in fixing this bug. This will have to be discussed internally with the other devs in the team.

    I notice the VLC Source option is already been removed from the stable release, but I had assumed "parity" meant that the Media source would do everything the VLC Source did, and it doesn't. For instance, the subtitles option isn't there, which is what I was using it for, and others.

    Am I misunderstanding something? Yes, yes I am. I had the 32 bit VLC for some raisin.

  22. WizardCM commented on Apr 3, 2026

    @WizardCM
    Member

    The VLC Source has not been removed. If you are not seeing it, then OBS did not find a matching copy of VLC installed. Currently we support VLC 3.x with the same bitness (64bit) as the main application.

  23. Ezriilc commented on Apr 4, 2026

    @Ezriilc
    Author

    The VLC Source has not been removed. If you are not seeing it, then OBS did not find a matching copy of VLC installed. Currently we support VLC 3.x with the same bitness (64bit) as the main application.

    You are correct! I had the 32 bit version which is strange - I always prefer 64 bit for most things and certainly VLC. Also, VLC doesn't seem to report its bitness in the Help>About.

  24. added 2 commits that reference this issue on May 8, 2026
    a2aaa3e
    ae230e9
  25. added 2 commits that reference this issue on Jun 23, 2026
    f9261b4
    7aecba7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

issue/confirmedissue/workaround

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions