Mark Greenwood
Forum Replies Created
-
Mark Greenwood
January 15, 2010 at 5:15 am in reply to: Strange artifact at bottom of rendered video (ok in Preview window)My first thing to check would be that I am rendering with the same project settings – for eaxmple – if I am rendering in Pal my project settings are 720×576 – but in Preview (Auto) mode the actual preview window is actually 360×288 (e.g. half of that) – if you then render for DVD for example it will actually render in 640×480 (for example) – which might well adjust the aspect ratio of the media you have?!? — To be honest the fact that there appears to be a slight gap between the bottom of the actress and the screen makes me think that the media did not line up quite as you expected…
Anyone else got any brighter and no doubt more intelligent answers then me?
-
Copy this into a notepad file – save it out with a .CS file extension (something like IncreaseTime.cs) and copy it into your script folder (typically c:\program files\sony\vegas pro 9.0\script menu).
Then run Vegas – select the events you aent to increase and run the script – type in or use the up down arrows to select the number of milliseconds for each clip (1000 per second) – it will then increase all of the images / media. Note that it will also move the start position of multiple events on a track – for some reason it has a little issue with overlapping video events which I’ll have to investigate when I have a moment.
Also note that if you do this on Video or Audio and not images it will actually set the DURATION – which means that they might run quicker or slower – so probably best used for images only!
Mark.
using System;
using System.Text;
using Sony.Vegas;
using System.Windows.Forms;namespace IncreaseLength
{
////// Entry point from Vegas
///public class EntryPoint
{
////// What vegas calls
////// public void FromVegas(Vegas vegas)
{
// Put an exception handler around the FORM
try
{
IncreaseLengthForm ic = new IncreaseLengthForm(vegas);
ic.ShowDialog();
}
catch (Exception ex)
{}
}
}public class IncreaseLengthForm : Form
{
protected Vegas m_vegas;public IncreaseLengthForm(Vegas vegas)
{
InitializeComponent();
m_vegas = vegas;
}private Button btApply;
private Button btCancel;
private Label label1;
private NumericUpDown nmDuration;///
/// Required designer variable.
///private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
////// true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///private void InitializeComponent()
{
this.btApply = new System.Windows.Forms.Button();
this.btCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.nmDuration = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.nmDuration)).BeginInit();
this.SuspendLayout();
//
// btApply
//
this.btApply.Location = new System.Drawing.Point(118, 70);
this.btApply.Name = "btApply";
this.btApply.Size = new System.Drawing.Size(75, 23);
this.btApply.TabIndex = 0;
this.btApply.Text = "Apply";
this.btApply.UseVisualStyleBackColor = true;
this.btApply.Click += new System.EventHandler(this.btApply_Click);
//
// btCancel
//
this.btCancel.Location = new System.Drawing.Point(37, 70);
this.btCancel.Name = "btCancel";
this.btCancel.Size = new System.Drawing.Size(75, 23);
this.btCancel.TabIndex = 1;
this.btCancel.Text = "Cancel";
this.btCancel.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(121, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Make all items length of:";
//
// nmDuration
//
this.nmDuration.Increment = new decimal(new int[] {
100,
0,
0,
0});
this.nmDuration.Location = new System.Drawing.Point(37, 30);
this.nmDuration.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.nmDuration.Minimum = new decimal(new int[] {
100,
0,
0,
0});
this.nmDuration.Name = "nmDuration";
this.nmDuration.Size = new System.Drawing.Size(156, 20);
this.nmDuration.TabIndex = 3;
this.nmDuration.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.nmDuration.ThousandsSeparator = true;
this.nmDuration.Value = new decimal(new int[] {
100,
0,
0,
0});
this.nmDuration.Leave += new System.EventHandler(this.nmDuration_Leave);
//
// IncreaseLengthForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(206, 105);
this.Controls.Add(this.nmDuration);
this.Controls.Add(this.label1);
this.Controls.Add(this.btCancel);
this.Controls.Add(this.btApply);
this.Name = "IncreaseLengthForm";
this.Text = "IncreaseLengthForm";
((System.ComponentModel.ISupportInitialize)(this.nmDuration)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();}
#endregion
private void nmDuration_Leave(object sender, EventArgs e)
{}
private void btApply_Click(object sender, EventArgs e)
{
double duration = (Convert.ToDouble(nmDuration.Value));// For each track
for (int iCount = 0; iCount < m_vegas.Project.Tracks.Count; iCount++) { // Get this Track Track t = m_vegas.Project.Tracks[iCount]; // Now for each track event in that track for (int iTrackEvent = 0; iTrackEvent < t.Events.Count; iTrackEvent++) { // Get this track event TrackEvent ev = t.Events[iTrackEvent]; // How much longer or shorter is this track now double dbCurrent = ev.Length.ToMilliseconds(); double dbDifference = 0; dbDifference = duration - dbCurrent; // Only move and increase if it is selected if (ev.Selected == true) { // Move ALL of the events on this track the increased distance MoveAllEvents(t, ev.Index, dbDifference); // Increase the length of this event ev.Length = Timecode.FromMilliseconds(duration); } } } // Now close this this.Close(); } protected void MoveAllEvents(Track t, int iIndex, double dbPosition) { foreach (TrackEvent ev in t.Events) { if (ev.Index > iIndex)
{
ev.Start += Timecode.FromMilliseconds(dbPosition);
}
}
}
}
} -
[John Rofrano] “Can’t you just right-click and select Copy on the first clip and the select the other 10 and right-click and select Paste Event Attributes? That should copy velocity envelopes and everything.”
The only downside with this way is that if you have anything else on the clip it Pastes the events AFTER anything previous. For my purposes it would be fine – but I think the TAKE idea is pretty cool…
Mark
-
Wow – yes indeed the TAKE option does work – thanks for the tip,
Still – I think that as a future feature request adding a simple “Change or Replace media” function wouldn’t be a bad thing.
Then again as a .Net programmer maybe I just write my own script to do it 🙂
If I do I’ll pot it here for people to use
Thanks again,
Mark.
-
Well I managed to get it working;-
I just created a new project – bought all the same media in into the Project Media – let the program create the audio files, and then the next time I opened the original file, it worked.
It must be something in the project file I guess,
But the good news is that it’s now working 🙂