Error randomly while using a script

relaxvideo wrote on 8/25/2015, 3:10 PM
I use a few scripts with Vegas11 for making editing faster.
Frameserver rendering script, a simple add fx script for stereo 3d adjust, etc.

80% of the time these scripts work without any error, but sometimes i have this error message:



Why is that? Memory is corrupt? I don't think, my sytem is good otherwise.
I'm on 64bit if this matters.

One script for example:

import Sony.Vegas;
import System.Windows.Forms;
import Microsoft.Win32;

var plugInName = "Sony Stereoscopic 3D Adjust";
var presetName = "Default";

try
{
for (var track in Vegas.Project.Tracks) {
for (var evnt in track.Events) {
if (!evnt.Selected || evnt.MediaType != MediaType.Video) continue;

var fx = Vegas.VideoFX;

var plugIn = fx.GetChildByName(plugInName);
if (null == plugIn) {
throw "could not find a plug-in named: '" + plugInName + "'";
}

var effect = new Effect(plugIn);
evnt.Effects.Add(effect);
if (null != presetName) {
effect.Preset = presetName;
}
}
}
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}

Comments

wwaag wrote on 8/25/2015, 9:20 PM
I used to get the same error message quite frequently in V12 using very simple scripts for cursor movement (E.g. move cursor to right 3 sec.--really simple). Here's the thread I started http://www.sonycreativesoftware.com/forums/showmessage.asp?forumid=4&messageid=849531. You see the same error message. During an editing session, once that error occurred, all other scripts would produce the same message and I would have to reboot Vegas and sometimes even a cold reboot into Windows. It has nothing to do with corrupted memory in your system. The problem has to do with Microsoft's DotNet. As I recall, I ended up deleting all versions of DotNet and then did a clean install of the latest (at the time it was 4.5.1), although I had to re-install some earlier versions for specific apps (e.g. Procoder). After doing this, I still had the occasional problem, but even these disappeared when I upgraded to V13. I believe there was a major re-write within Vegas updating to the latest version of DotNet. Since then, I haven't had that particular problem. Wish I could be of more assistance.

wwaag

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

relaxvideo wrote on 8/26/2015, 1:10 AM
Yes, this is a new win7 install and v11.
On my old system on other hdd (same win7 and v11), this error never happened.
So i think the difference is only the net framework.
Now i have version 4 (the client profile and extended) installed.

As i see 4.5.2 is the latest. Should i install it?

Also i have error message randomly at vegas exit.

EDIT: i just checked, on my other system, also the v4 framework is intalled. But there i see more visual c++ redistributable installed. Maybe some is missing in my new system?

Oh and the old vegas version is build 683, now i use build 701. Maybe this?

#1 Ryzen 5-1600, 16GB DDR4, Nvidia 1660 Super, M2-SSD, Acer freesync monitor

#2 i7-2600, 32GB, Nvidia 1660Ti, SSD for system, M2-SSD for work, 2x4TB hdd, LG 3D monitor +3DTV +3D projectors

Win10 x64, Vegas22 latest

Warper wrote on 8/26/2015, 5:17 AM
It's related to run-time compiler for javascript.NET
I've heard of exceptions like this that in my scripts (I wrote script, another person uses them) if you hit bind key often. Probably, it might be when other work is done in parallel or you manage to run script when another script is still finishing.

AFAIK javascript.NET is a part of .NET framework 1.1 and is not updated by by Microsoft for a long time. So, 4.5.2 probably will not help. It should not hurt to update .NET anyway, but I'd not hold my breath.

You can try to rewrite scripts to C# scripts. It's more "native" to .NET and there's hope you'll not step into this compiler behaviour.

wwaag wrote on 8/26/2015, 12:15 PM
@relaxvideo

Also i have error message randomly at vegas exit.

I still have these in V13 on occasion. Not a real problem since it only occurs on exit. As I said before, the greatest improvement for me was going from V12 to V13. Just the increase in stability was worth the upgrade cost. Having said that, there are still problems relating to scripting. For example, using Vegasaur, Replace Media often hangs in V13, but works just fine in V12. Outside of Vegasaur, the Batch Replace script also exhibits the same behavior--works fine in V12, but not 13. But at least, the same veg file can be opened in either V12 or V13, so a workaround is available.

