Skip to content

Instantly share code, notes, and snippets.

@cjbarroso
Created May 4, 2020 04:20
Show Gist options
  • Save cjbarroso/4d6cfc5ce8d8017fa8a61f5eac8eedb8 to your computer and use it in GitHub Desktop.
Save cjbarroso/4d6cfc5ce8d8017fa8a61f5eac8eedb8 to your computer and use it in GitHub Desktop.
#! /bin/sh
#
# videolog.sh
# Copyright (C) 2020 charlie <carlos@cjbarroso.com>
#
# Distributed under terms of the MIT license.
# Records a 10 seconds work log for posterity
# To be used with voice commands from Mycroft
OUTDIR="${HOME}/Audiologs"
FILENAME=$(date +%Y%m%d%H%M%S).mp4
LENGTH=10
LINE="#duplicate{dst=display,dst=\"transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:file{dst=${OUTDIR}/${FILENAME}}\"}"
echo Recording to $FILENAME for $LENGTH seconds...
LC_NUMERIC=C timeout ${LENGTH} cvlc v4l2:///dev/video0 :input-slave=pulse:// --sout $LINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment