Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #check if microphone is enabled and soundcard captures
- cap=`amixer get Capture | grep -c '\[off\]'`
- if [ $cap -gt 0 ]; then
- echo "microphone not enabled"
- exit 1
- fi
- # select window and get position
- echo 'Please select the window you want to record'
- tmp=`mktemp`
- xwininfo >$tmp
- posx=`grep 'Absolute upper-left X:' $tmp | cut -d':' -f2 | tr -d ' '`
- posy=`grep 'Absolute upper-left Y:' $tmp | cut -d':' -f2 | tr -d ' '`
- width=`grep 'Width:' $tmp | cut -d':' -f2 | tr -d ' '`
- height=`grep 'Height:' $tmp | cut -d':' -f2 | tr -d ' '`
- rm $tmp
- # start recording
- #ffmpeg -f x11grab -r 25 -s ${width}x${height} -i :0.0+${posx},${posy} -f alsa -ac 1 -ar 44100 -i default:CARD=PCH -c:v libx264 -crf:v 0 -preset:v ultrafast -c:a flac grab.mkv
- # pulseaudio: micro and system sound
- ffmpeg -f x11grab -r 25 -s ${width}x${height} -i :0.0+${posx},${posy} \
- -f pulse -i default \
- -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor \
- -map 0:0 -map 1:0 -map 2:0 \
- -c:v libx264 -crf:v 0 -preset:v ultrafast \
- -c:a flac \
- -c:a flac \
- grab.mkv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement