Scripting solution for in and out times for all events

wendell wrote on 5/26/2022, 10:46 PM

A follow up question to https://www.vegascreativesoftware.info/us/forum/write-out-filename-and-in-and-out-times-for-all-events--135546/

If I have hundreds of .veg project files and I need to extract the in and out times of all events for each of them, is it possible to do this using a scripting solution without manually opening up every .veg file. I would like to be able to just launch the script and process all theses .veg files and have the relevant start/end times in a different file for each project.

 

Comments

jetdv wrote on 5/27/2022, 8:57 AM

@wendell, the short answer is yes. You can select a bunch of VEG files from a script and it can open each one of them sequentially and do whatever you want to do with them. Please go to www.jetdv.com and take a look at my tutorials there. In particular, this tutorial show selecting multiple VEG files and then rendering them all out to a specific format:

Now, instead of rendering, you would need to go through each of the event on the timeline and then output that information to a file. To go through the tracks and events, this recent tutorial will show how that is easily done using a "foreach" on the tracks followed by a "foreach" on the events on each track. It does to other things like only processes the events on video tracks but the process is the same.

Then you'd need the code to output to a text file. I have not done any tutorials on doing that at this time.

I'd be happy to create a tutorial on this if you could tell me exactly what pieces of information you want placed in the text file. I would name the text file the same as the VEG file only ending in .txt.

jetdv wrote on 5/27/2022, 10:53 AM

@wendell, How about something like this?

Column 1: The track number

Column 2: The time on the timeline the event starts

Column 3: The ending time on the timeline

Column 4: The offset from the beginning of the clip where it starts

Column 5: The length of the event

Column 6: The file path to the clip

