IPcam to NAS photo storage

Joined
May 3, 2019
Messages
1
Reaction score
0
Location
United Kingdom
I've got this issue with my Hikvision DS-2CD6365G0-IS that is connected (NFS) to a DS218j NAS where I cannot find the snapshots that are scheduled at a 5 minute interval.
I can see them on the webapp of the camera but not on the NAS.
On the NAS folder I can only find the videos that the camera is sending but not the photos.
Instead of the photos 12 folders get created named "datadir0" to "datadir11" with files segmented into ".pic" and ".mp4" and also "pic_segment_db_indexXXXXX" (where XXXXX is the number of the photos).
How can I see the photos on the NAS &/or mount them?
I need these for a timelapse project, any help is welcomed.
 

Wilbur

n3wb
Joined
Mar 4, 2019
Messages
14
Reaction score
3
Location
UK
The .PIC files each contain multiple jpeg images. The file simply needs to be broken down into seperate jpeg images. Each image starts on a 256 byte boundary.

This perl program will split the file for you. I can remenber where I got thse original code but thank you to the author! I made some minor changes so that the files will numbered from 1000 onwards so they can be sorted from xxxx_0000 to xxxx_9999 correctly.

#!/usr/bin/perl
# Splits a ".pic" file created by a Hikvision camera
# into single jpeg files

if (! (${file}=$ARGV[0]) ) {
print "Usage: $0 filename\n"; exit 1;
}

open FILE, ${file};
while (<FILE>){
${jpeg} .= $_;
}
close ${file};

${index}=1000;
while ( index(${jpeg}, "\xFF\xD8") != -1 ) {
$start = index(${jpeg}, "\xFF\xD8");
$end = index(${jpeg}, "\xFF\xD9");
print "Index: $index Start: $start End: $end\n";

${singlejpeg} = substr(${jpeg}, $start, $end+2);
${jpeg} = substr(${jpeg}, $end+2);
open (OUTFILE, ">${file}_${index}.jpg");
print OUTFILE ${singlejpeg};
close OUTFILE;
${index}++;
}

Wur.
 
Top