You are not logged in.
Pages: 1
I'm trying to record my desktop (or single programs) with ffmpeg. The video quality is okay (would be better, if I had a better pc, I guess), but somehow, I cannot record any audio. I did it with
$ ffmpeg -s 1280x1024 -r 30 -f x11grab -i :0.0 -acodec libmp3lame -ab 128k -vcodec mpeg4 -sameq -y testtestaudio.mp4
or
$ ffmpeg -s 1280x1024 -r 30 -f x11grab -i :0.0 -acodec libfaac -ab 128k -vcodec mpeg4 -sameq -y testtestaudio.mp4
but I always get a result like that:
video:9956kB audio:0kB global headers:0kB muxing overhead 0.036333%
which means, that ffmpeg didn't record the audio output.
I don't know where to start to get the audio problem fixed. Has anyone a similiar problem or does someone know, why it does not record? Do you need any more information from me?
Offline
I might be wrong, but I think you have to specify audio source like alsa or pulse. It's been a while since I did it though.
Offline
yep, try with "-i pulse" or similar with the audio
Offline
I had the same issue when recording games within X11. No matter what I tried...I was unable to record sound. I found rec (from SOX) working nicely though.
I "solved" my issue by writting a simple shell script which first launches rec in the background, then starts ffmpeg for X11 recording and automatically muxes the streams afterwards. I can post the script this evening if you like.
My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick
Offline
you could also try pure audio, assuming you have pulse
$ffmpeg -f alsa -ac 2 -i pulse test_pure_audio.mp3
adding output options i you want better quality
I think if you use pure alsa, it only records from mic, not internal sound [i vaguely remember that being why I installed pulse] maybe someone else can clear that up
Offline
@Darksoul71: Thanks, I'll ask for it, if everything fails.
@hume's doona: You might be right with pulse. Alsa didn't record anything. I try it with pulse later (on an other system, because my "main" system has some problems with pulseaudio in general, might be, because KDE [4.5] doesn't like pulse).
Offline
ChemBro, feel free to send me an e-mail if nothing helps. I remember that even when using rec from SOX it was very important to use the right switch in the ALSA mixer. I guess it was something like recmix source ?
May be you simply need to enable a switch or crank up a certain mixer ?
I guess in the first place hume's doona is right: Try to record solely audio first before heading on with desktop recording.
My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick
Offline
I tried to record audio only in Kubuntu, because they have PulseAudio enabled by default and I can't get PulseAudio working in my testing system (with KDE 4.6 --> no sound at all). I did it with
ffmpeg -f alsa -ac 2 -i pulse -acodec libmp3lame -ab 128k sometestfile.mp3
No error message, but the resulting audio-file doesn't have any sound. :-/
I don't get PulseAudio and I don't get ffmpeg recording no sound.
I wish, there was an option the record programs with video and audio like glc does it with OpenGL/ALSA programs, besides the workaround from Darksoul71.
Offline
I already sended ChemBro my script via e-mail but it might be also interesting for someone of you:
# -V0 means verbosity level 0 for the rec command of SOX.
/usr/bin/rec /home/hb/t_game.wav -V0 &
/usr/bin/ffmpeg -f x11grab -y -r 15 -s 864x640 -i :0.0 -vcodec huffyuv /home/hb/t_game.avi
#/usr/bin/ffmpeg -f x11grab -y -r 15 -s 688x544 -i :0.0 -vcodec huffyuv /home/hb/t_game.avi
#/usr/bin/ffmpeg -f x11grab -y -r 15 -s 688x544 -i :0.0 -vcodec mjpeg /home/hb/t_game.avi
# Do a hard kill for rec after ffmpeg's X11 recording session has ended
killall /usr/bin/rec
/usr/bin/mencoder -ovc copy -oac copy -audiofile /home/hb/t_game.wav -o /home/hb/game.avi /home/hb/t_game.avi
rm /home/hb/t_game.avi
rm /home/hb/t_game.wav
You have of course to adjust the output path for audio and video. I couldn´t make rec really "silent" and you´ll see the volume meter being written to the console. Not nice but it works....:D
My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick
Offline
Pages: 1