1   00:00:05.21   00:00:13.00   00:00:00.00   00:00:07.09   VEGAS Titles & Text Episode 19: Historical MarkersHardin County
1   00:00:47.27   00:00:55.07   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 25.134? N, 88° 20.667? WHas Been Removed
1   00:01:00.12   00:01:07.21   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 25.135? N, 88° 20.669? WHas Been Removed
1   00:03:36.21   00:03:44.01   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 25.403? N, 88° 20.836? W
1   00:04:32.01   00:04:39.10   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 26.837? N, 88° 18.417? W
1   00:05:18.27   00:05:26.06   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 28.113? N, 88° 9.979? W
1   00:05:52.01   00:05:59.10   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 28.113? N, 88° 9.979? W
1   00:06:16.26   00:06:24.06   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 28.033? N, 88° 9.583? W
1   00:07:00.03   00:07:07.12   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 29.955? N, 88° 19.679? W
1   00:08:06.02   00:08:13.11   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 29.95? N, 88° 19.667? W
1   00:09:15.00   00:09:22.09   00:00:00.00   00:00:07.09   VEGAS Titles & Text 37° 29.95? N, 88° 19.667? W
2   00:00:05.21   00:00:13.00   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:00:47.27   00:00:55.07   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:01:00.12   00:01:07.21   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:03:36.21   00:03:44.01   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:04:32.01   00:04:39.10   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:05:18.27   00:05:26.06   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:05:52.01   00:05:59.10   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:06:16.26   00:06:24.06   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:07:00.03   00:07:07.12   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:08:06.02   00:08:13.11   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   00:09:15.00   00:09:22.09   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
3   00:00:47.27   00:00:55.07   -00:00:00.00   00:00:07.09   D:\Blogs\Historical Markers\Hardin\Mine It Mill It Ship It.jpg
3   00:01:00.12   00:01:07.21   -00:00:00.00   00:00:07.09   D:\Blogs\Historical Markers\Hardin\Florite Center.jpg
4   00:00:00.00   00:00:14.22   00:00:00.00   00:00:14.22   D:\Blogs\Adventure Intro.mp4
4   00:00:14.18   00:00:44.13   00:00:00.19   00:00:29.25   D:\Blogs\Historical Markers\Hardin\DJI_0393.MP4
4   00:00:44.09   00:03:33.22   00:00:00.00   00:02:49.13   D:\Blogs\Historical Markers\Hardin\DJI_0395.MP4
4   00:03:33.17   00:04:31.05   00:00:00.00   00:00:57.18   D:\Blogs\Historical Markers\Hardin\DJI_0396.MP4
4   00:04:31.01   00:04:44.00   00:00:00.00   00:00:12.28   D:\Blogs\Historical Markers\Hardin\DJI_0397.MP4
4   00:04:43.21   00:05:11.11   00:00:26.24   00:00:27.20   D:\Blogs\Historical Markers\Hardin\DJI_0397.MP4
4   00:05:11.07   00:05:16.15   00:00:00.00   00:00:05.08   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
4   00:05:16.11   00:05:50.28   00:00:15.19   00:00:34.17   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
4   00:05:50.25   00:06:10.19   00:00:56.27   00:00:19.24   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
4   00:06:10.15   00:06:14.22   00:00:04.03   00:00:04.07   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
4   00:06:14.18   00:06:35.06   00:00:18.02   00:00:20.18   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
4   00:06:35.01   00:06:48.22   00:01:04.09   00:00:13.21   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
4   00:06:48.19   00:06:56.27   00:00:00.00   00:00:08.08   D:\Blogs\Historical Markers\Hardin\DJI_0401.MP4
4   00:06:56.17   00:08:03.16   00:00:26.17   00:01:06.29   D:\Blogs\Historical Markers\Hardin\DJI_0401.MP4
4   00:08:03.11   00:09:13.03   00:00:00.11   00:01:09.21   D:\Blogs\Historical Markers\Hardin\DJI_0402.MP4
4   00:09:12.28   00:09:48.15   00:00:00.26   00:00:35.17   D:\Blogs\Historical Markers\Hardin\DJI_0403.MP4
4   00:09:48.10   00:10:07.09   00:00:00.00   00:00:19.00   D:\Blogs\Historical Markers\Hardin\GH010185.MP4
4   00:10:06.29   00:10:35.14   00:00:00.00   00:00:28.15   D:\Blogs\Historical Markers\Hardin\DJI_0394.MP4
4   00:10:35.11   00:10:45.03   00:00:00.00   00:00:09.22   D:\Blogs\Adventure Closing.mp4
5   00:00:00.00   00:00:14.22   00:00:00.00   00:00:14.22   D:\Blogs\Adventure Intro.mp4
5   00:00:14.18   00:00:44.13   00:00:00.19   00:00:29.25   D:\Blogs\Historical Markers\Hardin\DJI_0393.MP4
5   00:00:44.09   00:03:33.22   00:00:00.00   00:02:49.13   D:\Blogs\Historical Markers\Hardin\DJI_0395.MP4
5   00:03:33.17   00:04:31.05   00:00:00.00   00:00:57.18   D:\Blogs\Historical Markers\Hardin\DJI_0396.MP4
5   00:04:31.01   00:04:44.00   00:00:00.00   00:00:12.28   D:\Blogs\Historical Markers\Hardin\DJI_0397.MP4
5   00:04:43.21   00:05:11.11   00:00:26.24   00:00:27.20   D:\Blogs\Historical Markers\Hardin\DJI_0397.MP4
5   00:05:11.07   00:05:16.15   00:00:00.00   00:00:05.08   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
5   00:05:16.11   00:05:50.28   00:00:15.19   00:00:34.17   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
5   00:05:50.25   00:06:10.19   00:00:56.27   00:00:19.24   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
5   00:06:10.15   00:06:14.24   00:00:00.00   00:00:04.09   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
5   00:06:14.18   00:06:35.06   00:00:18.02   00:00:20.18   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
5   00:06:35.01   00:06:48.22   00:01:04.09   00:00:13.21   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
5   00:06:48.19   00:06:56.27   00:00:00.00   00:00:08.08   D:\Blogs\Historical Markers\Hardin\DJI_0401.MP4
5   00:06:56.17   00:08:03.16   00:00:26.17   00:01:06.29   D:\Blogs\Historical Markers\Hardin\DJI_0401.MP4
5   00:08:03.11   00:09:13.03   00:00:00.11   00:01:09.21   D:\Blogs\Historical Markers\Hardin\DJI_0402.MP4
5   00:09:12.28   00:09:48.15   00:00:00.26   00:00:35.17   D:\Blogs\Historical Markers\Hardin\DJI_0403.MP4
5   00:09:48.10   00:10:07.09   00:00:00.00   00:00:19.00   D:\Blogs\Historical Markers\Hardin\GH010185.MP4
5   00:10:06.29   00:10:35.14   00:00:00.00   00:00:28.15   D:\Blogs\Historical Markers\Hardin\DJI_0394.MP4
5   00:10:35.11   00:10:45.03   00:00:00.00   00:00:09.22   D:\Blogs\Adventure Closing.mp4