@warper.

if you hit bind key often.

What do you mean by this?

It's interesting you mention .NET 1.1. That's the one other framework that I had to install on my system to make Procoder work.

wwaag

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Warper wrote on 8/27/2015, 3:31 AM
What do you mean by this?
There are few scrips that emulated V12 keys in V11 and did quick navigation: cut left part of clip, cut right part, move cursor to next cut in timeline etc. No big fancy stuff, just small utility scripts. The user put them on toolbar and added bind keys to them. Then he simply hit key on keyboard to do this or that.
It works ok if you do it from time to time. But when he started to use these keys->toolbars->scripts like once a second, he got into same trouble as you.
relaxvideo wrote on 8/27/2015, 5:09 AM
"You can try to rewrite scripts to C# scripts"

No way, it was hard enough to make my own script with fx and presets what i want :)

On my old system i use my own hotkeys for displaying left-right-anaglyph preview in a 3d project, or start rendering with debugmode frameserver. This error never (yes, never!) happened on this system since years, so the problem is not with win7 or vegas, instead some c++ or net framework. I should install the same, as on my old system. (the pc hardware is exactly the same of course)

#1 Ryzen 5-1600, 16GB DDR4, Nvidia 1660 Super, M2-SSD, Acer freesync monitor

#2 i7-2600, 32GB, Nvidia 1660Ti, SSD for system, M2-SSD for work, 2x4TB hdd, LG 3D monitor +3DTV +3D projectors

Win10 x64, Vegas22 latest

relaxvideo wrote on 10/18/2015, 2:02 AM
I still don't know why this error occurs often on my fresh win7/64 install and never happened with my old win7/64 (same vegas11).

I really like my rendering buttons on the toolbar, i can creat a rendered file with one click. Is it possible to play this file automatically, so call an external program with the script, like mpc?

#1 Ryzen 5-1600, 16GB DDR4, Nvidia 1660 Super, M2-SSD, Acer freesync monitor

#2 i7-2600, 32GB, Nvidia 1660Ti, SSD for system, M2-SSD for work, 2x4TB hdd, LG 3D monitor +3DTV +3D projectors

Win10 x64, Vegas22 latest

JohnnyRoy wrote on 10/18/2015, 8:21 AM
> "You can try to rewrite scripts to C# scripts"
> "No way, it was hard enough to make my own script with fx and presets what i want :)"

I also think it might be the fact that you are using JavaScript instead of C# so I've converted your script to C# for you so that we can all see if that was really the problem.

Here is the C# version of your script:

using System;
using Sony.Vegas;
using System.Windows.Forms;

class EntryPoint
{
String plugInName = "Sony Stereoscopic 3D Adjust";
String presetName = "Default";

/// <summary>
/// Vegas entry point
/// </summary>
/// <param name="vegas">the running Vegas instance</param>
public void FromVegas(Vegas vegas)
{
try
{
foreach (Track track in vegas.Project.Tracks)
{
foreach (TrackEvent trackEvent in track.Events)
{
if (!trackEvent.Selected || trackEvent.MediaType != MediaType.Video) continue;

PlugInNode plugIn = vegas.VideoFX.GetChildByName(plugInName);
if (null == plugIn)
throw new ApplicationException(String.Format("Failed to find plug-in: '{0}'", plugInName));

Effect effect = new Effect(plugIn);
((VideoEvent)trackEvent).Effects.Add(effect);
if (null != presetName)
{
effect.Preset = presetName;
}
}
}
}
catch (Exception e)
{
MessageBox.Show(e.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}

Don't forget to name it AddFX.cs and not .js. Let us know if this fixes the problem for you.

~jr

John Rofrano
Sundance Media Group / VASST
www.vasst.com
www.fasstapps.com
relaxvideo wrote on 10/19/2015, 12:48 PM
thanks, i will try it soon

#1 Ryzen 5-1600, 16GB DDR4, Nvidia 1660 Super, M2-SSD, Acer freesync monitor

#2 i7-2600, 32GB, Nvidia 1660Ti, SSD for system, M2-SSD for work, 2x4TB hdd, LG 3D monitor +3DTV +3D projectors

Win10 x64, Vegas22 latest