logo
background
 Home and Links
 Your PC and Security
 Server NAS
 Wargames
 Astronomy
 PhotoStory
 DVD making
 Raspberry Pi
 PIC projects
 Other projects
 Next >>

Notes index links

Links to all my notes (includes mini-projects and source code etc)

(+) 0001 How do I change the Pi System partition size ?

(+) 0100 Device tree settings

(+) 0201 Power over Ethernet - (PoE)

(+) 0202 Solar Power - (with WiFi)

(+) 0203 Power Bank pass through

(+) 0400 Accessing the SDHC card system image

(+) 0401 Accessing PC shares from the Pi

(+) 0402 Installing samba - (the Pi as a Network Share on your PC)

(+) 0900 Can this approach be scaled up to a PC UPS ?

(+) 1001 Pandora Spotify on the Pi

(+) 1002 Playing movies on the Pi

(+) 1003 Getting VGA from the HDMI socket

(+) 1004 Using the RCA socket

(+) 1005 Using the Pi RS232 serial links

(+) 1006 Using the GPIO pins

(+) 1007 Controlling the Pi Zero ACT LED

(+) 1200 List of standard camera modes

(+) 1300 Auto file names

(+) 6500 How to make the System partition read only ?

(+) 6501 Minimising SDHC corruption on power down

(+) 9000 diode switch

(+) 9001 Auto shut down

(+) 9001 MOSFET switch

(+) C201 High speed photos

(+) Dec 1969 (no desc)

(+) a000 Display setup - (for PhotoFrame)

(+) a001 go photoframe - (how it works)

(+) a002 set photo - (select for display)

(+) a003 go button script - (photoframe pause control)

(+) a005 get photos - (fetch resize)

(+) a00x Other display utilities



(-) c000 CCTV UPS requirements


Avoiding CCTV image loss due to mains power fail

Whilst it's relativly simple matter to add a battery pack to keep the Pi CCTV running, a total mains power failure will likley take out your LAN and all the computers on it.

So, to avoid CCTV being lost due to mains failure, you need to write them to the Pi SDHC card (before sending them across your LAN).

Writing and reading the CCTV

A class 4 card (4mbs = 32mbps) is only just able to cope with HD movie 'one way'. So if you expect your CCTV to deliver 30fps HD resolution, you may have to 'get clever' with RAM disks (since you can't just write to SDHC and then read back from SDHC to the LAN)

A class 10 SDHC will support data rates of at least 10 MB/s (80mbps) with some achieving double that (i.e. 160 mbps, still well within the Pi limit i/o of approx 320mbps). Whilst a class 10 SDHC can support simultaneous reading with writing of two full 1080p data steams, even an over-clocked 1GHz Pi CPU will be hard pressed to find sufficient CPU cycles to do much processing of that data. HD at 1080p, 18mpbs, uses 8 Gb per hour (domestic DVR's typically use half that - which shows how poor the 'broadcast' quality of HD really is ...).

Of course HD data rates depend on the level of compression used. Whilst the Bluray specification supports up to 30Mbps, for standard quality MPEG-4 AVC(h.264) Video at 1080p the data rate will be no more than 18 Mbps (Mega bits per second). For 720p, it will be less than half that (8 Mbps).

The actual Pi HD 1920×1080 data bit-rate is 17Mbs (or about 7.5Gb/Hr), however whilst this can be written direct to SDHC that's without adding any 'headers'. Needless to say, adding .mp4 'wrapper' to a movie clip will require yet more reading and re-writing ('raw' file read, movie with header write) !

However this does let us calcy=ulate that a 32Gb SDHC card  can hold about 2.5 Hrs of movie data - so your UPS battery backed Pi only needs to keep running for that time.

Still frames

Recoding still frames 'raw' (using  'raspistill --raw', which gets you the JPEG with a packed binary RAW data block appended) requires typically 10 MB a shot.

This gives you maximium possible quality CCTV but is going to chew up your SDHC space even faster and a class 10 SDHC is only 'guaranteed' to support 10Mbytes/sec (although many will do 20) so at 'full speed' you will be lucky to get 1 (or 2) shot(s) per second !

If we go for (M)JPEG it's about 2Mbytes per (5M pixel full frame) photo so with the best class 10 SDHC, you could get up to 10 frames a second. However that's going to chew through (2x10x60=1200) over 1Gb a minute (so a 32Gb card will get you less than half an hour).

Of course, to keep the storage requirement down, the Pi can use 'motion detection' - however detecting motion (even with the Pi CPU working off thumbnails - taken at the same time as the 'main' photo**) will result in 5 seconds a frame (rather than 5 frames a second !), so you might be better just storing 'everything' and sorting out the 'motion detection' later.

**For more on the Pi camera modes, see below.

This note last modified: 17th Nov 2017 17:30.

[top]

(+) c001 countering low speed motion detect

(+) c002 Pi Overclocking

(+) c203 Pi ram disk - (tmpfs)

(+) c901 iR illumination

(+) c902 Viewing a video stream

(+) c905 Image anotation

(+) Dec 1969 (no desc)

(+) raspicamdocs.txt (no desc)

(+) s010 Elevation sensing

Next subject :- index

[top]