Hello,

Does someone has some examples on how to use Media Mover with Heywatch?

Should I use the custom command module or is their a better way to let HeyWatch process the harvasted file?

TIA,
Fossie

Comments

anantagati’s picture

Status: Active » Fixed

We used MM Custom Command for Heywatch processing.

1. harvest - we harvested file from CCK
2. process - bypass
3. storage - S3 storage
4. complete - MM Custom Command PHP code

I removed some site specific data, but it should give you idea how to do it:

As Output file for Custom Command we used:
http://___NAME_OF_BUCKET___.s3.amazonaws.com/video_[nid].flv

As Code we used:

require_once "HTTP/Request.php";

$video_url = $file['storage_file'];
$video_url = str_replace('https://', 'http://', $video_url);
$nid = $file['nid'];

// We want to encode in Flash format
$format_id = "31";

$title = "video_{$nid}";

// The encoded video will be uploaded to this FTP location
$s3 = "s3://___S3_KEY___:___S3_KEY____@___NAME_OF_BUCKET___";

// You'll be notified when all the process is done
$ping_after_encode = "http://www.our_domain.com/path/{$nid}";

// You'll be notified if there is an error during the process.
$ping_if_error = "http://www.our_domain.com/path/{$nid}";

$req =& new HTTP_Request("https://heywatch.com/download.xml");

// Authenticate via your HeyWatch login / password
$req->setBasicAuth("___USERNAME___", "___PASSWORD___");

// It's a POST request
$req->setMethod(HTTP_REQUEST_METHOD_POST);

// Add all the needed parameters
$req->addPostData("url", $video_url);
$req->addPostData("format_id", $format_id);
$req->addPostData("title", $title);

// Force encoding after the download is complete
$req->addPostData("automatic_encode", "true");
$req->addPostData("s3_directive", $s3);
$req->addPostData("ping_url_after_encode", $ping_after_encode);
$req->addPostData("ping_url_if_error", $ping_if_error);
$req->addPostData("watermark_image_url", $watermark_url);
$req->addPostData("watermark_position", $watermark_position);
$req->sendRequest();

Variable $ping_after_encode tells where Heywatch which address to ping after success convert.

Automatically closed -- issue fixed for 2 weeks with no activity.