Command line, C command, Line – Google Flix Engine Linux Reference Manual User Manual

Page 377: 8 command line

Advertising
background image

7.8 Command Line

371

7.8

Command Line

/*
//==========================================================================

//

//

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

//

//--------------------------------------------------------------------------

//

//

File:

$Workfile$

//

$Revision$

//

//

Last Update: $DateUTC$

//

//--------------------------------------------------------------------------

*/
#include <stdio.h>

//printf, etc

#include <stdlib.h> //exit

#include <unistd.h> //sleep

#include <flixengine2/flixengine2.h>

#include "example_common.h"

int main(int argc, char** argv)
{

const char* rpchost = "localhost";
const int timeout_s = 0;

FLIX2HANDLE flix;

on2bool ier;

int32_t srcw, srch, srcduration;

on2sc sc;

printf("Flix Engine client library v%s\n",Flix2_Version());

printf("%s\n\n",Flix2_Copyright());

if (argc < 3) {

printf("usage: cli_encode <infile> <outfile>\n\n");

printf("NOTE cli_encode uses libflixengine2.so which is a client\n"

"NOTE side rpc library. All paths must be accessible to the\n"

"NOTE server side, i.e., flixd, thus relative paths will most\n"

"NOTE likely give undesired results. The same can be said\n"

"NOTE for clients running on different machines.\n");

return -1;

}

/*contact flixd on rpchost w/timeout of timeout_s.

A port may be specified by giving rpchost in the form ’server:port’

to avoid making a connection to portmap before contacting flixd.

This is only useful if flixd is being run with the --port option.

If timeout_s is 0 rpc’s default timeout will be used (typically 25s)*/

CHECKSC( Flix2_CreateEx(&flix, rpchost, timeout_s) )

printf("Input File

: %s\n",argv[1]);

if(*argv[1] != ’/’) printf("WARNING: path to input file is not absolute\n");
CHECKSC( Flix2_SetInputFile(flix, argv[1]) )

/*input file information*/
CHECKSC( video_options_GetSourceWidth(flix,&srcw) )

CHECKSC( video_options_GetSourceHeight(flix,&srch) )

CHECKSC( Flix2_GetSourceDuration(flix,&srcduration) )

printf("

Width:

%d\n"

"

Height:

%d\n"

"

Duration: %dms\n",

srcw,srch,srcduration);

printf("Output File : %s\n",argv[2]);

if(*argv[2] != ’/’) printf("WARNING: path to output file is not absolute\n");
CHECKSC( Flix2_SetOutputFile(flix, argv[2]) )

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

Advertising