LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   ffmpeg recording desktop audio properly (https://www.linuxquestions.org/questions/linux-desktop-74/ffmpeg-recording-desktop-audio-properly-901772/)

CQ1ST 09-08-2011 02:22 AM

ffmpeg recording desktop audio properly
 
Hi, I'm recording my desktop with this ffmpeg command:
Code:

ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 30 -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}')
-i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 -y output.mkv

and although it's working, I'm getting tinny, far-away sounding audio.
Is there a way to more directly capture the sound or just get it sounding good?

teckk 09-08-2011 08:37 PM

Make sure that you have the record volume controls turned up. Could be called ogain, igain, pcm1, rec etc. depending on your sound system. Gmixer does a good job showing all of them.

Your command looks fine. Bet it's a volume control.

CQ1ST 09-14-2011 01:46 AM

oh that sux, I recorded myself trying "every" setting in alsamixer and still didn't get good sound

I'm stumped

teckk 09-14-2011 07:21 PM

Since you're having problems with the audio you might try to troubleshoot just it.
Launch ffmpeg with
Code:

ffmpeg -f alsa -i hw:0,0 -vn -acodec libmp3lame -ab 128k capture.mp3
or
Code:

ffmpeg -f alsa -i /dev/dsp -vn -acodec libmp3lame -ab 128k capture.mp3
Then play a media file or speek into your mic. That will get you 128k mp3 audio that any Linux or BSD box should do. Eliminate pcm or x264 as a cause. If you still don't have audio then find that mixer control that isn't up.

CQ1ST 09-21-2011 05:09 AM

Hey, thanks for your help but I'm not getting good results from linux. I guess it's a problem with alsa, but I can't really be fussed installing gstreamer, trying oss or fixing the audio with audacity, so I'll prolly just try windows (when it's convenient to do so) -it's not a high priority, I just wanted to record some streaming tv at dw-world (tomorrow today, if you're interested) but I can just watch it once, 'cause I'm not fussed


All times are GMT -5. The time now is 12:09 PM.