Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro Script to have sony vegas automatically add media to a layer?

  • Script to have sony vegas automatically add media to a layer?

    Posted by Cain Nuke on January 31, 2014 at 4:54 pm

    Hi,

    im using sony vegas 11 and i wonder if its possible to have sony vegas perform a couple tasks automatically by running a script or something.

    The premise is like this: my media is a video with 4 squares. Each one is outlined by a blue line at a certain moment. The idea is to make an image appear over that square every time that happens. The image lasts exactly the same amount of time the outline does. There is a different image for each square so i place every one of them on different layers.

    The original avi looks like this:

    https://i.imgur.com/RAVByfA.png

    This media goes to bottom layer. As you see, guy 3 is talking so his frame is outlined in blue as he talks.

    I want to put this image on top of that

    https://i.imgur.com/RAVByfA.png

    This image goes on top layer so it looks like this

    https://i.imgur.com/YaLnqb5.png

    I guess it must be a script that says something like:

    when this portion of the screen is [THIS COLOR] (blue) then add [NAME OF THE MEDIA] onto [LAYER NUMBER] while [IS COLOR]

    but i’ve never made it before. How can i accomplish this?

    Thank you.

    View post on imgur.com

    Cain Nuke replied 12 years, 2 months ago 3 Members · 32 Replies
  • 32 Replies
  • Graham Bernard

    January 31, 2014 at 6:46 pm

    I’ve been with Vegas since VV3. I have not come across anything in Vegas that will respond to a Chroma value and then act on it to do another action. And unless I haven’t understood your quest, this would be the fundamental STOP on any Script.

    Now naming a Selection or Region can be achieved with scripts and making Markers and Regions relating to Events is do-able. But nothing comes to mind that:

    A] Takes note of a Chroma Value – say for BLUE

    and then

    B] Acts on the action of A]

    But I’m always willing to learn.

    Grazie

    Video Content Creator and Potter
    PC 7 64-bit 16gb * Intel® Core™i7-2600k Quad Core 3.40GHz * 2GB NVIDIA GEFORCE GTX 560 Ti
    Cameras: Canon XF300 + PowerShot SX50HS Bridge

  • Cain Nuke

    January 31, 2014 at 6:58 pm

    Thanks for you answer. Some guy posted this on other forum and it might help:

    under “class VideoColor” , Public Properties it’s possible to get or set , the R,G,B components as a float or byte value

    Code:

    Syntax:
    class VideoColor

    Public Properties: Summary:
    Single Red Get or set the red component of the color as a float value.
    Single Green Get or set the green component of the color as a float value.
    Single Blue Get or set the blue component of the color as a float value.
    Single Alpha Get or set the alpha component of the color as a float value.
    Byte R Get or set the red component of the color as a byte value.
    Byte G Get or set the green component of the color as a byte value.
    Byte B Get or set the blue component of the color as a byte value.
    Byte A Get or set the alpha component of the color as a byte value.

  • Graham Bernard

    January 31, 2014 at 7:10 pm

    Can/will SONY reveal this in the Vegas SDK? And can this then be communicated to a script developer? And again, I think it is the “former” that has had everybody stumped, and that would require a script-Guru to get close to a SONY Engineer – IMO!

    Grazie

    Video Content Creator and Potter
    PC 7 64-bit 16gb * Intel® Core™i7-2600k Quad Core 3.40GHz * 2GB NVIDIA GEFORCE GTX 560 Ti
    Cameras: Canon XF300 + PowerShot SX50HS Bridge

  • Matt Carlson

    January 31, 2014 at 8:01 pm

    The VideoColor class is for defining a color to be used in media generation, track backgrounds, etc.

    Unfortunately the Vegas scripting environment does not have access to any video frame information at all. The only exception to that is the SaveSnapshot function. A script could be written to save a snapshot and move the cursor position after each one. It is a clunky work around and it will be rather slow (the snapshot sometimes takes a second or more to actually happen… that is a second or more per frame) Working on each snapshot will then require a complete routine built from scratch to do the analysis since Vegas scripting was not designed for video manipulation.

    The way Vegas was developed what you are asking for requires a plug-in. Writing a plug-in for a single set of circumstances is not worth the time in my opinion. It would be faster to just do the work by hand.

    How long does the entire sequence of changing borders run for?

  • Matt Carlson

    January 31, 2014 at 10:04 pm

    After thinking about it for a while this could be done without too much effort. The best way to go about it depends on some facts about your video that need clarification. Are the borders you are using to overlay actual video (animated) or are they static images? Are these images already prepared with transparent alpha? If the “talking heads” boxes do not move at all in frame (hopefully) then this is how I would do it.

    1) Put all of your overlay borders in to ONE image on one track above the main video.

    2) Use the Sony Cookie Cutter (in square mode) to get the effect you want on the first box. Write down the center and size of the square. Repeat for the other boxes.

    With this information on the boxes cataloged a script can be written to write key frames for the Cookie Cutter easily using the SaveSnapShot script function. As I said before though SaveSnapShot can take a while. It is dependent on the main Vegas window preview quality. The process will go quicker if the preview quality is set to draft/half but that might make the analysis of where the blue border shows up a bit less accurate.

  • Graham Bernard

    January 31, 2014 at 10:36 pm

    Yes, that’s along the lines I was thinking: Create Media and then choose from that media, borders, what you want. This relies on setting up media and then selecting Media. This isn’t Vegas “searching” for CHROMA and getting instructions from that CHROMA. Again, this is after the event, literally!

    Grazie

    Video Content Creator and Potter
    PC 7 64-bit 16gb * Intel® Core™i7-2600k Quad Core 3.40GHz * 2GB NVIDIA GEFORCE GTX 560 Ti
    Cameras: Canon XF300 + PowerShot SX50HS Bridge

  • Cain Nuke

    February 1, 2014 at 3:03 pm

    Yes, they are transparent pngs and they are not animated. Doing it manually is not a problem when its a single video. However it becomes tedious when you have to do it on a 30 minute video or more every week. This is why im desperately looking for a way to automatize the process.

  • Matt Carlson

    February 2, 2014 at 2:41 am

    It would really help to have a small sample of the video with two or three border changes in order to error proof this script. I pretty much have everything done but I need to know if color ranges are going to be a problem (i.e. is the light blue color consistent or does it need a small range for comparison.)

  • Cain Nuke

    February 3, 2014 at 10:45 am

    Thanks for your help. This a rar file with all the data.

    https://f1.creativecow.net/7090/test-for-vegas-script

  • Matt Carlson

    February 3, 2014 at 7:31 pm

    I should have it working by tomorrow.

Page 1 of 4

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy