PDA

View Full Version : setting width/height


flixnewbie
05-18-2006, 03:01 PM
Hi,

I just started using the FLIX demo, so please excuse me if this question is really basic. For some reason, I am having a hard time understanding the docs quickly.
I want the dimensions of my output FLV file to be different from the source dimensions. Right now, I guess the default is to have it be the same as the source.
Can someone give me directions as to how to do this? Is there a switch I can use in the command-line? Or do I have to edit some files (if so, which?)?

Thanks so much.

jschaf01
05-18-2006, 03:32 PM
WF_FlixCOM.WF_FlixEncoderClassm_Flix = new WF_FlixCOM.WF_FlixEncoderClass();

WF_FlixCOM.WF_Video videoOptions = m_Flix.GetVideoOptions();

// NOTE: If you want to use source dimensions, you must set
// the dimensions to something first (ie: just use 1x1 as bogus dimensions).

//Broadband / Broadband High
int nWidth = 320;
int nHeight = 240;

videoOptions.SetSwfWidth(nWidth);
videoOptions.SetSwfHeight(nHeight);

surabisantosh
06-27-2006, 11:54 PM
I am using perl to encode, does the above has to be added in a perl file or is it in some other file if so which one?

kerrizor
10-29-2006, 06:06 PM
I am using perl to encode, does the above has to be added in a perl file or is it in some other file if so which one?

Did you solve this? Still need help?

ducky
12-05-2006, 09:22 PM
// NOTE: If you want to use source dimensions, you must set
// the dimensions to something first (ie: just use 1x1 as bogus dimensions).


Can you elaborate on this?

Im running into a issue where I try to set the height and width of the converted file to be the height and width of the source file and it wont work. It returns

Dec 5 18:18:36 localhost flixd[25360]: [encoding] configure_filters: Failed to configure scale filter, removing. sc=-1

in the log file.

Im using PERL. So lets say my source file is 320 x 240. If I use the code below it won't work.


$width = 320;
$height = 240;

# resize filter
$filter_ptr = On2::flixengine2::new_flix2plgnhandlep();
$sc = On2::flixengine2::Flix2_AddFilter( $filter_ptr, $flix, $On2::flixengine2::FE2_FILTER_SCALE );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_AddFilter' );
$filter = On2::flixengine2::flix2plgnhandlep_value( $filter_ptr );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_WIDTH, $width );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_HEIGHT, $height );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
On2::flixengine2::delete_flix2plgnhandlep( $filter_ptr );



I even tried something like this and it still wont work


# resize filter
$filter_ptr = On2::flixengine2::new_flix2plgnhandlep();
$sc = On2::flixengine2::Flix2_AddFilter( $filter_ptr, $flix, $On2::flixengine2::FE2_FILTER_SCALE );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_AddFilter' );
$filter = On2::flixengine2::flix2plgnhandlep_value( $filter_ptr );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_WIDTH, 1 );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_WIDTH, $width );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_HEIGHT, 1 );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_HEIGHT, $height );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
On2::flixengine2::delete_flix2plgnhandlep( $filter_ptr );


however if I set $width = $width + 1 and $height = $height + 1 it'll work.

Any ideas?

ducky
12-06-2006, 02:50 PM
Seems to work if I do this:


# resize filter
# need to initialize to 1 if we're gonna use the width and height of the original source
$filter_ptr = On2::flixengine2::new_flix2plgnhandlep();
$sc = On2::flixengine2::Flix2_AddFilter( $filter_ptr, $flix, $On2::flixengine2::FE2_FILTER_SCALE );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_AddFilter' );
$filter = On2::flixengine2::flix2plgnhandlep_value( $filter_ptr );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_WIDTH, 1 );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_HEIGHT, 1 );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
On2::flixengine2::delete_flix2plgnhandlep( $filter_ptr );

$filter_ptr = On2::flixengine2::new_flix2plgnhandlep();
$sc = On2::flixengine2::Flix2_AddFilter( $filter_ptr, $flix, $On2::flixengine2::FE2_FILTER_SCALE );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_AddFilter' );
$filter = On2::flixengine2::flix2plgnhandlep_value( $filter_ptr );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_WIDTH, $width );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
$sc = On2::flixengine2::Flix2_FilterSetParam( $filter, $On2::flixengine2::FE2_SCALE_HEIGHT, $height );
$self->checksc( flix => $flix, sc => $sc, function => 'Flix2_FilterSetParam' );
On2::flixengine2::delete_flix2plgnhandlep( $filter_ptr );


Is this issue documented anywhere?

Thanks

ducky
12-06-2006, 04:06 PM
Does anyone have any idea on how to get this to work?

The code I listed above doesnt output anything (the one that sets the width and height to 1 initially)...just a blank screen.

jschaf01
12-18-2006, 03:58 PM
The help documentation says... (at least for v 8.0.7.0 and higher, not sure about other versions)

The flix engine encodes video using the video source dimensions by default.

You should only have to set the scale filter if you want to scale differently from the source. I am doing it in c# but this works for me...

try
{
IFlixPlgn filter = flix.addFilter(flix.FE2_FILTER_SCALE);
double dWidth = filter.getParam(flix.FE2_SCALE_WIDTH);
double dHeight = filter.getParam(flix.FE2_SCALE_HEIGHT);
if (clientData.ScaleMovie)
{
double dAspect = dWidth / dHeight;
dWidth = (double)clientData.MovieWidth;
dHeight = (int)((dWidth / dAspect) + .5);
filter.setParam(flix.FE2_SCALE_WIDTH, dWidth);
filter.setParam(flix.FE2_SCALE_HEIGHT, dHeight);
}
else
{
filter.setParam(flix.FE2_SCALE_WIDTH, (double)clientData.MovieWidth);
filter.setParam(flix.FE2_SCALE_HEIGHT, (double)clientData.MovieHeight);
}
}
catch (COMException ex)
{
LogMessage(sw, string.Format("Failed to set scale filter. Error: {0}", ex.Message));
}