beautypg.com

13 cgi – Google Flix Engine Linux Reference Manual User Manual

Page 428

background image

422

Flix Engine Linux Page Documentation

7.13

CGI

This example consists of 2 parts:

flix2_sample.php

and

process_sample.php

.

flix2_sample.php

searches

for uploaded files to encode and allows the user to select one while giving the option to set values for most
of the engine’s functions. The engine options are separated into sections that map to the engine’s include
files.

To use this example navigate to

flix2_sample.php

in your web browser, select a file from the list, set any of

the desired options and click the encode button. The selected options are submitted to

process_sample.php

which runs the encode loop.

Default file locations used by the scripts:

Input

: /var/www/cgi-bin/flixmedia/in ($indir in

flix2_sample.php

)

Overlay

: /var/www/cgi-bin/flixmedia/overlay ($overlaydir in

flix2_sample.php

)

Output

: /var/www/cgi-bin/flixmedia/out ($outdir in

process_sample.php

)

7.13.1

flix2_sample.php

#!/usr/bin/env php

##==========================================================================

##

##

Copyright (c) On2 Technologies Inc. All Rights Reserved.

##

##--------------------------------------------------------------------------

##

##

File:

$Workfile$

##

$Revision$

##

##

Last Update: $DateUTC$

##

##--------------------------------------------------------------------------

##

## add extension_dir/.. to ’include_path’ as this is often missing from php.ini

set_include_path(get_include_path().PATH_SEPARATOR.ini_get("extension_dir")."/..");

$incret

= include (’flixengine2.php’);

$prefix

= "/var/www/cgi-bin/";

$indir

= $prefix."flixmedia/in/";

$overlaydir = $prefix."flixmedia/overlay/";

echo <<

Flix CGI Sample - PHP