Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
bashologist
On another computer it's working fine except the sound's very low and sounds terrible. Is it supposed to sound like that?
There can be many reasons for this, and it depends on your source of audio (mic? system audio?). Again, have you checked input/output volumes?
How did your commandline look like? Posting it here might help.
If audio options get misplaced in the commandline, you might end up recording to mp2 (which is the default in ffmpeg) and therefore end up with terrible quality audio.
EDIT: and no, it's not supposed to sound like that. (unless your mic is of low quality, like the ones integrated with laptops)
Re: HOWTO: Proper Screencasting on Linux
Trying to record system sounds. The command line for testing I used was actually pretty complicated for just a test lol. This is from my $HISTFILE.
Code:
output=$(tempfile -s .mp3)
mplayer -ao alsa:device=hw=0.0 /usr/share/sounds/alsa/*.wav &> /dev/null < /dev/null &
sleep 1
ffmpeg -f alsa -ac 2 -i hw:0,0 -ab 320k -y "$output" &> /dev/null < /dev/null &
sleep 5
kill -2 %1 %2
sleep 1
mplayer "$output" &> /dev/null < /dev/null
Also tried with flac etc... The sound is hearable if I turn my volume up about 200%. It's also very staticy. I redirected the stderr but there's no errors or warnings with ffmpeg. Tried with "-i pulse". Can't think of anything else to test. Maxed out everything in alsamixer and sound preferences.
Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
bashologist
Trying to record system sounds. The command line for testing I used was actually pretty complicated for just a test lol. This is from my $HISTFILE.
Code:
output=$(tempfile -s .mp3)
mplayer -ao alsa:device=hw=0.0 /usr/share/sounds/alsa/*.wav &> /dev/null < /dev/null &
sleep 1
ffmpeg -f alsa -ac 2 -i hw:0,0 -ab 320k -y "$output" &> /dev/null < /dev/null &
sleep 5
kill -2 %1 %2
sleep 1
mplayer "$output" &> /dev/null < /dev/null
Also tried with flac etc... The sound is hearable if I turn my volume up about 200%. It's also very staticy. I redirected the stderr but there's no errors or warnings with ffmpeg. Tried with "-i pulse". Can't think of anything else to test. Maxed out everything in alsamixer and sound preferences.
When recording system sound, maxing out volume above 100% might result in some statics. It's better if you record with the normal volume and then increase the volume with ffmpeg. Also, it's better to explicitly set the audio codec on the command line.
So, what I suggest is replacing your commandline with this one:
Code:
ffmpeg -f alsa -ac 2 -i hw:0,0 -acodec pcm_s16le -vol 400 -y output.wav
Note the -vol 400 to increase the audio volume, you can change this value up or down according to your desired amplification. Also note that we used pcm instead of mp3, becuase it's always better to record in lossless first and then do the compression to mp3 later.
One question though, how did you get -i hw:0,0 to record system audio? :)
Doesn't that usually record mic input?
Re: HOWTO: Proper Screencasting on Linux
Edit: Got everything working on one of my computers. Just didn't follow the great guide well enough.
Edit 2: Yay, got it working on both computers. My first problem where I manually installed a new alsa was solved by adding the below lines to /etc/asound.conf.
Code:
pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}
These lines may need to be manually added after you manually install alsa.
Re: HOWTO: Proper Screencasting on Linux
*Updated the guide with info on how to use mkvmerge concatenation as an alternative of pausing/resuming.
Re: HOWTO: Proper Screencasting on Linux
Can’t you send SIGSTOP the process? Would be easy to assign a shortcut to that.
Code:
pkill -f -s STOP ffmpeg.*x11grab
pkill -f -s CONT ffmpeg.*x11grab
Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
hugmenot
Can’t you send SIGSTOP the process? Would be easy to assign a shortcut to that.
Code:
pkill -f -s STOP ffmpeg.*x11grab
pkill -f -s CONT ffmpeg.*x11grab
Didn't seem to work properly. Also, your syntax didn't work for me:
Code:
pkill: invalid session id: STOP
Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
verb3k
Didn't seem to work properly. Also, your syntax didn't work for me:
Code:
pkill: invalid session id: STOP
Sorry for that. I mixed the syntax of killall and pkill.
Try this:
Code:
pkill -f -STOP ffmpeg.*x11grab
pkill -f -CONT ffmpeg.*x11grab
Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
hugmenot
Sorry for that. I mixed the syntax of killall and pkill.
Try this:
Code:
pkill -f -STOP ffmpeg.*x11grab
pkill -f -CONT ffmpeg.*x11grab
That also doesn't work :p:
Code:
pkill: invalid option -- 'S'
However changing to "pkill -STOP ffmpeg" does stop the recording, but the output file is wrecked (Pause time still recorded showing the last frame before the pause). I think mkvmerge is a safer solution until ffmpeg supports concatenation or pausing the encode :)
Re: HOWTO: Proper Screencasting on Linux
Quote:
Originally Posted by
verb3k
That also doesn't work :p:
Code:
pkill: invalid option -- 'S'
However changing to "pkill -STOP ffmpeg" does stop the recording, but the output file is wrecked (Pause time still recorded showing the last frame before the pause). I think mkvmerge is a safer solution until ffmpeg supports concatenation or pausing the encode :)
Gah! Ya, the -f has to come before the process regex. Scusa.
But when you encode the second time around it drops the idle time. And mplayer skips it during play.