beautypg.com

Google Flix Engine Linux Reference Manual User Manual

Page 512

background image

506

Flix Engine Linux Page Documentation

if key == ’Flix2_SetInputFile’:

funcname = ’flixengine2.’+key

SimpleSet(funcname, value[0])

elif key == ’Flix2_SetOutputFile’:

outfile = outdir+value[0]

funcname = ’flixengine2.’+key

SimpleSet(funcname, outfile)

elif string.find(value[0],"FE2_CODEC") != -1:

init_codec(value[0])

elif string.find(key,"FE2_FILTER") != -1:

init_filter(key)

elif string.find(value[0],"FE2_MUXER") != -1:

init_muxer(value[0])

elif string.find(key, "CodecSetParam") != -1:

temp = string.split(key,":")

codec_interface(temp[0],temp[1],value[0])

elif string.find(key, "FilterSetParam") != -1:

temp = string.split(key,":")

filter_interface(temp[0],temp[1],value[0])

elif string.find(key, "MuxerSetParam") != -1:

temp = string.split(key,":")

muxer_interface(temp[0],temp[1],value[0])

else:

funcname = ’flixengine2.’+key

SimpleSetNum(funcname, value[0])

print "Flix2_Encode()"

sc = flixengine2.Flix2_Encode(flix)

print "%d\n"

% (sc)

print "\n"

print "
Encoding...(video frames encoded, percent complete). "

print "Total frames will reset when doing 2pass.
"

ier = 1

while(sc == 0 and ier != 0):

ier = SimpleGet(flixengine2.Flix2_IsEncoderRunning)

res = flixengine2.encoding_status_GetTotalFrames(flix)

p = flixengine2.encoding_status_PercentComplete(flix)

if (res[0] == 0):

print "(%d, %d%%)
\n" % (res[1], p[1])

time.sleep(1)

print "
Done!"

print_encoder_status()

sc = flixengine2.Flix2_Destroy(flix)

flixengine2.delete_flix2plgnhandlep(flixptr)

if codecptr: flixengine2.delete_flix2plgnhandlep(codecptr)

if filterptr: flixengine2.delete_flix2plgnhandlep(filterptr)

if muxerptr: flixengine2.delete_flix2plgnhandlep(muxerptr)

print """

"""

Generated on Tue Jul 20 17:39:03 2010 for Flix Engine Linux by Doxygen