Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to steam some Dota 2 (via Wine) casts to Twitch using this shell script I found online:

#!/bin/bash

STREAM_KEY="(redacted)"
FPS="30"
INRES="1600x900"
OUTRES="1280x720"
QUAL="medium"

avconv \
  -f x11grab -s $INRES -r "$FPS" -i :0.0 \
  -f alsa -ac 2 -i pulse \
  -vcodec libx264 -s $OUTRES -preset $QUAL \
  -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b 712000 -bufsize 512k \
  -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"

It streams the video fine, but I only get audio from my plugged in microphone and no audio from Dota 2. This wouldn't be terrible if I only cared about getting the sound effects, but I am sometimes co-casting with other people using the built-in voice chat, and since I am not getting any of their audio, it sounds like I am a madman.

I could try and use an external program for voice chat, but I don't really want to force any of my random co-casters to set it up on their end. So I'd like to be able to pipe both the Wine audio and my microphone audio to the stream.

share|improve this question

1 Answer 1

You can do this by creating a null-sink and two loopback connectors:

pactl load-module module-null-sink
pactl load-module module-loopback
pactl load-module module-loopback

To configure those channels you need the pavucontrol tool (sudo apt-get install pavucontrol).

  • On the Playback tab select "All streams" and redirect the loopback streams to "Null output".

  • Then go to the "Recording" tab and also select "All streams". You should see both loopbacks again.

  • Set one to "Analog Stereo Internal Audio" (the microphone) and set the other one to "Analog Stereo Internal Audio Monitor" (the audio output).
  • After running your script you should see the avconv process in the list on the "Recording" tab. Set it to recording from "Null Output Monitor".

Soure

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.