~voidraven/s4

de37bf27a9617590ff0be2f4bdf7b7031e193d52 — lotus 2 years ago 3bf2d1c
video format as a variable now; avi. expect /dev/video0 as webcam.
1 files changed, 5 insertions(+), 4 deletions(-)

M .s4/watch.sh
M .s4/watch.sh => .s4/watch.sh +5 -4
@@ 5,8 5,8 @@

# ID is the camera number (0-n)
ID=XXX
# Grabs the first available webcam (typically /dev/video0)
WEBCAM="/dev/$(ls /dev | grep video)"
# We expect /dev/video0 to be the webcam
WEBCAM="/dev/video0"
# Example valid resolutions: 640x480, 1280x720, or 1920x1080
REZ=YYY
# Your networked storage location


@@ 22,6 22,7 @@ S4_LOG_DIR="$HOME/.s4/s4.log"
FF_ARG_STD="-hide_banner -nostats -loglevel fatal"
FF_ARG_LOG="-loglevel warning"
#FF_ARG_DBG=""
FF_FORMAT="avi"
# Logging disabled by default
# ( to enable change to "true" )
S4_LOG_ENABLED="NO-S4-LOGGING"


@@ 41,7 42,7 @@ fun_record () {
    fun_set_true
    L_VIDNAME=$1
    # -y flag means always overwrite
    ffmpeg -y $FF_ARG_STD -framerate $FRAMERATE -video_size $REZ -i $WEBCAM "$CACHE_DIR/$L_VIDNAME.mkv" &
    ffmpeg -y $FF_ARG_STD -framerate $FRAMERATE -video_size $REZ -i $WEBCAM "$CACHE_DIR/$L_VIDNAME.$FF_FORMAT" &
}

# stop the camera


@@ 51,7 52,7 @@ fun_stop () {
    fun_set_false
    kill $(pidof ffmpeg)
    if ! [ -z "$L_FTBC" ] ; then
	cp $CACHE_DIR/$L_FTBC.mkv $STORAGE/s4/cameras/$ID/$L_FTBC.mkv &
	cp $CACHE_DIR/$L_FTBC.$FF_FORMAT $STORAGE/s4/cameras/$ID/$L_FTBC.$FF_FORMAT &
    fi
}