Jump to content

jal25

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. 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}++; }
×