Page 1 of 1

Is the RPi2 the right Tool for the Job?

Posted: Sun Mar 22, 2015 10:21 pm
by RachelDoe
Hi there, my name is Rachel and i'am at the moment searching for a tool (not necessarily a Rpi) that would do the following Job as convenient and rock-solid as can be.

I will be traveling for a few months in Africa and in the meanwhile i want to have a constant videofeed of my home in the time being.

Here's the Plan:

A 'Microcomputer' in a Waterproof Inclosure equipped with a small 6000mah-Lipo-UPS sits on top of my House on a Pole equipped with a servo-motor that does a 360°-Pan while it captures a 1080p-Video which gets saved in "Directory-X".
A few minutes later a script gets run and encrypts the video-files using "gpgdir"* (https://cipherdyne.org/gpgdir/) and deletes the original video-files leaving only the encrypted ones in the folder.

Than "grive" (http://www.lbreda.com/grive/start) comes into play and syncs the files in the directory to my Google-Drive.
And i'll watch them later a few thousand miles away on my Notebook.


So far so good, but is the Pi2 a good option?
At the moment i own a Pi B Rev2 and an Odroid-W(awesome Board which isn't produced anymore due to an asshat move imo, but a whole another story).
The first one is basically awful in every way possible (power-hungry, high-heat, data-corruption on SD and SLOW AS HELL), the second one fixes most of the problems and has a great emmc-support and therefore no data-corruption and high data-throughput but lacks the Ethernet-Port and would depend on a wireless connection (no problem actually) but is at the end of the day, although better in almost any way thinkable still as slow as your regular PI-B when it comes to encryption.



So what are the candidates to replace them for this (and only this) task?

Odroid C-1 (Quadcore with higher clock-speed than the Pi, no need of silly licenses but probably worse gpu-drivers which could lead to worse performance, but overall possibly the better option for this task???)

RPI-2B (Quadcore with overall slower Clockspeed, way worse I/O-Speed but probably better drivers and hopefully without data-corruption-issues as all the previous Pi's)

BananaPi (propably the least viable option, but i might be wrong?)



I really wish for an honest non-fanboyish answer to this problem, or in short a recommendation for the best-fit mini-computer for this task.

(As honest as somebody that would never recommend a NAS-based Pi due to it's (still) faulty USB/ETH-Design :P )


P.S. i would most-likely use the 5MPx-Picam.




Sincerely, Rachel.

Re: Is the RPi2 the right Tool for the Job?

Posted: Sun Mar 22, 2015 11:27 pm
by davidcoton
Given the views on the RPi B that you have, I think you have answered your own question. Nothing RPi is going to be suitable for you. Whether anything else is better is a different question, which I can't answer and is in any case not appropriate for an RPi forum.

Now, if you want to be impartial and do a proper engineering assessment of the RPi 2B as candidate hardware, ask yourself which factors are relevant, what spec you need, and whether the RPi 2B (or the other options) meet the requirements. That may give a different answer to your initial rant.

Re: Is the RPi2 the right Tool for the Job?

Posted: Sun Mar 22, 2015 11:45 pm
by ame
The Pi is perfect for this job. As are any number of similar systems. Perhaps the best one is a cheap smartphone attached to the pole with duct tape. It's trivial and cheap to try a Pi and see if it works for you.

I'm curious as to why you want a live feed of your home when you are in Africa. You want to watch your house being burgled while you are thousands of miles away and unable to do anything about it?

Re: Is the RPi2 the right Tool for the Job?

Posted: Sun Mar 22, 2015 11:48 pm
by djole94hns
RPi has way bigger and expansive community, and even the slightest detail is explained.
If you have a problem, it would probably be solved by the community in a matter of days, if not hours.

As for build quality and expansive array of add-ons for the board, it is pretty much a clear winner there.
But I see the speed of the ethernet port concerns you... Well, you don't need much more speed than it offers, but if your datastream really IS somehow that demanding, and you absolutely need the additional speed, then go with Odroid.
Or, use a USB ethernet device, just another idea to float around ;)

For such a simple task, even RPi A+ can handle it, really.

And a matter of paid codecs... Well, this one annoys me too, but it's a legal issue... I think there are workarounds on it, but I think I'm not allowed to speak of it here... Different countries, different laws.

Re: Is the RPi2 the right Tool for the Job?

Posted: Sun Mar 22, 2015 11:54 pm
by DavidS
It is to bad that you require HD video and encryption, there are not many options with those requirements. Though if you have two RPi B v2, then you could have one worry about the video and controling what ever motor you use, and use the other for encryption and syncing.

If you could use standard 480i NTSC video, and no encryption (or a less processor intensive encryption), then any 32-Bit MCU based board would do the job (or almost any), and I would say go for a RPi model B.

I do not understand the need for encryption to upload to the private side of your Google Drive account (will not make it any less accessable). And I definitely do not see what advantage you have with HD video over standard NTSC (or PAL), especialy as if you need more detail there will be a good amount of frame overlap thus giving oversampling as a means of getting the fine details.

Though that is just my view, to each there own.

Re: Is the RPi2 the right Tool for the Job?

Posted: Mon Mar 23, 2015 12:08 am
by djole94hns
Oh, forgot to add, you CAN encode H.264 for free:

"H.264 encode

Alongside MPEG-2 support (which you’ll have to pay for), we’re making H.264 encode available for free. The hardware has always been capable of supporting H.264 encode, but we were under the misapprehension that encode required an additional licence fee, so were waiting until the camera board release (which is still coming later in the year) before spending the money to enable it.

During the course of talking to the MPEG LA about the MPEG-2 licence, we discovered that the existing licence fee that is already baked into the cost of the Raspberry Pi actually covers both encode and decode – I tell you, this stuff is arcane – so we’ve enabled the relevant OpenMAX components by default in the latest firmware. It may take a while for someone to produce an encoder application which uses these components, but once they do you should be able to use the Pi as a standalone transcoder."

Re: Is the RPi2 the right Tool for the Job?

Posted: Mon Mar 23, 2015 12:19 am
by plugwash
SD card behaviour is very dependent on the card in question, genuine samsung and sandisk seem to be the best bet. Make sure you buy them from reputable vendors though.

How big are the files? are they small enough that you could store them on a ramdrive then that would massively reduce the wear and tear on the card.

If you have an ethernet cable in place then i'd reccomend dumping the battery and setting up a "ghetto POE"* setup. Boards like this are low power compared to a desktop PC but are still power hungry enough that running them off batteries long term is a PITA.

* Basically split the spare pairs off from the ethernet cable and hook up a 24V power supply to one end and a stepdown converter to the other.

Re: Is the RPi2 the right Tool for the Job?

Posted: Mon Mar 23, 2015 8:52 am
by RachelDoe
Hey great to see so many replying already :shock: :)

I've probably made an error when i wrote about a "video-feed", i DON'T want a live-connection streaming a 1080p Video, to be honest i doubt that even a full-blown Computer would be able to do that 24/7 on an Internet-Connection with about 5Mbit-Upstream.

What i want is that the "Pi" or any Mini-Computer that would fit into a waterproof-Case for that matter, to be able to record 1080p(or 720p@60)-Video, save it in a predefined directory, and before uploading it to my Google-Drive (i don't want private Data laying around on my GDrive for that matter to be honest, at least not unencrypted), encrypt it using gpg.

The Question really is, how is the encryption-performance on the RPi2 using gnupg (would be awesome if someone could try it out for me :))

The File-size would probably be around the 100-200mb at best per file, probably less regarding this video here and the stated information in the Video-description:
PiCam 1080P:

12000kb/s | 87.89 MB/min | 5.15 GB/hour
10000kb/s | 73.24 MB/min | 4.29 GB/hour
8000kb/s | 58.59 MB/min | 3.43 GB/hour
6000kb/s | 43.95 MB/min | 2.57 GB/hour
4000kb/s | 29.30 MB/min | 1.72 GB/hour
3500kb/s | 25.63 MB/min | 1.50 GB/hour
3000kb/s | 21.97 MB/min | 1.29 GB/hour
2000kb/s | 14.65 MB/min | 0.86 GB/hour
1500kb/s | 10.99 MB/min | 0.64 GB/hour
1200kb/s | 8.79 MB/min | 0.51 GB/hour
1000kb/s | 7.32 MB/min | 0.43 GB/hour
800kb/s | 5.86 MB/min | 0.34 GB/hour

https://youtu.be/hpU6oAQoTSg
Although i probably would go with a 720p-Video in 60fps and moderate Bitrate rather than 1080@30, especially on a moving pole.

BTW.
I've just tested the time it takes on my Rpi-B Rev.2 and it took about 3minutes to encrypt a video-file of about 130MB of size, so not all that bad as i though it would be, only problem is that it has the "random data-corruption" issue, as data-corruption on an encrypted file leaves nothing but garbage this is a mayor NO-NO..... :(

As far as i know gpg can't take all that much use of multiple cpu-cores and therefore the clockspeed could make quite a difference here, i really don't wanted this to sound like a rant-thread by talking about the "Odroid-C1" as i know that here are very capable people that have also used other S.B.C's aside of the Rpi's and therefore know it's pro's&con's better than i do by quite a bit ;)



P.S. the "servo" won't be controlled by the "SBC" nor is it a necessity at all.
It is controlled by an Arduino-Nano which is connected to a timer-switch that runs for 2-3min. and then switches off in which in the meantime the S.B.C. will take a video.

The longer "run-time" of the servo is to account for time-differences that could happen due to not perfectly synced starts of each individual device.
And the single-board-computer isn't meant to be accessible from the outside of the WWW, it really should just do the recording to a given time of the day, two times a day, encrypt the files and sync them with the Googledrive, nothing more :)
And every 1-2weeks completely removes the directory-contents using a cron-job to free up space on the limited G-Drive.



Nothing fancy if you ask me, hope that helps, clarifying things. :D



Sincerely, Rachel.

Re: Is the RPi2 the right Tool for the Job?

Posted: Mon Mar 23, 2015 9:02 am
by pluggy
I trust you're not expecting it to run for "a few months" on a 6Ah battery ?

Re: Is the RPi2 the right Tool for the Job?

Posted: Mon Mar 23, 2015 9:06 am
by RaTTuS
The RPi and the foundation camera will do HD video encoded as h264 no worries
you can easily setup cron to run hour long videos to be uploaded elseware .

i.e.
0 * * * * /usr/bin/raspivid -vf -op 125 -fps 2 -t 3540000 -o /Timelapse/`/bin/date +\%w:\%H`.h264 #acually 59 mins but can be changed obviously

Re: Is the RPi2 the right Tool for the Job?

Posted: Mon Mar 23, 2015 9:09 am
by RachelDoe
Don't be silly, of course not :lol:
It's just meant as backup if there is a electricity blackout in the time beeing.


As far as iam concerned it would be connected this way.
5V@5A PSU ---> 6000mAh Powerbank --> RPI/ODROID/BANANA/whatever..
The Powerbank has a 2A output which should be more than enough, as there isn't all that much going on most of the time.



Sincerely, Rachel.

Re: Is the RPi2 the right Tool for the Job?

Posted: Tue Mar 24, 2015 9:43 pm
by RachelDoe
*BUMP*

Could someone possible check how long it takes to encrypt a random-file of lets say 100MB using GPG?
Would be highly appreciated, as i would like to know this before possible ordering a RPi-2B.


Furthermore, could someone check how the Transfer-Performance using SCP/SSH over Ethernet is?
On the RPI-1 it maxes out at 3MB/s.
Does it perform better on the RPi2?



Sincerely, Rachel.

Re: Is the RPi2 the right Tool for the Job?

Posted: Tue Mar 24, 2015 11:16 pm
by DougieLawson
Here's the test I ran
sudo modprobe bcm2708-rng # load the HW random number generator
sudo apt-get install rng-tools
edit /etc/default/rng-tools to use /dev/hwrng
gpg --gen-key

dd if=/dev/hwrng of=/tmp/random.data count=1000 bs=100 # make 100K of random stuff
gpg

Code: Select all

pi@eagle:/tmp$ time  gpg -r redacted@gmail.com -e  random.data

real  0m0.166s
user  0m0.070s
sys   0m0.020s
pi@eagle:/tmp$
It'll take a little longer with count=100000 bs=1000 ... watch this space.

Code: Select all

pi@eagle:/tmp$ time  gpg -r redacted@gmail.com -e  random100M

real  0m52.439s
user  0m40.380s
sys   0m1.620s
pi@eagle:/tmp$

Re: Is the RPi2 the right Tool for the Job?

Posted: Tue Mar 24, 2015 11:37 pm
by DougieLawson
The speed of the ethernet on the RPi1 vs the RPI2 is identical. It's the same SMSC9514 chip on both systems.
You can go faster with a USB gigabit ethernet adapter.

Re: Is the RPi2 the right Tool for the Job?

Posted: Fri Jun 05, 2015 2:45 am
by groovmuffn
Any updates on this project?

I'm working on something similar, though in my case I'll be working with 1080p h264 via picamera. Trying to figure out a solution for encrypting this recorded video but want to make sure that the Pi is up for the job. Recording times will vary...sometimes a half hour and sometimes upwards of 6 or 7 hours.

For me its more a matter of efficiency and ease. The video being encrypted is just for protocol of space I'll be in. Thus I am wondering does encryption happen during recording, after recording, or would it be more efficient to encrypt a folder the video file will go in (or is that even possible to encrypt the folder and not the files inside?)?

In any case...super curious to see how your setup turned out.