15 cgi, 1 flix2_sample.py – Google Flix Engine Linux Reference Manual User Manual
Page 472

466
Flix Engine Linux Page Documentation
7.15
CGI
This example consists of 2 parts:
and
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
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
which runs the encode loop.
Default file locations used by the scripts:
: /var/www/cgi-bin/flixmedia/in ($indir in
: /var/www/cgi-bin/flixmedia/overlay ($overlaydir in
: /var/www/cgi-bin/flixmedia/out ($outdir in
7.15.1
flix2_sample.py
#!/usr/bin/python
##==========================================================================
##
##
Copyright (c) On2 Technologies Inc. All Rights Reserved.
##
##--------------------------------------------------------------------------
##
##
File:
$Workfile$
##
$Revision$
##
##
Last Update: $DateUTC$
##
##--------------------------------------------------------------------------
##
import os
import sys
import flixengine2
prefix
= "/var/www/cgi-bin/";
indir
= prefix + "flixmedia/in/"
overlaydir = prefix + "flixmedia/overlay/"
print """
function showall(show) {
var legend_list = document.getElementsByTagName(’legend’);
var i=0;
while(legend_list[i]) {
legend_list[i].parentNode.className=show?’expanded’:’collapsed’;
i++;
}
}
function toggle_expand(_this)
{
_this.parentNode.className= (_this.parentNode.className==’expanded’) ?
’collapsed’ : ’expanded’;
Generated on Tue Jul 20 17:39:03 2010 for Flix Engine Linux by Doxygen