Created
December 8, 2020 14:40
-
-
Save ericherman/6a5ccffabc59aa6d28ec30fbdcb6f7e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DEV_VIDEO=v4l2:///dev/video2 | |
# aplay -l | |
DEV_AUDIO=alsa://hw:3,0 | |
err() { | |
echo >&2 "ERROR: $*" | |
exit 1 | |
} | |
command -v cvlc &>/dev/null || err "cvlc command not found" | |
VIDFILE="${HOME}/cam_$(date +'%Y.%m.%d_%H.%M.%S')_rec.mp4" | |
echo $VIDFILE | |
cvlc ${DEV_VIDEO} \ | |
:input-slave=${DEV_AUDIO} \ | |
--sout="#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}\ | |
:file{dst=${VIDFILE},no-overwrite}" \ | |
--no-sout-all --sout-keep | |
echo $VIDFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment