|
| Author |
Message |
mjnavapo Member
Joined: 21 Aug 2008 Posts: 10
|
Posted: Thu Aug 21, 2008 2:39 pm Post subject: Store in imangenes FTP with AXIS 207 |
|
|
Hello, I have a Camera IP Axis 207 when configured to detect movement save a JPG image in my FTP server.
The problem is that stores all in one folder.
Is there any way for the camera generates subfolders and save all photos of the same day in separate folders?
A greeting.
PS: excuse my English, Spanish and I am translating with Google.
|
|
| Back to top |
|
 |
camus2000 New Member
Joined: 21 Aug 2008 Posts: 9 Location: Palo Alto, California
|
Posted: Thu Aug 21, 2008 7:10 pm Post subject: |
|
|
I don't believe it is possible to upload to a different directory for every event with an Axis camera. There is always an option to have a server-side software to organize your storage.
In case you are not already doing it, I suggest to change the filenames of the images with the "Overwrite/Use own file format".
|
|
| Back to top |
|
 |
mjnavapo Member
Joined: 21 Aug 2008 Posts: 10
|
Posted: Sat Aug 23, 2008 5:33 am Post subject: |
|
|
This would not be possible as an "integrated Scripts"?
Someone with knowledge of realization of integrated Scripts for Axis cameras would know if this would be possible and as:
-- Every day at 00:00h the camera creates a subfolder in the FTP set name with the current date.
-- Modify the default path where the images are stored on FTP through the route with the new subfolder it has created.
So each new day would create a folder, named as the date of that day and it almacenaria photos captured all along that day.
PS: excuse my English, Spanish and I am translating with Google.
|
|
| Back to top |
|
 |
camus2000 New Member
Joined: 21 Aug 2008 Posts: 9 Location: Palo Alto, California
|
Posted: Sun Aug 24, 2008 3:17 am Post subject: |
|
|
Yes, if you are willing to go that way, the "sftpclient" command of the scripting allows you to create a directory in the remote FTP server before uploading an image buffer.
This shell script starts an image buffer (using the command buffer_handler) and uploads captured images to an FTP server. The buffer handler tells sftpclient which files to upload through a FIFO. A directory is created if needed for today's month and today's day (nested).
#!/bin/sh
# Start a buffer handler with a pre-alarm and
# a post-alarm buffer of 5 images each
buffer_handler -a 5 -b 5 -c 500 -d 500 -F -i my_buf &
# Sleep for 3 seconds to make sure the pre-images are taken
sleep 3
# Get the process id of buffer_handler
PID=`cat /var/run/buffer_handler/my_buf.pid`
# Stop the buffer to make it save the pre-images and
# start taking the post-images
kill -USR1 $PID
# FTP server info
SERVER="10.13.9.40"
USER="user"
PASS="password"
# the path includes today's month and day
UPLOADPATH="/uploads/`date '+%m/%d'`"
# Uploaded files will be named using this format
FORMAT="image%y%m%d_%H%M%S%f.jpg"
# Files to be uploaded will be read from this FIFO
FIFO="/var/run/buffer_handler/my_buf.fifo"
# Go to working directory
cd /var/run/buffer_handler/buffers/my_buf
# Use the LD_PRELOAD macro to replace the unlink function
# in glibc with the one in libcache_unlink.so
export LD_PRELOAD=libcache_unlink.so:$LD_PRELOAD
# Launch sftpclient
# sftpclient continues uploading until an empty name # is encountered
sftpclient -M $SERVER -u $USER -w $PASS -c $UPLOADPATH -F -d "$FORMAT" -D -f $FIFO
# Note: using the -F option, sftpclient will create the directories needed (i.e. those specified after the -d option)
# if they do not exist. Without the –F option, the entire path must already exist for the command to succeed.
# Terminate buffer_handler when done
kill $PID
|
|
| Back to top |
|
 |
mjnavapo Member
Joined: 21 Aug 2008 Posts: 10
|
Posted: Mon Aug 25, 2008 12:55 pm Post subject: |
|
|
Hello, thank you very much for your reply.
You tried to this script?
He has worked?
I try but I do not work.
I do not create the folder where daily store photos.
If I set a folder, I just saved the first photos after the restart chamber, but these images can not be opened or removed.
I have created a file called "alarma.script" with 755 permits with these commands, changing data on my FTP.
I've uploaded to the camera, in the direction of "/etc"
He edited the file "user.task.list" and he added the following line:
once % /etc/alarma.script;
Not that I may be doing wrong.
A greeting.
|
|
| Back to top |
|
 |
