Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 23 Nov 2014, 05:11
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Security/Privacy
"mp3looprecord" security recorder
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
greengeek

Joined: 20 Jul 2010
Posts: 2668
Location: New Zealand

PostPosted: Wed 19 Nov 2014, 14:28    Post subject:  "mp3looprecord" security recorder  

(NOTE: I have put this in security as that is my intended use but Flash may move it somewhere else as it can be used for recording of other things too...)


"mp3looprecord" started out as a method for recording security audio from a microphone in a perpetual loop so that I could capture voices 24 hours a day and play them back after a burglary or vandalism. The script itself does not know where it is recording from - the user has to set the audio source in the mixer settings first.

It can can be left running all day or all week collecting audio from whatever audio source is set up in your mixer - allowing you to review the audio later. It will record on-the-fly to mp3 files, and will then start to overwrite the oldest file when it detects that it has reached the end of the storage location free space set by the user.

The .pet installs the main mp3looprecord script in /usr/bin, and also adds a "looprecord_start" and "looprecord_stop" script in /root. (Also adds a HowTo document in /root).

The user defines how much data they want to retain (and therefore how many hours recording is in the loop) by specifying the length of each individual recording, the total number of files they want to keep in the loop, and the mp3 bitrate quality (which affects the total size and quality of the file). See the HowTo for guidance and time calculation.

When the script is first installed it defaults to a short record time and low number of files to allow the user to get familiar and do basic testing.

When you click /root/looprecord_start it brings up a terminal which asks the user where they want to have the record directory stored. I use either /root (on livebooted systems which have plenty of ram) or an external usb stick or usb HDD eg: /mnt/sdb1
(If you have a frugal installation take care not to overfill your savefile if you have chosen not to record to an external location).

When the user is ready to extend the record time for normal use they should set the following parameters in the script:

RECORDINGLENGTH
- This defines the length of each individual recorded segment in seconds. If set to 180 this makes each recorded file 3 minutes long.

MAXFILES
- This defines the maximum number of files that is necessary to capture the required timeframe
yet not exceed available storage area.
- For example: If we wanted to capture a loop of 3 minute files that covered a full day we
would need to set maxfiles to 480 (ie: if using 3 minute files we will generate 20 per hour.
There are 24 hours in the day so we need 20 x 24 files = 480).

#I recommend starting with a low maxfiles number for testing purposes.
#NOTE: I do not recommend using a value of MAXFILES=1. Best to use 2 or
#above to avoid overwriting previous audio too soon.

MP3BITRATE
- This defines the bitrate of the final mp3 encoding.
#"32" gives small file size yet generally acceptable quality.
#"64" can give better audio if you have a good microphone.
#"128" or higher just seems a bit too fancy for my needs...
#Higher settings create large file sizes.

Example: if using a record length of 180 (3 minutes), maxfiles of 480 (24 hours) and
a mp3bitrate of 32 you will require approximately 340MB of free space.

This sounds a lot, but if you are recording to a 4GB or larger usb stick you can cover
quite a long time period

#If bitrate=32 + recordinglength=180 this gives an audio segment size of 704kB
#which covers 3 minutes. Multiply that by 20 to get 1 hour = 14080kB. (= 14MB)
#3mins @ bitrate=32 = 704kB
#1 hour @ bitrate=32 = 14080kB = 14MB
#1 day @ bitrate=32 = 337920kB = 340MB (these figures approximate only)


Thanks to the puppians in this thread who helped me assemble this. More development to come later I hope.
.
mp3looprecord-0.2.pet
Description 
pet

 Download 
Filename  mp3looprecord-0.2.pet 
Filesize  4.52 KB 
Downloaded  8 Time(s) 
Back to top
View user's profile Send private message 
stemsee


Joined: 27 Jun 2013
Posts: 490
Location: London

PostPosted: Thu 20 Nov 2014, 17:09    Post subject:  

hi GreenGreek

This looks really useful. Does it have a stealth mode? Screen off - in background?

cheers
stemsee
Back to top
View user's profile Send private message MSN Messenger 
watchdog

Joined: 28 Sep 2012
Posts: 637

PostPosted: Fri 21 Nov 2014, 01:17    Post subject:  

Is it possible to record only when a new sound is heard? I think to a behaviour like motion detector for webcams: a sound detector. The recording should stop with white noise or fixed sound. It would be easier to review the recording.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2668
Location: New Zealand

PostPosted: Fri 21 Nov 2014, 04:36    Post subject:  

watchdog wrote:
Is it possible to record only when a new sound is heard? I think to a behaviour like motion detector for webcams: a sound detector. The recording should stop with white noise or fixed sound. It would be easier to review the recording.
Yes, this is physically possible but not with this script. While i was developing this I trialled "sox" which allows recording to be triggered by a preset audio threshold. I hope to incorporate that in another script after more testing.

I made some comments and links about sox here
.

Last edited by greengeek on Fri 21 Nov 2014, 04:52; edited 1 time in total
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2668
Location: New Zealand

PostPosted: Fri 21 Nov 2014, 04:47    Post subject:  

stemsee wrote:
This looks really useful. Does it have a stealth mode? Screen off - in background?
Turning the screen off can be a complicated process depending on the type of PC and acpi / dpms settings etc so is beyond the scope of this script. However, I do have a version which runs "quietly" and does not interact with the user onscreen (except in some error conditions). It just ticks along in the background with nothing showing.

The downside of this is that it does not ask the user where they want to store the recording directory (defaults to /root) but it is easy for the user to open the script and manually specify the STORAGELOCATION at the same time as setting the recordinglength, maxfiles and mp3bitrate.

This .pet installs the start and stop files (plus HowTo.txt) in /root (and does not use the script that was in /usr/bin previously). These two files can be placed anywhere (including on a usb stick).

On my PC I find that the screen does go blank when the screensaver timeout occurs, and the recording carries on in the background, so that will be as close to stealth mode as I can get.
mp3stealthrecord-0.1.pet
Description 
pet

 Download 
Filename  mp3stealthrecord-0.1.pet 
Filesize  4.3 KB 
Downloaded  3 Time(s) 
Back to top
View user's profile Send private message 
stemsee


Joined: 27 Jun 2013
Posts: 490
Location: London

PostPosted: Fri 21 Nov 2014, 05:06    Post subject:  

@GreenGeek

Thank you very much. I look forward to testing it out.

stemsee
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Security/Privacy
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 2.6878s ][ Queries: 12 (2.6282s) ][ GZIP on ]