Google Flix Engine Linux Reference Manual User Manual
Page 426

420
Flix Engine Linux Page Documentation
}
$timeout_s = 0; #rpc timeout in seconds, 0=use default (25s)
$flixptr = new_flix2handlep();
$sc = Flix2_CreateEx($flixptr, "localhost", $timeout_s);
# retrieve the actual flix handle for use in the remaining API calls
$flix = flix2handlep_value($flixptr);
checksc(’Flix2_CreateEx’,$sc);
echo "Input File
: $argv[1]\n";
if(!ereg("^/",$argv[1])) { echo "WARNING: path to input file is not absolute\n"; }
$sc = Flix2_SetInputFile($flix, $argv[1]);
checksc(’Flix2_SetInputFile’,$sc);
##input file information
$srcduration = Flix2_GetSourceDuration($flix);
checksc(’Flix2_GetSourceDuration’,$srcduration[0]);
$srcw = video_options_GetSourceWidth($flix);
checksc(’video_options_GetSourceWidth’,$srcw[0]);
$srch = video_options_GetSourceHeight($flix);
checksc(’video_options_GetSourceHeight’,$srch[0]);
echo <<<EOT
Width:
$srcw[1]
Height:
$srch[1]
Duration:
$srcduration[1]ms
EOT;
echo "Output File : $argv[2]\n";
if(!ereg("^/",$argv[2])) { echo "WARNING: path to output file is not absolute\n"; }
$sc = Flix2_SetOutputFile($flix, $argv[2]);
checksc(’Flix2_SetOutputFile’,$sc);
##
## Options may be set and codecs/filters/muxers may be added prior to Flix2_Encode()
##
##Add the scale filter
##create a storage location for the filter handle
#$filterptr= new_flix2plgnhandlep();
#$sc = Flix2_AddFilter($filterptr,$flix,FE2_FILTER_SCALE);
#
checksc(’Flix2_AddFilter(FE2_FILTER_SCALE)’,$sc);
#
##retrieve the value of the handle for use in the remaining filter functions
#$filter= flix2plgnhandlep_value($filterptr);
#$sc = Flix2_FilterSetParam($filter,FE2_SCALE_WIDTH,240);
#
checksc(’Flix2_FilterSetParam(FE2_SCALE_WIDTH,240)’,$sc);
#$sc = Flix2_FilterSetParam($filter,FE2_SCALE_HEIGHT,160);
#
checksc(’Flix2_FilterSetParam(FE2_SCALE_HEIGHT,160)’,$sc);
#
##cleanup
#delete_flix2plgnhandlep($filterptr); unset($filterptr);
#
##Add the vp6 codec. Though it is the default, you must add it in order
##to modify its settings
#$codecptr= new_flix2plgnhandlep();
#$sc = Flix2_AddCodec($codecptr,$flix,FE2_CODEC_VP6);
#
checksc(’Flix2_AddCodec(FE2_CODEC_VP6)’,$sc);
#
##retrieve the value of the handle for use in the remaining codec functions
#$codec= flix2plgnhandlep_value($codecptr);
#
#$sc = Flix2_CodecSetParam($codec,FE2_VP6_RC_MODE,VBR_1PASSControl);
#
checksc(’Flix2_CodecSetParam(FE2_VP6_RC_MODE,VBR_1PASSControl)’,$sc);
Generated on Tue Jul 20 17:39:03 2010 for Flix Engine Linux by Doxygen