Skip to content

Multichannel audio (Surround sound)

pkv edited this page Mar 8, 2020 · 4 revisions

Table of Contents:


Multichannel audio

This is a fork of OBS-Studio bringing support of surround sound streaming and recording up to 16 channels. This expands on surround sound capabilities of vanilla obs (which I coded for it with a limitation to 8 audio channels) for streaming and recording.

This is obviously interesting for live streaming for music concerts, games and all situations where sound spatialization is relevant (e.g. ambisonics). With additional technology (discussed in this wiki), it can be useful also for multilingual streaming which is the reason why I developed this set of features actually.

Are there any services or players which are compatible with surround sound streaming ? YES.
As of now, the following services have been tested and are compatible with live surround sound streaming:

  • Twitch,
  • Mixer (rtmp not ftl),
  • Smashcast ...

Surround sound is not as yet compatible with neither Facebook Live nor YouTube Live (only the first two channels are kept).
However it should work with Facebook Live 360 for ambisonics streaming (at least for order 1 ambisonics; others untested)

Features

  • Recording and Streaming multichannel audio sources (surround sound).

  • Compatible streaming services: Twitch, Mixer rtmp (not ftl), smashcast, FB 360 live

  • Compatible protocols:

    • rtmp
    • mpeg-ts tcp udp (others untested).
  • Streaming servers tested:

    • wowza,
    • nginx-rtmp
      (rtmp with multichannel audio passes through and can be distributed by these servers to another service or cdn supporting surround sound; however, the recording feature of these servers does not work; only the first two audio channels are kept).
  • html5 players tested and working with live surround:

    • videojs,
    • bitmovin,
    • mediaelement,
    • viblast (hls & dash),
    • hls.js
  • Compatible containers (for recordings):

    • mkv
    • mp4
    • ts
    • flv (others untested).
  • Compatible codecs:

    • ffmpeg aac (native encoder, up to 16 channels),
    • libfdk_aac (up to 7.1),
    • core audio aac (up to 7.1),
    • opus (libopus encoder, up to 255 channels),
    • vorbis (up to 7.1),
    • pcm (others untested).
  • OS: compatible with win, macOS, linux (alsa, pulse-audio).

  • Misc:

    • Higher audio bitrates (up to 1024 kbs) unlocked to accomodate higher number of channels.
    • all the features of OBS-Studio have been retained; regarding audio: audio monitoring, audio filters, VST are all working OOB.

How to enable surround sound

  • Just go to Settings > Audio > Channels dropdown : just select the speaker layout you want (ex: 7.1, 5.1 etc)

  • You will have to restart obs for the new audio setup to be applied.

  • Go to Settings > Output ; audio bitrate can now be unlocked up to 1024 kb/s : it is necessary to increase the bitrate since there are more channels !
    In Output > Simple mode, one has :

In Settings > Output > Mode: Advanced, go to Audio tab :

Advanced uses

  • rtmp or mpeg-ts streaming with aac or opus from ffmpeg :
    • Go to Settings > Output > Output Mode: Advanced > Recording tab > Custom Output (FFmpeg) > FFmpeg Output Type: Select Output to URL .
    • Container format: mpegts or flv (for rtmp).
    • audio encoder settings:
      • if encoder is aac (for mpegts or rtmp): the channel_layout needs to be specified for 8.0 , type the option channel_layout=octagonal (to avoid ffmpeg confusing it with 7.1);
      • if encoder is libopus (only for mpegts): for 8.0 and 16.0 channel layouts, type the option mapping_family=255
      • beware, there are two opus encoders: libopus and opus (native ffmpeg encoder); use libopus only.