Improved Vegas script

Setting video dimensions from images
This commit is contained in:
Daniel Wolf 2016-02-18 21:31:43 +01:00
parent 667edf9485
commit 372774e024
1 changed files with 9 additions and 0 deletions

View File

@ -44,12 +44,21 @@ public class EntryPoint {
bool showDialog = false; bool showDialog = false;
Project project = new Project(promptSave, showDialog); Project project = new Project(promptSave, showDialog);
// Set frame size
Bitmap testImage = new Bitmap(config.OneImageFile);
project.Video.Width = testImage.Width;
project.Video.Height = testImage.Height;
// Set frame rate // Set frame rate
if (config.FrameRate < 0.1 || config.FrameRate > 100) { if (config.FrameRate < 0.1 || config.FrameRate > 100) {
throw new Exception("Invalid frame rate."); throw new Exception("Invalid frame rate.");
} }
project.Video.FrameRate = config.FrameRate; project.Video.FrameRate = config.FrameRate;
// Set other video settings
project.Video.FieldOrder = VideoFieldOrder.ProgressiveScan;
project.Video.PixelAspectRatio = 1;
// Add markers for phones // Add markers for phones
XmlNodeList phoneElements = xmlDocument.SelectNodes("//phone"); XmlNodeList phoneElements = xmlDocument.SelectNodes("//phone");
foreach (XmlElement phoneElement in phoneElements) { foreach (XmlElement phoneElement in phoneElements) {