Jump to content
ethos

Playback of snapshots stored in PIC files by HIKVISION cams

Recommended Posts

My system is based on HIKVISION 2CD3132 cams, NAS storage on Ubuntu, and iVMS4200.

 

Recording and remote playback of videos is working (although there are still some playback issues which i will address elsewhere.)

 

One of the HIKVISION cameras is set up for continuous snapshot recording as a way to provide an overview of daily sales in my restaurant. The idea is to be able to rapidly review the whole day's business activity by flipping through snapshots taken at 1 minute intervals, at the same time i need a high resolution video recorded at 2FPS to review detail.

 

The snapshots are being recorded fine but they are stored as multiple images in large .PIC files instead of separate images, and they don't show up in the Remote Playback section of iVMS4200.

 

This multiple image PICT file format isn't supported by popular media viewing software, in fact, so far i have not been able to find anything that can view them! Quicktime can open the files but only shows one image.

 

Has anyone here had a similar experience?

 

Does anyone know how to view these snapshots? in iVMS4200 or elsewhere?

or how to extract the snapshots from the PIC files?

 

Thanks for sharing!

.

Share this post


Link to post
Share on other sites

I gave up and wrote some perl to do it:

 

#!/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}=0;
while ( index(${jpeg}, "\xFF\xD8") != -1  ) {
 $start = index(${jpeg}, "\xFF\xD8");
 $end = index(${jpeg}, "\xFF\xD9");

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×