Skip to content

Instantly share code, notes, and snippets.

@dpacmittal
Created December 6, 2016 15:13
Show Gist options
  • Save dpacmittal/9f0e1aea8a3732d8f7aec7b1dadc8cda to your computer and use it in GitHub Desktop.
Save dpacmittal/9f0e1aea8a3732d8f7aec7b1dadc8cda to your computer and use it in GitHub Desktop.
Create a screencast using ffmpeg with audio recording and webcam capture on bottom right
#!/bin/bash
T="$(date +%d-%m-%Y-%H-%M-%S)".mkv
if [ $# -gt 0 ]; then
if echo $1 | grep '\....$' > /dev/null; then
T=$1
else
T=$1.mkv
fi
fi
# echo $T
ffmpeg -f alsa -i pulse -f x11grab -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -r 25 -i :0.0 -f video4linux2 -i /dev/video0 -filter_complex '[2:v]scale=480:-1[cam];[1:v][cam]overlay=W-w-10:H-h-10' -ab 192 -acodec pcm_s16le -qscale 0 $HOME/Screencasts/$T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment