Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro Changed project file to almost exact one but now it’s a milisecond off

  • Changed project file to almost exact one but now it’s a milisecond off

    Posted by Johnny Chevy on July 17, 2023 at 3:17 am

    It’s the same movie. Same length. It’s just a milisecond off so every single segment has some of the previous shot. Because I’m cutting the movie not from the raw footage but from the edited film. So in other words, each shot pretty much, if you drag it a second back you will see the shot that is before it. Is there a way to cut a certain amount from the beginning of a segment and the end, from the entire video timeline, all at once?

    Johnny Chevy replied 10 months, 1 week ago 2 Members · 11 Replies
  • 11 Replies
  • Aivis Zons

    July 17, 2023 at 3:46 pm

    If I understood your problem correctly – you need to trim the beginning and end of many clips by the same amount – then you need a script for this.

    Luckily I did manage to find a couple of scripts just for this task. I’ve attached two that I tested and updated to work in latest versions (not taking any credit for these – I just edited 1 line).

    “Trim front and back.js” – as it is now it will trim 5 frames from the beginning and end of everything you have selected. It ignores grouped media that isn’t selected, so you have to select video and audio clips. After you run the script it will leave gaps – you can close these by first selecting the area you want to close the gaps for with a loop region, then right click within the appropriate track and click “Close Gaps”.
    If you want to edit the trim amount – open the script file with a text editor like notepad++ and in line 29 where it says “var trimAmt = new Timecode(“00:00:00:05″);” – that timecode value is what determines trim amount; right now it’s 5 frames.

    “Trim+Captured+Clips+v1.0.cs” – here you can define separate values for start and end trim amounts. Line 39 for start, line 40 for end of clip. As it is it’s also set to 5 frames for both. Same process as for previous script, but this one also closes the gaps. Didn’t test this as much, but also worked fine after fixing for latest versions.

    You can run these scripts by first selecting your clips and then going to Tools -> Scripting -> Run Script… and locate the script. One of them you have to extract first as that file format wasn’t supported to upload directly.
    If you want to add them to the list of existing scripts, you have to place them in the Script Menu folder (found where Vegas Pro is installed; for me – C:\Program Files\VEGAS\VEGAS Pro 20.0\Script Menu). Click on “Rescan Script Menu Folder” for them to show up.

  • Johnny Chevy

    July 17, 2023 at 7:32 pm

    Shoot, I screwed up my post.

    I put my time format as measures and beats and the clip ends at 87.4.054 instead of 87.4.042. So I need to cut 12 beats (or is it measures?) from the end of every video clip and add that same amount to the beginning of every clip.

  • Aivis Zons

    July 18, 2023 at 1:34 am

    Wouldn’t that be slipping the clips? So if you hold Alt and click and drag a clip to the right in your case – that would move the footage forward, but maintain the same position in timeline. Then the original beginning would be x frames into the clip and the original end would be x frames out of the clip, so cut off.

    There’s a tool for batch slipping here: https://tools4vegas.com/slipslide-tools/
    Installation instructions are on the site, and to use it you first have to run the config script, set the values and then the Slip Right script. Config script aside – the process is the same as for previously mentioned scripts.

    As for the time format – you’ll probably have to switch to time & frames for accuracy, but I believe it might be 5 frames? Not sure, honestly haven’t ever used measures and beats.

  • Johnny Chevy

    July 18, 2023 at 8:38 pm

    How do you run the config script?

    I downloaded the slipslide tool, extracted it, and put the files in the script folder but when I select it in the program I get an error.

  • Johnny Chevy

    July 18, 2023 at 8:46 pm

    Another way to get this done would be to somehow tell the program to add a few miliseconds to the beginning of my video file. Is that possible?

  • Aivis Zons

    July 18, 2023 at 10:19 pm

    Can you be more specific with the error description? Hard to say what “an error” could be.

    But to add a few miliseconds to the start of the clip – it only now occurred to me you could actually use the “Trim+Captured+Clips+v1.0” script I attached previously for slipping footage too. So you have to edit the script file and change the value for StartTrim in line 39 to a a negative value.
    Like so: Timecode clipStartTrim = Timecode.FromFrames(-5);

    This will add 5 frames to the start of your clip. And then if you don’t want to affect the end of the clip set the EndTrim value in line 40 to “0”. Or if you set it to “5” in this case – it will be the same as slipping the clip 5 frames – original start will be 5 frames in, original end will be 5 frames out and cut off.

  • Johnny Chevy

    July 18, 2023 at 11:03 pm

    I tried to attach a photo of the error but the attach button doesn’t work for some strange reason. Here’s the message though:

    an error occured during execution of script

    error 0x80070002

    System.IO.FileNotFoundException: Could not load file or assembly ‘Sony.Vegas, Version=12.0.0.770, Culture=neutral, PublicKeyToken=3cda94b1926e6fbc’ or one of its dependencies. The system cannot find the file specified.

    File name: ‘Sony.Vegas, Version=12.0.0.770, Culture=neutral, PublicKeyToken=3cda94b1926e6fbc’

    at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)

    at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()

    at System.Reflection.RuntimeMethodInfo.GetParametersNoCopy()

    at System.RuntimeType.FilterApplyMethodBase(MethodBase methodBase, BindingFlags methodFlags, BindingFlags bindingFlags, CallingConventions callConv, Type[] argumentTypes)

    at System.RuntimeType.GetMethodCandidates(String name, BindingFlags bindingAttr, CallingConventions callConv, Type[] types, Boolean allowPrefixLookup)

    at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)

    at ScriptPortal.Vegas.ScriptHost.ScriptManager.Run(Assembly asm, String className, String methodName)

    at ScriptPortal.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)

    WRN: Assembly binding logging is turned OFF.

    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

    Note: There is some performance penalty associated with assembly bind failure logging.

    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

    ……..

    But the file you attached might be the answer. I applied it and it mostly fixed the problem. But the problem is the way I cut most clips is right at the start and end of most shots, so even if it’s off by a milisecond I will see some of the shot before and after. I think with your fix I will have a lot less work as before though. But that’s why I wanted to work with beats/measures instead, as it’s more precise. For example with frames, my clips are only off by about 2, but with beats/measures they’re off by 12. I tried to change Frame into measures, or beats, in notepad++ but that gave me an error in the program. Do you know if there’s a way? Thank you so much by the way.

  • Aivis Zons

    July 19, 2023 at 12:27 am

    I was able to replicate the error by installing the script from the wrong folder. I believe you used the .dll files from the “Sony” folder, but you should’ve gone with the “Magix” folder contents. Vegas Pro changed ownership to Magix with version 14 and that Sony folder is reserved for older versions.

    As for the measures & beats – couldn’t find any mention of implementing them in scripts. However, I don’t think that they give any extra precision when it comes to video, they’re meant for audio production and easier syncing to audio. I tried zooming in all the way on my timeline and switching between Time & Frames, Measures & Beats, Absolute frames, but you can only ever cut frame by frame – there’s no extra frames from switching between time formats – they’re only visual guides.

    Technically, you could increase project framerate and then you get something “extra”. So if my project is 60fps, I switch to 120fps in project settings, cut 1 frame, back to 60fps – I will have footage the length of half a frame, but I’d say you can’t really work with that, might introduce additional problems along the way; better to stick with native/target framerates.
    Bottom line – if your video is a standard 30fps, then there’s exactly 30 frames in a full second of footage; no more, no less. The frame number is an integer – can’t snap video to frame 30.1, 40.72, 0.5, etc. Audio seems to be a different story.

  • Johnny Chevy

    July 20, 2023 at 6:24 pm

    Actually I have my project not set to “quantize to frames” so some frames at the beginning and end of clips are cut. But thanks anyway, your fix saved me a lot of time.

  • Aivis Zons

    July 20, 2023 at 8:44 pm

    Wow, I had completely forgotten about quantize to frames toggle, you’re absolutely right! Was really wondering how you got extra precision there hahaha

    Glad I could help otherwise!

Page 1 of 2

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