Example 1:

1 00:08:06.02 00:08:13.11 00:00:00.00 00:00:07.09 VEGAS Titles & Text 37° 29.95? N, 88° 19.667? W

In this case, this is a generated media Titles and Text that starts at 8:06.02 on track 1 and ends at 8:13.11 for a total length of 7.09.

Example 2:

5 00:06:10.15 00:06:14.24 00:00:00.00 00:00:04.09 D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4

5 00:06:14.18 00:06:35.06 00:00:18.02 00:00:20.18 D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4

5 00:06:35.01 00:06:48.22 00:01:04.09 00:00:13.21 D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4

This is a case where the same media was used 3 times The very beginning of the clip was used on track 5 at 6:10.15 to 6:14.24. At 6:14.18 through 6:25.06, 20.18 seconds of the clip was used beginning at 18.02 into the clip. Finally, at 6:35.01 ending at 6:48.22, another 13.21 seconds was used starting at the 1:04.09 point inside the clip.

Do you need to differentiate between audio and video tracks/events? That could be added after the track number. Also, generated medias ("VEGAS Titles and Text" for example) could be left off the list if you don't want them.

jetdv wrote on 5/27/2022, 11:04 AM

@wendell, and modified to show the track type (audio or video) and ignore all "generated media" events.

2   Video   00:00:05.21   00:00:13.00   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:00:47.27   00:00:55.07   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:01:00.12   00:01:07.21   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:03:36.21   00:03:44.01   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:04:32.01   00:04:39.10   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:05:18.27   00:05:26.06   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:05:52.01   00:05:59.10   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:06:16.26   00:06:24.06   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:07:00.03   00:07:07.12   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:08:06.02   00:08:13.11   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
2   Video   00:09:15.00   00:09:22.09   00:00:00.00   00:00:07.09   D:\Blogs\1258526_trackTravel_HD_LT.mov
3   Video   00:00:47.27   00:00:55.07   -00:00:00.00   00:00:07.09   D:\Blogs\Historical Markers\Hardin\Mine It Mill It Ship It.jpg
3   Video   00:01:00.12   00:01:07.21   -00:00:00.00   00:00:07.09   D:\Blogs\Historical Markers\Hardin\Florite Center.jpg
4   Video   00:00:00.00   00:00:14.22   00:00:00.00   00:00:14.22   D:\Blogs\Adventure Intro.mp4
4   Video   00:00:14.18   00:00:44.13   00:00:00.19   00:00:29.25   D:\Blogs\Historical Markers\Hardin\DJI_0393.MP4
4   Video   00:00:44.09   00:03:33.22   00:00:00.00   00:02:49.13   D:\Blogs\Historical Markers\Hardin\DJI_0395.MP4
4   Video   00:03:33.17   00:04:31.05   00:00:00.00   00:00:57.18   D:\Blogs\Historical Markers\Hardin\DJI_0396.MP4
4   Video   00:04:31.01   00:04:44.00   00:00:00.00   00:00:12.28   D:\Blogs\Historical Markers\Hardin\DJI_0397.MP4
4   Video   00:04:43.21   00:05:11.11   00:00:26.24   00:00:27.20   D:\Blogs\Historical Markers\Hardin\DJI_0397.MP4
4   Video   00:05:11.07   00:05:16.15   00:00:00.00   00:00:05.08   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
4   Video   00:05:16.11   00:05:50.28   00:00:15.19   00:00:34.17   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
4   Video   00:05:50.25   00:06:10.19   00:00:56.27   00:00:19.24   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
4   Video   00:06:10.15   00:06:14.22   00:00:04.03   00:00:04.07   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
4   Video   00:06:14.18   00:06:35.06   00:00:18.02   00:00:20.18   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
4   Video   00:06:35.01   00:06:48.22   00:01:04.09   00:00:13.21   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
4   Video   00:06:48.19   00:06:56.27   00:00:00.00   00:00:08.08   D:\Blogs\Historical Markers\Hardin\DJI_0401.MP4
4   Video   00:06:56.17   00:08:03.16   00:00:26.17   00:01:06.29   D:\Blogs\Historical Markers\Hardin\DJI_0401.MP4
4   Video   00:08:03.11   00:09:13.03   00:00:00.11   00:01:09.21   D:\Blogs\Historical Markers\Hardin\DJI_0402.MP4
4   Video   00:09:12.28   00:09:48.15   00:00:00.26   00:00:35.17   D:\Blogs\Historical Markers\Hardin\DJI_0403.MP4
4   Video   00:09:48.10   00:10:07.09   00:00:00.00   00:00:19.00   D:\Blogs\Historical Markers\Hardin\GH010185.MP4
4   Video   00:10:06.29   00:10:35.14   00:00:00.00   00:00:28.15   D:\Blogs\Historical Markers\Hardin\DJI_0394.MP4
4   Video   00:10:35.11   00:10:45.03   00:00:00.00   00:00:09.22   D:\Blogs\Adventure Closing.mp4
5   Audio   00:00:00.00   00:00:14.22   00:00:00.00   00:00:14.22   D:\Blogs\Adventure Intro.mp4
5   Audio   00:00:14.18   00:00:44.13   00:00:00.19   00:00:29.25   D:\Blogs\Historical Markers\Hardin\DJI_0393.MP4
5   Audio   00:00:44.09   00:03:33.22   00:00:00.00   00:02:49.13   D:\Blogs\Historical Markers\Hardin\DJI_0395.MP4
5   Audio   00:03:33.17   00:04:31.05   00:00:00.00   00:00:57.18   D:\Blogs\Historical Markers\Hardin\DJI_0396.MP4
5   Audio   00:04:31.01   00:04:44.00   00:00:00.00   00:00:12.28   D:\Blogs\Historical Markers\Hardin\DJI_0397.MP4
5   Audio   00:04:43.21   00:05:11.11   00:00:26.24   00:00:27.20   D:\Blogs\Historical Markers\Hardin\DJI_0397.MP4
5   Audio   00:05:11.07   00:05:16.15   00:00:00.00   00:00:05.08   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
5   Audio   00:05:16.11   00:05:50.28   00:00:15.19   00:00:34.17   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
5   Audio   00:05:50.25   00:06:10.19   00:00:56.27   00:00:19.24   D:\Blogs\Historical Markers\Hardin\DJI_0398.MP4
5   Audio   00:06:10.15   00:06:14.24   00:00:00.00   00:00:04.09   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
5   Audio   00:06:14.18   00:06:35.06   00:00:18.02   00:00:20.18   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
5   Audio   00:06:35.01   00:06:48.22   00:01:04.09   00:00:13.21   D:\Blogs\Historical Markers\Hardin\DJI_0399.MP4
5   Audio   00:06:48.19   00:06:56.27   00:00:00.00   00:00:08.08   D:\Blogs\Historical Markers\Hardin\DJI_0401.MP4
5   Audio   00:06:56.17   00:08:03.16   00:00:26.17   00:01:06.29   D:\Blogs\Historical Markers\Hardin\DJI_0401.MP4
5   Audio   00:08:03.11   00:09:13.03   00:00:00.11   00:01:09.21   D:\Blogs\Historical Markers\Hardin\DJI_0402.MP4
5   Audio   00:09:12.28   00:09:48.15   00:00:00.26   00:00:35.17   D:\Blogs\Historical Markers\Hardin\DJI_0403.MP4
5   Audio   00:09:48.10   00:10:07.09   00:00:00.00   00:00:19.00   D:\Blogs\Historical Markers\Hardin\GH010185.MP4
5   Audio   00:10:06.29   00:10:35.14   00:00:00.00   00:00:28.15   D:\Blogs\Historical Markers\Hardin\DJI_0394.MP4
5   Audio   00:10:35.11   00:10:45.03   00:00:00.00   00:00:09.22   D:\Blogs\Adventure Closing.mp4

 

wendell wrote on 5/27/2022, 12:00 PM

@jetdv I think you are spot on! This seems to be exactly what I need.

It would be better for me if I can keep the Vegas Titles and Text tracks as well.
If you could provide a tutorial on this, that would be aweomse!

Thanks!!

jetdv wrote on 5/27/2022, 12:14 PM

Editing the tutorial now! It will be on my website/channel on June 13th. Whether you skip or keep the generated media is really very simple. Right now I have:

if (!evnt.ActiveTake.Media.IsGenerated())

Two ways to "turn that off" - by changing that one line:

1: Make it a "comment"

//if (!evnt.ActiveTake.Media.IsGenerated())

2: Make it "always" run

if (true)

 

jetdv wrote on 6/13/2022, 8:43 AM

@wendell, this tutorial is now live on my website and youtube channel.

 

wendell wrote on 6/15/2022, 3:54 PM

That's awesome! Thank you for your help @jetdv!!