The archive of the snapshot is crazy

Have some questions or having issues with your IP Camera(s), Post them here for the mods and other users to assist you with.
wakk3r
Posts: 4
Joined: Fri Jul 22, 2016 2:01 am

The archive of the snapshot is crazy

Post by wakk3r »

Hi all,

I have a new Foscam bullett IP3M-954E.
I configure the snapshot every 10 seconds on FTP account.
The directory that is created is out of hand!

Naming convention is this:
WEBCAMCODE/day/001/jpg/hour/minute/nameoffile.jpg

example:
WEBCAMCODE/2016-07-21/001/jpg/19/45/17[R][0@0][0].jpg

I think it is absurd that a new folder is created every minute and every hour!

In the old foscam I had a folder where there were all snapshots, all together.
Can I change this naming convention?
Melvin
Site Admin
Posts: 2210
Joined: Wed Oct 14, 2015 2:20 pm

Re: The archive of the snapshot is crazy

Post by Melvin »

Hello wakk3r ,

Unfortunately these are the default settings and there is no option to change it. We do apologize for any inconvenience this might have caused.
Can't find your answer on the forum? Try our Knowledge Base! https://amcrest.zendesk.com/hc/en-us

Image
tonester
Posts: 59
Joined: Wed Jun 29, 2016 10:33 am

Re: The archive of the snapshot is crazy

Post by tonester »

Not trying to be argumentative, but what folder structure would you propose, if not every minute or hour? Now before you answer the question, ponder this--

Assuming the storage location (whether SD card, NAS, FTP) is formatted in FAT32 (no way around that if snapshots are stored to SD), then keep in mind that the maximum number of files that can be in a single folder is 65,534; if you were to delineate folders by Month, and for the sake of argument an average of one snapshot per minute was being generated--that would result in 31 days * 24 hours * 60 minutes = 44640 (43200 if 30 days), which would be below the FAT32 max files limit and would be a reasonable number of snapshots, assuming that your motion/event capture isn't set up to go hog wild on taking a ton of snapshots.

OTOH if the folder delineation was based on per Day and the snapshot average was one per second, then you'd have 24 hours * 60 minutes * 60 seconds = 86400 which would exceed the FAT32 max files limit.

In your case, you can count the number of files that are in each of your folders and extrapolate from there as to how many files are there in total for each day and each month; depending on the total, perhaps a folder breakdown by month would be sufficient, assuming you're okay with a monthly folder structure. Now if you were looking for some other folder structure entirely, then again keep in mind the FAT32 max files limitation.
wakk3r
Posts: 4
Joined: Fri Jul 22, 2016 2:01 am

Re: The archive of the snapshot is crazy

Post by wakk3r »

tonester I write the snapshot on FTP server, not in SD with a scheduled backup every 3 days.

I created a live direct system that takes the last snapshot in the folder and sends live "streaming" with PHP.

If the webcam creates a folder each minute I found 1440 directory per day!!!! :cry:
I think it is an unnecessary management.

This type of management forces me to sell the webcam and change it.
tonester
Posts: 59
Joined: Wed Jun 29, 2016 10:33 am

Re: The archive of the snapshot is crazy

Post by tonester »

I agree that having that many (1440) subdirectories, with each directory representative of one minute out of a day can become a bit unwieldy to manage; having said that, my original question still applies--how would you like the folders to be delineated by? Perhaps one daily folder containing 24 hourly folders, with each hourly folder containing all snapshot files taken during that hour? That way, each day/date folder would contain only at most 24 folders instead of 1440 folders.
wakk3r
Posts: 4
Joined: Fri Jul 22, 2016 2:01 am

Re: The archive of the snapshot is crazy

Post by wakk3r »

For what I have to do I need one directory where to find all snapshots.
Then I'll take to store with my crontab.

It's also more comfortable and fast for me to create timelapse video.
macjohn
Posts: 3
Joined: Sun Apr 03, 2016 7:51 pm

Re: The archive of the snapshot is crazy

Post by macjohn »

