Comments on: CCTV at home or how to lead an Orwellian household https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/ Wed, 07 Jan 2015 22:15:58 +0000 hourly 1 https://wordpress.org/?v=7.1 By: Ben https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-340 Wed, 07 Jan 2015 22:15:58 +0000 http://ben.akrin.com/?p=782#comment-340 In reply to Alex.

I have but this was eons ago. I believe it wasn’t able to move my specific cameras around or there was something else it didn’t do exactly the way I wanted. Recently to save on space I’ve used motion http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome to only record the frames where something happens and it’s quite good but requires a bit of tinkering.

]]>
By: Alex https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-339 Wed, 07 Jan 2015 20:01:00 +0000 http://ben.akrin.com/?p=782#comment-339 Excelent info. Have you tried mindzone.any updates?thank you

]]>
By: Ben https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-338 Mon, 21 Jan 2013 15:49:17 +0000 http://ben.akrin.com/?p=782#comment-338 In reply to Juan.

Really cool! Thanks for sharing.

I’m actually doing things differently now, I’m using Motion to capture only the frames where something happened and at the end of the day using ffmpeg to turn them into a movie.

It certainly removes a TON of captured frames that are irrelevant but as always with motion detection, it’s tricky to make it smart. I think I’m going to go back to the nuclear approach that is recording everything.

Your script is some awesome bash-foo! I’m not sure I like the sleep approach though as it will inevitably build up some lag. Thank you very much for sharing it!

]]>
By: Juan https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-337 Sun, 20 Jan 2013 21:55:52 +0000 http://ben.akrin.com/?p=782#comment-337 Here is my script for recording the files while remuxing on the fly to a mkv file which is indexed and thus you can seek within.

ffmpeg is only remuxing so it is not more of a burden than wget itself and the result can be played by any player. The loop kills the process every hour and starts it up again.

#!/bin/bash
while true
do eval “(ffmpeg -i ‘http://192.168.1.50/videostream.asf?user=admin&pwd=mypasswd&resolution=8’ -acodec copy -vcodec copy `date +%F_%H-%M-%S.mkv`) &”
PID=$!
sleep 3600
kill $PID
done

]]>
By: admin https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-336 Sun, 06 May 2012 19:49:38 +0000 http://ben.akrin.com/?p=782#comment-336 In reply to Matteo.

Don’t quote me on this I’m not a video encoding expert but it is my understanding that these ASF files having been recorded live, they are missing indexing information. Because live video doesn’t have a start and an end by nature. Some post processing can add this indexing information but I’ve never done it. I use mplayer on the mac and navigation through the video is a little funky because of the missing indexes but mplayer does a decent job at figuring things out.

I hope this helps.

]]>
By: Matteo https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-335 Sun, 06 May 2012 15:47:05 +0000 http://ben.akrin.com/?p=782#comment-335 Hello! Great article!

A small question … How do I play videos. ASF? With VLC the movie you can not fast forward …

Thank you!

]]>
By: John Liu https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-334 Thu, 06 Jan 2011 15:10:21 +0000 http://ben.akrin.com/?p=782#comment-334 Thank you so much again for pointing out the incompatibility in the protocols.

I (my Plugbox) spent about 3 hours to build and install the Mplayer-svn package and it worked using the following command

ffmpeg -i rtsp://192.168.1.55:NNN/video.mp4 test.mpeg4 or
ffmpeg -i rtsp://192.168.1.55:NNN/video.mp4 test.avi

I still need to optimize the command options for my purpose.

I will still use your cron job script, thanks for that.

Cheers

]]>
By: admin https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-333 Wed, 05 Jan 2011 21:54:25 +0000 http://ben.akrin.com/?p=782#comment-333 In reply to John Liu.

Well there you have it, RSTP is not HTTP. Wget supports HTTP (among other things) but not RSTP. You need to check if you cam supports video streaming via HTTP or my method won’t work. From what I’m reading about your cam it doesn’t stream on any other protocol than RSTP so my wget based script will not work. This is why they say you need Media Player or Quicktime.

I’m not sure how you would achieve saving the stream on a Linux box with such a restriction. You might be able to command line a VLC/mplayer command that would save the stream. This is going to take some research and might not even be doable.

