You are not logged in.

#1 2012-09-17 15:29:21

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 341
Website

ffmpeg screencast usb headset audio output

Hi

I been trying for a while to suss how to get the audio from my USB headset mic to show on ffmpeg screencast i found this command elsewhere on these forums and it works like a charm

ffmpeg -v 1 -r 25 -f x11grab -s 3840x1080 -i :0.0+0,0 -vcodec libx264 cast1.mkv

now id really like to know how to enable audio from headset asound/cards shows it as   
2 [Headset        ]: USB-Audio - HP Premium Digital Headset   >  Hewlett-Packard HP Premium Digital Headset at usb-0000:00:1d.0-2, full speed│ and asound.devices shows   9: [ 0- 2]: digital audio capture .
arecord -l   shows card 2: Headset [HP Premium Digital Headset], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Regards
cirrus

Last edited by cirrus (2012-09-17 15:45:23)

Offline

#2 2012-09-17 19:44:01

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

Re: ffmpeg screencast usb headset audio output

Try adding "-f alsa -i hw:2" as in:

ffmpeg -v 1 -r 25 -f x11grab -s 3840x1080 -i :0.0+0,0 -f alsa -i hw:2 -c:v libx264 -preset ultrafast -crf 0 -c:a pcm_s16le cast1.mkv

If that does not work see Capturing audio with FFmpeg and ALSA for another method. I also added " -preset ultrafast -crf 0" for a lossless encode. It is generally faster (as in more likely to be able to reach your desired fps) than using x264 to create an lossy output when using x11grab as your original command does. The output file may be large, but you can easily re-encode it. I also added "-c:a pcm_s16le" otherwise ffmpeg may default to libvorbis (or maybe flac IIRC) as the encoder for mkv output.

Please format console outputs with the code tag (the arecord output). It makes it easier to read.

Offline

Board footer

Powered by FluxBB