Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Save JPG image every second - but avoid saving damaged/corrupt images comprised of multiple images?

saveing jpg image corrupt speed improvment stream video

This topic has been archived. This means that you cannot reply to this topic.
15 replies to this topic

#13 oldhendra

oldhendra

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 52 posts

Posted 27 November 2015 - 09:03 AM

sorry :(

 

And hey it doesn't look so severe now from here (testing with Chrome 46). And I can get speed as high as 1.4 frames / sec. Congrats!

 

What did you do ?

Just curious...


Edited by oldhendra, 27 November 2015 - 09:17 AM.


#14 elliottveares

elliottveares

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 56 posts

Posted 28 November 2015 - 12:53 AM

Don't be sorry, It was my mistake as I revealed it by mistake :-P . I copied and pasted the PHP script from my server and forgot to remove my IP.

 

Did not do anything other than revise my PHP script as shown below.

<?php
ini_set('memory_limit','128M');
set_time_limit(0);
ignore_user_abort(true);


$opts = array(
 'http'=>array(

	'timeout' => 0.65,
	'ignore_errors' => '0',
 	'header' => 'Connection: keep-alive' 
	 )
);

$context = stream_context_create($opts);

        
while(1) 
{

$picture = file_get_contents("http://MYIPADDRESS:8008/cam_1.jpg", false,$context);
sleep(1);
$fp = fopen("/var/www/vhosts/grottotree.com/httpdocs/jpgs/current_cam_image/cam.jpg", "r+");
fwrite($fp, $picture);



}        

		
?>



#15 jLinux

jLinux

    CC Lurker

  • New Member
  • Pip
  • 6 posts

Posted 28 November 2015 - 06:39 PM

@elliottveares, are you trying to catch Santa Clause? :-O lol



#16 adammary

adammary

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 12 January 2016 - 09:36 PM

We have certainly seen other people with similar problems, but they were generally losing the entire file!  So, thinking about it, I can't remember an instance where partial corruption was loosing parts of the file.  We have also seen a lot of issues around Mavericks, but I am a Windows user so have not taken a lot of interest in those threads.

 

Mean while, save out to incremental file names every hour or so.  I always do this with big projects.  I also had the thought that Shadow Protect - which I use for back up - saves incremental backups every 15 minutes, and that I can apparently chose any point in time to retrieve a back up. I've never actully tried this though.  PHP Training in Chennai

 

Are the lost layers the most recent work you have done on the document?  Can you correlate the lost layers with particular events?  Are you sure that the most recent saves worked at all, and that you are not looking at a previous save point?   PHP Training in Chennai






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download