mjnavapo Member
Joined: 21 Aug 2008 Posts: 10
|
Posted: Tue Aug 26, 2008 7:05 pm Post subject: |
|
|
Hello, I have already more advanced.
-- Now I create the package, which is appointed with the current date.
-- Inside the folder created stores that captures images.
-- The images can already see and delete without giving error (the problem is when the interlayer "/" symbol in the file name).
The problem is that some images only capture the restart chamber.
While the camera is not running again store more images.
To store new images should be reset chamber.
This has been my case:
I've created a file called "alarma.script" in which I wrote the following commands:
#!/bin/sh
# Start a buffer handler with a pre-alarm and
# a post-alarm buffer of 5 images each
buffer_handler -a 5 -b 5 -c 500 -d 500 -F -i my_buf &
# Sleep for 3 seconds to make sure the pre-images are taken
sleep 5
# Get the process id of buffer_handler
PID=`cat /var/run/buffer_handler/my_buf.pid`
# Stop the buffer to make it save the pre-images and
# start taking the post-images
kill -USR1 $PID
# Files to be uploaded will be read from this FIFO
FIFO="/var/run/buffer_handler/my_buf.fifo"
# Go to working directory
cd /var/run/buffer_handler/buffers/my_buf
# Use the LD_PRELOAD macro to replace the unlink function
# in glibc with the one in libcache_unlink.so
export LD_PRELOAD=libcache_unlink.so:$LD_PRELOAD
# Launch sftpclient
# sftpclient continues uploading until an empty name # is encountered
sftpclient -M 172.26.0.30 -u FTP -w 786888 -F -d /imagenes/`date '+%d-%m-%Y'`/%H-%M-%S.jpg -D -f $FIFO
# Note: using the -F option, sftpclient will create the directories needed (i.e. those specified after the -d option)
# if they do not exist. Without the –F option, the entire path must already exist for the command to succeed.
# Terminate buffer_handler when done
kill $PID
Where:
172.26.0.30 is the address of the FTP server
FTP is the username
1234 is the password
/imagenes is the main folder FTP
I've uploaded the file room, within the directory "/ etc" and I have established 755 permits.
Edited the file "user.task.list" and he added the following line:
once % /etc/alarma.script;
We've tried this with another line with the same result:
once immune % /etc/alarma.script;
Someone knows that only stores the first images after the resumption of the camera and does nothing more?
|
|
| Back to top |
|
 |
mjnavapo Member
Joined: 21 Aug 2008 Posts: 10
|
Posted: Fri Aug 29, 2008 9:58 am Post subject: |
|
|
It is what the problem is that only the first images stored after reset the room, without capturing new images to a future reboot.
I've completed the script for telnet and the command sftpclient the camera stays on hold.
When will that be, once the iamgenes rises with sftpclient, close this process and continue with the last process in the chain, which is:
kill `cat / var / run / buffer_handler / alarma.pid`
Someone who knows that command would have to add sftpclient once rises to the images to FTP the closing process and continue with next?
A greeting.
|
|
| Back to top |
|
 |
mjnavapo Member
Joined: 21 Aug 2008 Posts: 10
|
Posted: Fri Aug 29, 2008 5:59 pm Post subject: |
|
|
It works.
I had to add the symbol "&" to command sftpclient.
Shall read as follows:
#!/bin/sh
buffer_handler -a 2 -b 2 -c 1000 -d 1000 -i alarma -F &
sleep 3
kill -USR1 `cat /var/run/buffer_handler/alarma.pid`
sleep 3
cd /var/run/buffer_handler/buffers/alarma
export LD_PRELOAD=libcache_unlink.so:$LD_PRELOAD
sftpclient -M IP_server -u username -w password -f /var/run/buffer_handler/alarma.fifo -F -d /`date '+%d-%m-%Y'`/%H-%M-%S.jpg -D &
kill `cat /var/run/buffer_handler/alarma.pid`
And in the file "user.task.list" must be added the following line:
pattern((M0:/)) once immune % /etc/alarma.script;
A greeting.
|
|
| Back to top |
|
 |
|