pixel aspect ratio & fiel order

KEATONBUS wrote on 7/15/2003, 5:51 PM
Hi from Paris
Thanks for all your topics and advice.
I have two question.
First: Because i'm using a lot of different picture with different pixel ratio, how can i find a script to get the same pixel aspect ratio, and eventually the same field order.


and
Second: i don't understand very much aspectratio.

Thank you very much
Keaton

Comments

SonyPJM wrote on 7/21/2003, 2:32 PM
Here's a bit of sample code that might help:



var media : Media = Vegas.Project.MediaPool["C:\\images\\image1.bmp"];
var stream : VideoStream = media.Streams[0];
stream.PixelAspectRatio = 1.0;
stream.FieldOrder = VideoFieldOrder.Progressive;


KEATONBUS wrote on 7/21/2003, 4:36 PM
Great, Génial, thank You, merci beaucoup.
KEATONBUS wrote on 8/15/2003, 12:33 PM
Dear Sonic

I try but i doesn't work.

/**
* This script will change pixel aspect ratio and fieldorder all events on the selected track
*
*
*
* 29/07/2003
**/
import System.Windows.Forms;
import SonicFoundry.Vegas;
try{
var stream : VideoStream = media.Streams[0];
var mediaEnum = new Enumerator(Vegas.Project.MediaPool);
while(!mediaEnum.atEnd()){
var media = mediaEnum.item();
if(media.HasVideo()) {
stream.PixelAspectRatio = 1.0;
stream.FieldOrder = VideoFieldOrder.UpperFieldFirst;
}
}
mediaEnum.moveNext();
}
catch (e){
}

Where I Wrong?
I try to change all video in the media pool to have the same field order and aspect ratio.
thanks for your patience.

Keaton
SonyPJM wrote on 8/15/2003, 1:46 PM
It looks like you are just missing the line of code that gets the
first video stream for the media object.

Try this:


/**
* This script will change pixel aspect ratio and fieldorder all events
* on the selected track
*
*
*
* 29/07/2003
**/
import System.Windows.Forms;
import SonicFoundry.Vegas;

try {
var stream : VideoStream = media.Streams[0];
var mediaEnum = new Enumerator(Vegas.Project.MediaPool);
while (!mediaEnum.atEnd()){
var media = mediaEnum.item();
if (media.HasVideo()) {
var stream : VideoStream = media.Streams.GetItemByMediaType(MediaType.Video, 0);
stream.PixelAspectRatio = 1.0;
stream.FieldOrder = VideoFieldOrder.UpperFieldFirst;
}
}
mediaEnum.moveNext();
}
catch (e){
}

KEATONBUS wrote on 8/21/2003, 5:11 PM
I'am so sorry but i doesn't work.
I think i must find a another way...
a idea, maybee somebody???

thanks
KEATONBUS wrote on 8/21/2003, 5:12 PM
I'am so sorry but i doesn't work.
I think i must find a another way...
a idea, maybee somebody???

thanks