# Per-image header, note the two new-lines
print "--$boundary\n";
$file= str_replace("/snapshots", "", $_GET['src'].'?random='.rand(1, 1000));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $file);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$out = curl_exec($ch);
curl_close($ch);
print "Content-type: image/jpeg\r\n";
print("Content-Length: ". strlen($out) ."\r\n\r\n");
print($out."\r\n");
# Your function to get one jpeg image
usleep(500000);
}
这就是回应:
b
--my_mjpeg
1a
Content-type: image/jpeg
19
Content-Length: 11808
169a
......JFIF.............C..............................................!........."$".$.......C.........................................................................@.