-
Your assistance John, with one of your previous written scripts?
Posted by Steve Rhodenon February 3, 2016 at 9:49 am
Hey John, you have written a Playback Rate script some years
ago over at the sony forum:
https://www.sonycreativesoftware.com/forums/showmessage.asp?messageid=721016
If possible, can you change this for me, for it to only affect events
that i select?
Currently its set to adjust everything on the timeline, would want for it
to adjust only the ones i select. Thanks again!Steve Rhoden (Cow Leader)
Film Maker & VFX Artist.
Owner of Filmex Creative Media.
Samples of my Work and Company can be seen here:
https://www.facebook.com/FilmexCreativeMediaJohn Rofrano replied 10 years, 3 months ago 2 Members · 3 Replies -
3 Replies
-
John Rofrano
February 3, 2016 at 2:03 pm[Steve Rhoden] “Currently its set to adjust everything on the timeline, would want for it to adjust only the ones i select. Thanks again!”
Sure, no problem. Here is the new script:
//****************************************************************************
//* Program: Fix30pMedia.cs
//* Author: John Rofrano
//* Description: This script changes the playback rate of 30p media to 29.97
//* Created: July 25, 2010
//* Updated: Jul 28, 2010 (JR) Added Disable Resample
//* Aug 4, 2010 (JR) Changed audio to match video
//* Feb 3, 2016 (JR) Changed to only process selected events
//*
//* Copyright: (c) 2010, 2016 Sundance Media Group / VASST. All Rights Reserved
//****************************************************************************
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)
{
// Only process selected events
if (!videoEvent.Selected) continue;VideoStream videoStream = videoEvent.ActiveTake.MediaStream as VideoStream;
decimal frameRate = Math.Round((decimal)videoStream.FrameRate, 2);// only affect 30fps media
if (frameRate == 30.00m)
{
videoEvent.AdjustPlaybackRate(0.999, 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.999, 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);
}
}
}
Let me know how it works for you.~jr
http://www.johnrofrano.com
http://www.vasst.com -
Steve Rhoden
February 3, 2016 at 4:05 pmWorking great. Exactly how i needed it.
Thanks a bunch.
(This Vegas Scripting language is the only part of Vegas i’ve never
dedicated my time in mastering, lol )Steve Rhoden (Cow Leader)
Film Maker & VFX Artist.
Owner of Filmex Creative Media.
Samples of my Work and Company can be seen here:
https://www.facebook.com/FilmexCreativeMedia -
John Rofrano
February 3, 2016 at 9:20 pmYou’re welcome Steve. Glad that worked as you expected.
~jr
http://www.johnrofrano.com
http://www.vasst.com
Reply to this Discussion! Login or Sign Up