How do I save Thumbnail?
|
|
Hi, I have succesfully uploaded a video (via HTML from) and had it auto encoded and sent to my s3 bucket. Not being a pro PHP coder, I now have spent numerous days trying to understand how your ping after trasfer works so that I can update the database and also how to get the thumbnail into my server without success. I can access the thumbnail and show it in the browser with cURL like this:
$url = "http://heywatch.com/encoded_video/xxxxxx.jpg";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "xxxxx:xxxxxxx");
$image = curl_exec($ch);
curl_close($ch);
header("Content-type: image/jpeg");
print $image;
But how do I then save it with cURL to my server or s3? or if not cURL how do I do it?
I followed some forum posts on creating a ping_after_transfer.php file and enabling it in my account. But don’t get any info!
PLEASE,PLEASE HELP!!!!!any help will be very appreciated! |
|
|
To save the thumbnail on your server:
$url = "http://heywatch.com/encoded_video/xxxxxx.jpg";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "xxxxx:xxxxxxx");
$image = curl_exec($ch);
curl_close($ch);
$file = fopen('thumbnail.jpg', 'wb');
fwrite($file, $image);
fclose($file);
|
|
|
Thanks Bruno for the very very quick reply! Regarding the ping after transfer query, does the page redirect to the ping url I set in my account after the transfer is complete? or am I confused as to what the ping does? |
|
|
Absolutely not. The ping notifies you that a transfer or an encode is done in the background. You want redirect_if_success parameter. You can find an example here: http://wiki.heywatch.com/Upload+videos+from+your+service |
|
|
OK! thanks, how then do I access this info in the ping if it’s in the background. If I set my PING address to ping.php what do I put in that php page to access the results. I’ve read your documentation but still am getting confused. do you have an example? It’s definately a ping I want not a redirect. |