wakk3r wrote:For what I have to do I need one directory where to find all snapshots.
Then I'll take to store with my crontab.

It's also more comfortable and fast for me to create timelapse video.
I second this. At the very least, maybe one folder per day, but ideally they'd work like my Foscams used to work and just throw them in the directory I have indicated in the ftp setup. Why create non unique files within? I can't even search for jpgs and move them to a common directory because they are all named [M][0@0][0].jpg or something close.

Totally useless for anything I use them for. For that reason, I have held off on buying more Amcrests.
ITGuy1024
Posts: 62
Joined: Thu Aug 04, 2016 12:46 pm

Re: The archive of the snapshot is crazy

Post by ITGuy1024 »

Going to chime in here and say that one folder a day is more than enough.
Doktor Jones
Posts: 4
Joined: Mon Oct 17, 2016 3:02 pm

Re: The archive of the snapshot is crazy

Post by Doktor Jones »

@wakk3r: why not use a shell script via crontab to pull any JPGs out of a folder and move them somewhere else?

There's no single solution that's going to work/be acceptable for everyone, so they picked a solution that's not going to break under *any* configuration and went with that (trying to make paths configurable is both a UX challenge and a coding challenge, especially in the oft-limited capacity of the firmware's Flash ROM.

I whipped this up in about two minutes... it iterates through all the folders, and for each of them (except the current hour and minute) it moves all the .jpg files to the desired destination and deletes any folders after it's done with them.

It might take a while on the first run, since it has to iterate through all the files currently there, but if you run it on an hourly or even daily basis, it should go much quicker on subsequent runs.

Naturally this code is not tested, use at your own risk ;)

Code: Select all

#!/bin/sh
CAMDIR=~/WEBCAMCODE
DEST=~/MyCamFiles
DATE=`date %Y-%m-%d`
HR=`date +%H`
MIN=`date +%M`

for day in ${CAMDIR}/*; do
for num in ${day}/*; do
for h in ${num}/jpg/*; do
for m in ${h}/*; do
if [[ $day != $DATE || $h != $HR || $m != $MIN ]]; then
mv ${m}/*.jpg ${DEST}
rm -rf ${m}
fi
done
[[ $h != $HR || $day != $DATE ]] && rm -rf ${h}
done
done
[[ $day != $DATE ]] && rm -rf ${day}
done
macjohn
Posts: 3
Joined: Sun Apr 03, 2016 7:51 pm

Re: The archive of the snapshot is crazy

Post by macjohn »

I finally found a way to handle this in Windows with a combination of a batch file and a program called 'antrenamer'. Ant is a pretty simple program. Once you have it installed, using a 'date & time' rename with this mask: yyyy'-'mm'-'dd'-'hhmmsse works the best for me. This renamer every file in the directory structure in yyyy-mm-dd-hhmmss.jpg format. I then saved that preset as an arb file in the antrenamer directory I then created a batch script as follows:

where c:\folder\folder2 is where my antrenamer program is installed
and f:\ftp\AMCREST\ is where my ftp files are stored for this camera and AMC000DE_X7SXT7\ is the automatic folder created by the camera.

echo
C:
cd C:\folder\folder2\
C:\folder\folder2\renamer.exe -b c:\folder\folder2\amcrestrenamer.arb -afr f:\ftp\AMCREST\AMC000DE_X7SXT7\*.* -g -x
f:
cd f:\ftp\AMCREST\AMC000DE_X7SXT7
FOR /R "f:\ftp\AMCREST\AMC000DE_X7SXT7\" %%i in (*.jpg) DO MOVE /Y "%%i" "f:\inetpub\wwwroot\ftp\AMCREST\"
RMDIR /S /Q f:\ftp\AMCREST\AMC000DE_X7SXT7\

This batch renames all of the files, then moves them to the root of the amcrest directory and deletes the convoluted folder structure created by the camera once they are moved.

I put this into the task scheduler and now the files are easily view-able in order using irfanview.

Man, what a pain.
Post Reply