config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

screen-capture (652B)


      1 #!/bin/sh
      2 
      3 readonly RESOLUTION="$(xrandr --current | grep '*' | uniq | awk '{print $1}')"
      4 readonly OUTPUT="file:$(date '+%Y-%m-%dT%H:%M:%S%:z').mp4"
      5 
      6 if [ "$1" = "audio" ]; then
      7   >&2 echo "capturing audio"
      8 
      9   ffmpeg -video_size "${RESOLUTION}" \
     10        -f x11grab \
     11        -i :0.0 \
     12        -f pulse \
     13        -ac 2 \
     14        -i default \
     15        -c:v libx264 \
     16        -profile:v baseline \
     17        -level 3.0 \
     18        -pix_fmt yuv420p \
     19        "${OUTPUT}"
     20 else
     21   >&2 echo "not capturing audio"
     22 
     23   ffmpeg -video_size "${RESOLUTION}" \
     24 	 -f x11grab \
     25 	 -i :0.0 \
     26 	 -c:v libx264 \
     27 	 -profile:v baseline \
     28 	 -level 3.0 \
     29 	 -pix_fmt yuv420p \
     30 	 "${OUTPUT}"
     31 fi