This is one of the reasons why the FOSCAMs are great, they have very open APIs and standard ways of accessing the stream. I suggest you stop wasting your time on my scripts they’re HTTP centric :

Sorry and good luck.

]]>
By: John Liu https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-332 Wed, 05 Jan 2011 21:27:36 +0000 http://ben.akrin.com/?p=782#comment-332 In reply to admin.

Thanks for your quick response!

1. good to know I don’t need to install any player because there is no readily available for the plugbox yet.

2. I did do a small proof run before going to cron job. the results I presented in my last post was results from a short run.

3. yes, those are the sytax in my wget version, if I use your “&user” and &password way, I got “unauthorized” error. Ys, those are two dashes.

4. Yes, I can stream into my windows RealPlayer and VLC player, but using rtsp://192.168.1.55:NNN/video.mp4. http://192.168.1.55:NNN/video.mp4 or http://192.168.1.55/video.mp4 did not work saying things like “cannot locate the file”

5. when running the job without /dev/null, the job will hang forever saying that

HTTP Request sent, waiting for response

and the generated new file size keeps as 0 unchanged after even 10 minutes. The wget process was not running although it was listed in the ps -l results.

Any other thoughts?

Thank you again!

]]>
By: admin https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-331 Wed, 05 Jan 2011 17:02:31 +0000 http://ben.akrin.com/?p=782#comment-331 In reply to John Liu.

In response to to #1, I do not have any video player installed on my linux server, all that is happening with wget is an HTTP transaction so codec/video player matters are not relevant to just saving the stream on your server.

Now You should try to do a small proof of concept before you turn it into an automated cron, try to run the following commands manually and see if you get some bytes in that file:
wget –http-user=xxxx –http-password=yyyy http://192.168.1.55:NNN/video.mp4 -O cam_`date +%F_%T`.mp4 (you can CTRL+C out of it after a few seconds)

the things that make me half suspicious are the http-user & http-password parameters. On my cam, credentials are passed in the URL through get variables but your cam is different might very well be doing NTLM authentication in which case indeed you’ll need these parameters. Did you make sure you have 2 dashes “-” in front of these parameters?

Did you make sure that you could access the streams directly through a video player like mplayer before you started wgetting them?

The advantage of running the commands manually is that you’ll see what wget says is happening instead of sending everything to /dev/null. It’s important to build complex commands from the ground up.

Try this and let me know what you find, I’ll be happy to help you get it going.

]]>
By: John Liu https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-330 Wed, 05 Jan 2011 03:46:25 +0000 http://ben.akrin.com/?p=782#comment-330 Great job!

But I tried to follow your script to record the MP4 vedio from my LNE3003 IP Camera. I used the following script based on yours – some changes because I running the plugbox linux on Dockstar. I’ve verified the path and file name of the MP4 video file by seeing it on Realplayer on Windows XP.

#!/bin/bash

pkill -9 wget
nohup wget –http-user=xxxx –http-password=yyyy http://192.168.1.55:NNN/video.mp4 -O cam_`date +%F_%T`.mp4 > /dev/null 2>&1 &

After running, it just generate the following empty file

-rw-r–r– 1 root root 0 Jan 4 22:41 cam_2011-01-04_22:41:52.mp4
-rw-r–r– 1 root root 0 Jan 4 22:25 cron.log

Could you please give me some further guidance to make it work? specifically

1. Do you have mplayer or other vedio player installed on your Linux box?
2. my cron job does not start as expected, would you mind to share your cron job script and how you submit the cron job?

Much appreciated!

]]>
By: Barry de Graaff https://ben.akrin.com/cctv-at-home-or-how-to-lead-an-orwellian-household/#comment-329 Sun, 21 Nov 2010 20:37:08 +0000 http://ben.akrin.com/?p=782#comment-329 Nice project!

I created a pure Javascript implementation of the IPCAM CGI SDK 2.1 for Foscam IP Camera’s. It brings support to linux for camera’s that use ActiveX DVM_IPCam2.ocx.

http://www.barrydegraaff.tk/ipcam/

]]>