This site won't allow to upload zip file, so you'll have to copy and paste all data in the code box into NOTEPAD and save as "Slow 30p - 24p.cs". Now place it into your "Script Menu" folder located in your Vegas installed directory. It should then show up as one of your script options in Vegas.
Add your 30p and 24p footage into your Vegas 24p project timeline and run this script. It will only effect 29.97 fps clips. You will then notice that the 30p clips have a wavy line in them. This tells you they have been Time-Stretched. You'll have to drag the right edge to the right to expand to full amount because they will be truncated by default.
This script does two things. It disables Resampling and it sets playback rate for video/audio to .80 (only on 29.97 fps clips in the timeline).
Here is the code:
Code:
//****************************************************************************
//* Program: Slow 30p - 24p.cs
//* Author: Racer-x
//* Description: This script Slows the playback rate of 30p media to 24p
//* Created: Jan 16, 2012
//* Updated: Added Disable Resample
//* Changed audio to match video
//*
//*
//****************************************************************************
using System;
using System.Collections;
using System.Windows.Forms;
using Sony.Vegas;
class EntryPoint
{
public void FromVegas(Vegas vegas)
{
int counter = 0;
try
{
foreach (Track track in vegas.Project.Tracks)
{
if (!track.IsVideo()) continue;
foreach (VideoEvent videoEvent in track.Events)
{
VideoStream videoStream = videoEvent.ActiveTake.MediaStream as VideoStream;
decimal frameRate = Math.Round((decimal)videoStream.FrameRate, 2);
// only affect 30fps media
if (frameRate == 29.97m)
{
videoEvent.AdjustPlaybackRate(0.8, true);
videoEvent.ResampleMode = VideoResampleMode.Disable;
counter++;
// check for audio in the same file and change it too
if (videoEvent.IsGrouped)
{
foreach (TrackEvent trackEvent in videoEvent.Group)
{
if (!trackEvent.IsAudio()) continue;
// see if they are from the same file
if (trackEvent.ActiveTake != null && trackEvent.ActiveTake.MediaPath.Equals(videoEvent.ActiveTake.MediaPath))
{
AudioEvent audioEvent = trackEvent as AudioEvent;
audioEvent.AdjustPlaybackRate(0.8, true);
}
}
}
}
}
}
// let the user know we are done
MessageBox.Show(String.Format("{0} events changed", counter), "Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
}
}