support for multichannel audio in rtmp

pkv

Developer
hi
i'd like to draw more attention to :
https://obsproject.com/mantis/view.php?id=878

contrary to widespread belief, rtmp is not limited to stereo sound.
it would be great to develop ability to stream with multichannel audio beyond stereo : 4.0 5.1 6.1 7.1 etc in rtmp
The main objection that there is no service able to deal with multichannel audio is no longer true.

Facebook live 360 now supports spatialization of sound with rtmp, check for instance:
https://fb360spatialwork...e-360-video-on-Facebook

Ffmpeg and libfdk_aac can encode to a multichannel audio rtmp output.
Nginx and wowza accept multichannel audio rtmp as can be checked directly.

Here is a capture of ffmpeg streaming in 7.1 rtmp to a wowza server.




As an aside, it would be nice to port the multichannel ability not only to the streaming module but also the recording one for people using sdi capture cards with embedded audio (and hopefully some day obs will support asio on windows).
 

pkv

Developer
I played with the code and it can be done and works;

https://github.com/pkviet/obs-studio/branches
(multichannel branch)

Streaming in rtmp / mpeg-ts both work with multichannel audio (tested with 7.1 audio). I checked by dumping the streams with ffmpeg into mp4 or ts files.
Recording also work in multichannel audio (7.1 again).

I haven't yet pulled a request to main repo because my additions need some more cleaning.
 

Camilo625

New Member
Hi, i have been looking for something like this for quite a few days now, i would like to be able to record 5.1 or 7.1 surround sound along with gameplay while streaming in stereo (without having to record externally as i'm doing now), is there any way to test this build without having to build it from github?
 

pkv

Developer
My build record and streams in multichannel; but if you stream in multichannel to a cdn, I am pretty sure only the first two channels will be taken; there won't be any downmixing.
I'll try to change that so that when streaming there is an option to downmix.
If you're interested in testing, pm me your email with the OS (win, osx ), i'll post you a link to an installer (the build does not include browser extension and is 64 bit only, I did not compile for 32bit nor with browser)
 

pkv

Developer
YT live keeps only the last two channels; FB live seems to downmix; didn't test twitch, I don't have an account
edit: opened a twitch account to test ; Twitch downmixes all channels so this is perfect !
 
Last edited:

Gian

New Member
I’ve been trying to get 4.0 (ambisonic) sound to Facebook 360 but everyone here tells me it rtmp is stereo only. How can I try your build, if it’s available?
 

pkv

Developer
you can either wait until next official release since my surround sound PR was merged, or you can test a build from my repo:
https://github.com/pkviet/obs-studio/releases
Be aware that the 4.0 encoding works perfectly with rtmp but the FB live 360 is not yet working perfectly; last time I tested, the recording had the 4 ambisonics channels but during the live it was not so: maybe an issue with my browser, I don't know. Engineers from FB spacialaudio have tested my build and for them 4.0 was working, so I can't tell.
 

pkv

Developer
to be more accurate: i was talking of the recording FB does; when you stream, during the live I didn't have the 4 channels, no spacialization. But the recording of the same stream on FB did have ambisonics 4.0.
Maybe it is fixed now or depends on the browser; can't tell , didn't investigate the issue
 

Damien Paul

New Member
I'd be interested in giving it a try. I'm specifically interested in the mixdown capabilities. I've been working on music-related streams with multiple audio inputs. I have a Focusrite 18i8 that i use for recording that I'd like to test this out with.
 

pkv

Developer
check on the link I gave above and download per your platform. The builds for macOs can be finicky; the main release has 16 channels but for some macs there were install issues (installs fine on latest macs, don't know why older macs have issues). There is pre-release with 8 channel support which installs on older macs in case the release fails to install.
If you're patient enough, my PR was merged into master so surround will be official in next release.
 

Gian

New Member
I tried your build, works great but I have the same problem as you: 360 audio works only on the recorded video, not during livestream. I tried with Chrome on Win10 and Safari iOS so i think the problem must be on Facebook side.
 

pkv

Developer
that's not a log from one of my builds and therefore it's not setup to 4.0 but never mind, i have the os , cpu, cg .
 

Gian

New Member
here's the log from your build. I have a very bad high pitched crickets noise happening with your build when I use my Zoom H2n. doesn't happen in normal build or other applications.
 

Attachments

  • 2018-01-09 23-13-33.txt
    12.9 KB · Views: 51

pkv

Developer
mmh, odd; i noticed you're encoding three channels (2.1); how many channels are captured by your zoom ?
 

Gian

New Member
that 3 channel encode was just a test to see if the noise went away, it is the same with 4 channels. The zoom records 4 channel, of which the 3rd is silent because it doesn't have vertical spatialization data.
 
Top