LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 09-08-2011, 02:22 AM   #1
CQ1ST
Member
 
Registered: Oct 2005
Location: NewZealand
Distribution: Crunchbang, Slitaz, Puppy
Posts: 67

Rep: Reputation: 17
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?
 
Old 09-08-2011, 08:37 PM   #2
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,752

Rep: Reputation: 189Reputation: 189
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.
 
Old 09-14-2011, 01:46 AM   #3
CQ1ST
Member
 
Registered: Oct 2005
Location: NewZealand
Distribution: Crunchbang, Slitaz, Puppy
Posts: 67

Original Poster
Rep: Reputation: 17
oh that sux, I recorded myself trying "every" setting in alsamixer and still didn't get good sound

I'm stumped
 
Old 09-14-2011, 07:21 PM   #4
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,752

Rep: Reputation: 189Reputation: 189
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.
 
Old 09-21-2011, 05:09 AM   #5
CQ1ST
Member
 
Registered: Oct 2005
Location: NewZealand
Distribution: Crunchbang, Slitaz, Puppy
Posts: 67

Original Poster
Rep: Reputation: 17
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
recording desktop with ffmpeg tchino Linux - Newbie 6 04-29-2011 03:41 PM
Recording sound as well as video with FFmpeg and x11grab andrew.46 Slackware 3 06-07-2009 02:00 PM
ffmpeg won't build properly mrchaos Linux - Software 9 09-30-2006 07:38 AM
FFMPEG : recording Television broadcast. _UnPrEdictAbLe_ Linux - Software 0 03-14-2006 09:32 AM
Stereo not recording properly with cs46xx using alsa 1.0.5a drivers Electro Linux - Hardware 1 08-08-2004 01:08 AM


All times are GMT -5. The time now is 02:16 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration