foscam fi8918w – how to record video

I am using a simple solution to record video from my foscam FI8918W using a free tool – VLC.

Install vlc for free: http://www.videolan.org/vlc/

the command that runs VLC in record mode is: (be sure you have all on one line)

vlc -vvv „http://host:port/videostream.cgi?user=xyz&pwd=abc” –no-sout-audio –sout „#std{mux=ts,access=file,dst=/VIDEOFOLDER/$(date +%y-%m-%d-%H-%M).m4v}” –run-time 86400 –stop-time=86400 vlc://quit

this will run vlc for 24 hours encoding and writing the stream to /VIDEOFOLDER/ folder, after 24 hours it will stop vlc.

the full script for linux looks like:

#!/bin/bash
for ((  i = 0 ;  i <= 480;  i++  ))
do
vlc -vvv "http://host:port/videostream.cgi?user=xyz&pwd=abc" --no-sout-audio --sout
"#std{mux=ts,access=file,dst=/VIDEOFOLDER/$(date +%y-%m-%d-%H-%M).m4v}"
--run-time 86400 --stop-time=86400 vlc://quit
done

This will run the vlc for 480 days creating a file for each 24 hours.

The windows script should be similar.

Anunțuri

~ de chipuitorul pe Octombrie 4, 2011.

2 răspunsuri to “foscam fi8918w – how to record video”

  1. Excellent idea!
    I prefer this bash scripts:

    #!/bin/bash

    MINUTES=$(date +%M)
    echo $MINUTES
    HOUR=60
    let LEFT=$HOUR-$MINUTES
    echo $LEFT
    let FIRSTTIME=$LEFT*60
    for ((;;))
    do
    if [ $LEFT -gt 0 ]; then
    vlc -vvv „http://hostname:port/videostream.cgi?user=username&pwd=password&resolution=32&rate=11” –no-sout-audio –sout „#std{mux=avi,access=file,dst=/pathname/$(date +%Y%m%d-%H%M).avi}” –run-time $FIRSTTIME –stop-time=$FIRSTTIME vlc://quit
    fi
    for (( i = 0 ; i <= 24; i++ ))
    do
    vlc -vvv "http://hostname:port/videostream.cgi?user=username&pwd=password&resolution=32&rate=11&quot; –no-sout-audio –sout "#std{mux=avi,access=file,dst=/pathname/$(date +%Y%m%d-%H%M).avi}" –run-time 3600 –stop-time=3600 vlc://quit
    done
    done
    exit 0

    and for stop:

    kill -9 `ps x | pgrep vlc`

    Of course if you want start recording when alarm on use:

    #!/bin/bash

    for (( ;; ))
    do
    result=`lynx -dump -auth=Adminuser:password http://hostname:port/get_params.cgi | grep alarm_motion_armed`

    if [ ${result:23:1} = 1 ]; then
    vlcon=`ps x | pgrep vlc`
    if [ -z $vlcon ]; then
    vlc -vvv "http://hostname:port/videostream.cgi?user=username&pwd=password&resolution=32&rate=11&quot; –no-sout-audio –sout "#std{mux=avi,access=file,dst=/pathname/$(date +%Y%m%d-%H%M).avi}" –run-time 3600 –stop-time=3600 vlc://quit
    fi
    else
    VLCon=`ps x | pgrep vlc`
    if [ -z $VLCon ]; then
    echo VLC not started
    else
    kill -9 `ps x | pgrep vlc`
    fi
    fi
    sleep 3
    done

    exit 0

Lasă un răspuns

Completează mai jos detaliile tale sau dă clic pe un icon pentru a te autentifica:

Logo WordPress.com

Comentezi folosind contul tău WordPress.com. Dezautentificare / Schimbă )

Poză Twitter

Comentezi folosind contul tău Twitter. Dezautentificare / Schimbă )

Fotografie Facebook

Comentezi folosind contul tău Facebook. Dezautentificare / Schimbă )

Fotografie Google+

Comentezi folosind contul tău Google+. Dezautentificare / Schimbă )

Conectare la %s

 
%d blogeri au apreciat asta: