You are not logged in.

#1 2014-01-15 13:05:08

fjnalta
Member
Registered: 2014-01-15
Posts: 3

Streaming using ffmpeg and excluding some audio

Hello,

i'm trying to stream some games to Twitch.tv with ffmpeg using the script from Archwiki in my .bashrc

streaming() {
INRES="1920x1080"
FPS="20"
CBR="350k"
QUAL="fast"
STREAM_KEY="$1"
URL="rtmp://live.justin.tv/app/$STREAM_KEY" #flashver=FMLE/3.0\20(compatible;\20FMSc/1.0)"

ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0 \
   -f alsa -ac 2 -i pulse -vcodec libx264 -vb "$CBR" -crf 30 -preset "$QUAL" -s "1280x720" \
   -acodec libmp3lame -ab 96k -ar 44100 -threads 0 -pix_fmt yuv420p \
   -f flv "$URL"
}

At the moment, this is working pretty well, except that it is recording the whole sound i'm hearing. Most of the time I want to record in-game sound (pretty often wine) + music (banshee), but exclude my system and Teamspeak sounds. At the same time i wanna hear everything on my headphones.

As you can see in the script im using pulse on top of ALSA. I've already read some Threads about creating a null-sink and loopback-devices in Pulse, but i cant get the job done and I don't know if this is the best way to do this.

Maybe there is a way to grab the sound directly from the applications?

I would prefer a cmd-line based option instead of lots of tools to get it done. As well as i would like to use only ALSA.


I am not very familiar with the sound servers. Any help is appreciated.

Offline

#2 2014-01-17 06:16:22

DrZaius
Member
Registered: 2008-01-02
Posts: 193

Re: Streaming using ffmpeg and excluding some audio

fjnalta wrote:

i'm trying to stream some games to Twitch.tv with ffmpeg using the script from Archwiki in my .bashrc

Can you provide a link so I can exorcise it? I've seen this, or a variant of this script, too many times from various users.

Offline

#3 2014-01-27 21:02:23

fjnalta
Member
Registered: 2014-01-15
Posts: 3

Re: Streaming using ffmpeg and excluding some audio

Hi, sorry for my late reply.

Could you please explain which link you need? The script is seen above. Link: https://bbs.archlinux.org/viewtopic.php … 9#p1371159

I need to grab the sound directly from the application stream with ffmpeg. That should be pretty much it.

Offline

#4 2014-01-27 21:24:41

DrZaius
Member
Registered: 2008-01-02
Posts: 193

Re: Streaming using ffmpeg and excluding some audio

I saw your first post. You mentioned that that script is on "Archwiki". What is the URL?

Offline

#5 2014-01-27 21:32:47

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Streaming using ffmpeg and excluding some audio

Hint - Search wiki for twitch.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#6 2014-01-28 20:19:58

fjnalta
Member
Registered: 2014-01-15
Posts: 3

Re: Streaming using ffmpeg and excluding some audio

anyone got a clue about my problem btw?

Offline

#7 2014-01-31 08:23:27

Jellicent
Member
From: Berlin
Registered: 2013-09-13
Posts: 189

Re: Streaming using ffmpeg and excluding some audio

I'd also be interested in an answer to this. I use only alsa though.

Offline

#8 2014-01-31 09:08:58

progandy
Member
Registered: 2012-05-17
Posts: 5,306

Re: Streaming using ffmpeg and excluding some audio

With pulse you should be able to create dummy sinks which you then can record or merge onto the soundcard, this might help: http://www.maartenbaert.be/simplescreen … ame-audio/

with pure alsa, I don't know how to do it.
Edit: Maybe this will give you some idea: https://bbs.archlinux.org/viewtopic.php?pid=1236286

Last edited by progandy (2014-01-31 09:37:00)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#9 2014-01-31 09:53:53

Jellicent
Member
From: Berlin
Registered: 2013-09-13
Posts: 189

Re: Streaming using ffmpeg and excluding some audio

progandy wrote:

With pulse you should be able to create dummy sinks which you then can record or merge onto the soundcard, this might help: http://www.maartenbaert.be/simplescreen … ame-audio/

with pure alsa, I don't know how to do it.
Edit: Maybe this will give you some idea: https://bbs.archlinux.org/viewtopic.php?pid=1236286

I don't see how that would help, maybe I'm missing something. sad Could you tell me what exactly in that thread you're referring to?

My situation is the following: It records fine. Everything that I can hear is recorded. But I'd like to only record the game sounds for example.

Last edited by Jellicent (2014-01-31 09:56:03)

Offline

Board footer

Powered by FluxBB