A way to combine an audio and video stream into one window for Discord

“virtual reality”audiodiscordstreamingvideo

I'm trying to stream a VR game to my friends on Discord, but when anyone streams (Screen Share) a game or any application on Discord, Discord only captures the audio coming from a window. And when I play a game such as BeatSaber when there's a lot of movement, they can hear me breathing heavily through my mic, which can disturb other users in the channel.

What I have at the moment is I'm using OBS to capture the OpenVR input (From SteamVR), and I also placed a webcam stream coming from the cameras on the VR headset in the top left corner of the screen, then I use the OBS Windows Projection feature to display the OBS view without actually going live or recording anything, which saves alot of system resources.

What I want to do is find a way that I can combine the audio stream coming from my VR headset, and the OBS projection, into one desktop Window with sound, and have that window be able to be screen shared in Discord, like any other game. That way, if people want to watch me play Beat Saber and breath heavily while doing so, then they can just watch the Screen Share, without them turning me down volume wise on Discord.

I'm very familar with VoiceMeeter, can I use that if requested. The only thing that might be of concern with combining the video and audio is that I might hear myself talking while I play the game, but I might be able to fix by just muting the window in Windows 10 audio settings, and hopefully after that the audio will still be able to be picked up by Discord.

If anyone has any suggestions, I would be be extremely grateful.

Best Answer

I've solved it! I looked around for something like this, and I found out that VLC media player can open capture devices with an audio device, and do it with low latency. What I did was:

  • Install and setup OBS
  • Install OBS VirtualCam plugin. The virtual cam built into the lastest OBS version (26.1.1 as of the time of writing) had some issues for me with VLC, so installing the standalone plugin for OBS worked for me.
  • To get the lowest latency for Discord streaming, open OBS, then go to --> Tools --> VirtualCam --> Buffered Frames --> Drag down to 0.
  • Also enable OBS VirtualCam Autostart if you want to do so with OBS.
  • Press --> Start
  • Install and Open VLC
  • Go to --> Tools --> Preferences --> Input/Codecs --> (Under) Codecs --> Hardware-accelerated decoding --> (Select from the dropdown) DirectX Video Acceleration (DXVA) 2.0
  • Back to Preferences, then on the top select --> Video --> (Under) Display --> Output --> (Select from dropdown) DirectX (DirectDraw) video output See my edit below
  • Then while still in the Video tab, go down to --> DirectX --> (And disable) Accelerated video output (Overlay), and also disable --> Use hardware YUV -> RGB conversions. These settings caused a pink screen for me, but YMMV.
  • Close preferences.
  • In VLC, go to Media --> Open Capture Device --> DirectShow --> Video device name --> (Select from the dropdown) OBS-Camera.
  • While still in the menu, under "Audio device name", select --> OBS-Audio.
  • Click "Show more options" at the bottom of the menu.
  • Set "Caching" to 50ms
  • You can tweak other settings if you wish, such as framerate, audio bitrate, etc, by going into the "Advanced options" tab in the middle of the menu.
  • When you're ready, press "Play at the bottom"
  • When the video and audio window comes up, there might be some audio loopback. To fix this you can either
  • A. Mute the window in the Windows 7/8/10 sound mixer.
  • B. Change the output device in VLC, which is what I did. Just be sure if you're playing videos in VLC when you're not streaming, to change back to audio device output to your headset again. To do this in VLC main screen, select --> Audio --> Audio Device --> (And select a spare Audio device you're not using, which is different for everyone, but for my instance I'll select) Realtek Digital Ouput.
  • Open Discord and Screen share the VLC window, it should show up as "dshow://" in Discord.
  • You're done! You now have you're desktop/game built in with game/mic audio for Discord! And as this is using OBS, you can practically put anything on the screen or sound!

I hope this was helpful for someone, or anyone coming across this in the future.

Edit 1: Setting the Video output back to Automatic seems to give me better results now (Window decorations not visibile in Discord, which is more desirable) so I'd say use that instead.

Edit 2 (IMPORTANT): I found that using VLC, the video was getting compressed, and it came out blurry for me. So what I've decided to do instead is create a Windowed Projection from OBS, then in the Advanced Audio Settings in OBS set your Audio Sources to --> Audio Monitoring --> Monitor and Output. I'm doing this so that Discord can pick up the audio from OBS, while still grabbing the video from the Windowed Projection. The problem is now is that you have feedback loop going now, which is not what you want. So in order to solve that (You need to be running Windows 10) we need to route the audio from the OBS Application from Windows Settings to an alternate not-used audio device. Luckily I have VirtualAudio Cable, so I can just route the audio to Cable-C-Input, but if you don't have that then you can use any unused audio device you want to prevent the feedback loop, such as the mentioned above Realtek Digital Ouput, but then again YMMV.

Related Question