Custom transcoding flavors

1 reply [Last post]
Joined: 07/26/2011
Points: 28

I would need in addition to the already present flavors a downloadable MPEG2 flavor. I tried to find where Kaltura defines transcoding flavors but no luck.

Anyone can shed some light on this?

Joined: 05/13/2009
Points: 164

Check out the Flavor Service in the testme docs:
http://www.kaltura.com/api_v3/testmeDoc/index.php?object=KalturaFlavorPa...
http://www.kaltura.com/api_v3/testmeDoc/index.php?service=flavorparams

here's some nasty code that will save all your (default transcode profile) flavors to a php serialized text file that you can later use to reset your flavors if you find that you've messed them up

require_once("kaltura-php5-client/KalturaClient.php");

//define constants

define("KALTURA_PARTNER_ID", 000000);
define("KALTURA_PARTNER_USER", "can be anything");
define("KALTURA_PARTNER_WEB_SERVICE_SECRET", "xxxxxxxxxxxxxxxxxxxxxxxxxx");
define("KALTURA_PARTNER_WEB_SERVICE_ADMIN_SECRET", "xxxxxxxxxxxxxxxxxxx");
define("KALTURA_SERVICE_URL", "http://www.kaltura.com");

//construct Kaltura objects for session initiation
$config           = new KalturaConfiguration(KALTURA_PARTNER_ID);
$config->serviceUrl = KALTURA_SERVICE_URL;
$client           = new KalturaClient($config);
//print_r($client);
$ks               = $client->session->start(KALTURA_PARTNER_WEB_SERVICE_ADMIN_SECRET, KALTURA_PARTNER_USER, KalturaSessionType::ADMIN, KALTURA_PARTNER_ID);
if (!isset($ks)) {
  die("Could not establish Kaltura session. Please verify that you are using valid Kaltura partner credentials.");
}
$client->setKs($ks);  // set the session in the client

$filter = null; //new KalturaFlavorParamFilter();
$pager = null; //new KalturaFilterPager();
$profiles = $client->conversionProfile->listAction($filter, $pager);
foreach ( $profiles->objects as $profile )
{
        if ( $profile->isDefault == 1 )
        {
                $flavors = explode( ",", $profile->flavorParamsIds);
        }
}
if ( !$flavors )
{
        die( "Could not find default conversion profile" );
}

$savedFlavors = Array();
/*
print( "\nHere are yor default flavors:\n" );
foreach ($flavors as $flavor)
{
        $result = $client->flavorParams->get($flavor);
        $savedFlavors[] = $result;
        print($result->id."\t".$result->format."\t".$result->tags."\t".$result->name."\n");
}

print( "\nSaving flavors to savedFlavors.txt\n\n");

$myFile = "savedFlavors.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, serialize ($savedFlavors) );
fclose($fh);