markers to dvd chaters

jamcas wrote on 3/21/2004, 5:23 AM
I have been playing with an old 8mm film that i recently converted to DV.

because i hav it as one large AVI file and I have been using the 'S' key alot to split it up so i can apply fx to each indiviual scene.

my question is, can i export these markers somehow to DVDA to create chapter points ?

Or should I be rendering each scene to its own AVI file ? if so what is the best way to render export each scence out ?


Regards
jamcas


Comments

jamcas wrote on 3/21/2004, 5:30 AM
I found in the online help that if you use markers DVDA will convert them to chapter points.

hmmm is there a way to have the function of a split allowing you to apply fx to a single portion (not the whole AVI) and also have DVDA recoginse it as a new chapter in the DVD ?
Zulqar-Cheema wrote on 3/21/2004, 6:01 AM
You will need to press "M" to add markers on the TL these will then export when you render to DVD-A as chapters ( its actually an additional file you will see in with your MPEG)
JohnnyRoy wrote on 3/21/2004, 10:06 AM
Just use Edward Troxel’s (i.e., jetdv) excellent AddMarkersToEvents script. It will add a marker at the beginning of each new event. (i.e., where you split with the 'S' key)

~jr
JohnnyRoy wrote on 3/21/2004, 10:35 AM
After looking at Ed’s script again, it is really great for generically adding markers but since you specifically wanted to add chapter markers I’ve modified it a bit to add the add the label "Chapter n" where 'n' is an increasing number. I also removed the restriction of not adding to the first event since you probably want your first chapter to the beginning of the movie. This way at least when you import it into DVDA the chapters will be labeled. I’ve posted it here for you to cut and paste. I hope Ed doesn’t mind.


===== CUT HERE =====
/**
* Script: AddChaptersToEvents.js
* Description: This script will add chapter markers between all events
* on the selected track.
*
* Written By: Edward Troxel http://www.jetdv.com/tts
* Modified By: Johnny (Roy) Rofrano http://www.johnrofrano.com/
*
* History:
* 04/02/2003 - (ET) Original script
* 03/21/2004 - (JR) Add the text "Chapter n" where 'n' is an increasing
* number. Also removed the restriction of not adding to
* the first event.
*
**/

import System;
import System.IO;
import System.Windows.Forms;
import SonicFoundry.Vegas;

try
{
var myMarker : Marker;

//Find the selected event
var track = FindSelectedTrack();
if (null == track)
throw "no selected track";

var chapterNumber = 1;
var eventEnum = new Enumerator(track.Events);
while (!eventEnum.atEnd())
{
var evnt : TrackEvent = TrackEvent(eventEnum.item());

//Put a marker at the start point
myMarker = new Marker(evnt.Start);
Vegas.Project.Markers.Add(myMarker);

// Label the marker as a chapter and increment the chapter number
myMarker.Label = "Chapter " + chapterNumber;
chapterNumber++;

eventEnum.moveNext();
}
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}

/*
* Finds the first track that is selected and returns it.
* If no track is selected it returns null
*/
function FindSelectedTrack() : Track
{
var trackEnum = new Enumerator(Vegas.Project.Tracks);
while (!trackEnum.atEnd())
{
var track : Track = Track(trackEnum.item());
if (track.Selected)
{
return track;
}
trackEnum.moveNext();
}
return null;
}

===== CUT HERE =====

~jr
rrogan wrote on 3/22/2004, 3:31 PM
JohnnyRoy,

This is pretty cool. Can this be done for regions also?
I went through all my videos and created regions so I can mix up my home videos a little. I see the green region lines in the time line but even trying to add markers to the exact region line is difficult. I would like to be able to add markers automatically with the same description I gave the regions
johnmeyer wrote on 3/22/2004, 3:45 PM
This is pretty cool. Can this be done for regions also?

I have some scripts at Sundance that do similar things for regions. I think they still appear on one of the first three pages.
JohnnyRoy wrote on 3/22/2004, 4:51 PM
OK, Here is one that creates markers at all the regions. It uses the region name if there is one, otherwise it uses the word “Chapter” + an incremental number. The numbers continue to increment so that if some of your regions are labeled and some are not, the chapter number will always be the Nth marker number.
====== CUT HERE ======
/**
* Script: RegionsToChapters.js
* Description: This script will add chapter markers at the beginning
* of all the regions. It uses the region label if there
* is one. Otherwise it makes one up using the word
* Chapter + an incrmental number.
*
* Written By: Johnny (Roy) Rofrano http://www.johnrofrano.com/
*
* History:
* 03/22/2004 - (JR) Original program
*
**/

import System.Windows.Forms;
import SonicFoundry.Vegas;

try
{
var newMarker : Marker; // new marker to place
var chapterNumber = 1; // next chapter number

var regionEnum = new Enumerator(Vegas.Project.Regions);
while (!regionEnum.atEnd())
{
var region : Region = Region(regionEnum.item());

// Check to see if there is a marker already
var newMarker = FindMarkerAt(region.Position);
if (null == newMarker)
{
// Put a marker at the start point
newMarker = new Marker(region.Position);
Vegas.Project.Markers.Add(newMarker);
}

// Label the marker the same as the region. If the region
// has no label, make one up using Chapter + number
if (region.Label != "")
{
newMarker.Label = region.Label;
}
else
{
newMarker.Label = "Chapter " + chapterNumber;
}
// increment chapter so it is always the Nth marker
chapterNumber++;

regionEnum.moveNext();
}
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}

/*
* Finds the marker at the timecode position.
* If no marker is found it returns null
*/
function FindMarkerAt(time : Timecode) : Marker
{
var markerEnum = new Enumerator(Vegas.Project.Markers);
while (!markerEnum.atEnd())
{
var marker : Marker = Marker(markerEnum.item());
// test to see if the timecode is equal
if (0 == marker.Position.CompareTo(time))
{
return marker;
}
// optimise: if we past the time stop looking.
if (1 == marker.Position.CompareTo(time))
{
return null;
}
markerEnum.moveNext();
}
return null;
}
====== CUT HERE ======
I just submitted this one to Sundance as RegionsToChapters.js. It may take a while before it shows up.

~jr
rrogan wrote on 3/22/2004, 6:38 PM
JohnnyRoy,

I tried your script but nothing happened? I created my regions in the trimmer?
I'm not sure if that has an effect or not.
JohnnyRoy wrote on 3/22/2004, 8:00 PM
You have to create the regions on the timeline. The script is looking for regions in the project, not in any particular media.

~jr
johnmeyer wrote on 3/22/2004, 8:09 PM
Here's a link to the script I created a few months back. This may, or may not, work for your application:

Markers to Regions

This script creates regions directly from events. It makes a region for each and every event on the selected track:

Add Regions to Events
rrogan wrote on 3/23/2004, 6:12 AM
Thanks for your tips.
I guess I will have to do some more manual labor to get where I want.
JohnnyRoy wrote on 3/23/2004, 7:21 AM
Actually, you could drag and drop each region from the trimmer onto the timeline. (i.e., double click in the region to highlight it in the trimmer and drag it to the timeline) This will create an event on the timeline for each region in the trimmer. Then just run the original script that adds chapters to events.

There is no way to access the regions in the trimmer from a script, otherwise I’d write you a script to do that. (sorry)

~jr