$link="http://rtsp.me/ff.php?camId=j60tUEa7";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch,CURLOPT_URL,$link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$cu_result=curl_exec($ch);
curl_close($ch);
$savefile = fopen('/home/user/image.jpg', 'w');
fwrite($savefile, $cu_result);
fclose($savefile);