News:

--

Main Menu

Tinypy exception: KeyError nud

Started by yktan, August 12, 2014, 02:46:44 AM

Previous topic - Next topic

yktan

Hi, I am using Aviemux 2.6.8 (64 bits) and I am trying to learn scripting using the tutorial found here: http://www.avidemux.org/admWiki/doku.php?id=tutorial:scripting_tutorial#complete_script. I copied complete script and saved as a .js file and tried to run it in Avidemux (File->Project Script->Run Project).

However, when I tried to run the script, it gave me a weird Tinypy exception:
Exception :(_tp_dict_get) KeyError: nud

I have no idea how to debug the script but the same exception also occurs when I run a completely empty .js file.

Can anyone tell me what I'm doing wrong here? Thanks for your help.

Jan Gruuthuse

#1
if you're pointing to the used script, it show here as a javascript one from wiki.
Menu -> File -> here you have possible 3 project choices:
- QtScript Project
- Tinypy Project
- SpiderMonkey Project <- try running from this option, and see if error persists.

QuoteScripting tutorial

This page tries to explain how scripting works inside Avidemux.

The scripting engine used by Avidemux is SpiderMonkey, and it is an ECMAScript/JavaScript engine. We will walk through a simple script that removes the evil packed bitstream from a whole directory.

Perhaps starting avidemux.exe from a dos window you get some more info from running script in that window. (keep it open)

yktan

Hi thanks for your reply.

Unfortunately, I do not have the project choices that you mentioned, I only have one "Run Project" option (screen cap below).

Also, running from command prompt doesn't give me more info either (screen cap below).

Should I try another version of avidemux?

Jan Gruuthuse

As non windows user: I have no idea. If you're using latest avidemux you should be alright.
Try Sample Tinypy script from developer and see if that brings you any further.
- [2.6.4] Convert a whole folder
- Sample script : Convert a whole folder

AQUAR

Maybe you are using a nightly!
The installer version has both spider monkey and tinypy.

yktan

Hi AQUAR,

I uninstalled and reinstalled the current installer version:
win64 2.6.8 v2 Install (64 bits),
MD5: d41a33b5a5e6a5fc0d1c27449f289a9c
and it's still the same.

Anyway, your reply prompted me to download a nightly (avidemux_r9052_win64) and I can see the spidermonkey script option.
However, when I tried to run the script, nothing happens and when I check the log, I noticed these lines:
Quote*** Automated : 28 entries*************
run-->1
[Script] SpiderMonkey INFO - Compiling "D:\zzz_edit\convert.js"...
[Script] SpiderMonkey INFO - Done.
[Script] SpiderMonkey INFO - Executing D:\zzz_edit\convert.js...
[Script] SpiderMonkey ERROR - ReferenceError: Avidemux is not defined
[Script] SpiderMonkey INFO - Done

********** Automation ended***********

I double checked and the first two lines of the script is:
//AD
var app = new Avidemux();

Is there something else that I should be taking care of?

Jan Gruuthuse


yktan

Thanks for your help Jan, I still can't solve the problem. I ended up learning python and wrote a tinypy script that works.

Thanks.