Avidemux Forum

Avidemux => Windows => Topic started by: yktan on August 12, 2014, 02:46:44 AM

Title: Tinypy exception: KeyError nud
Post by: yktan on August 12, 2014, 02:46:44 AM
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 (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.
Title: Re: Tinypy exception: KeyError nud
Post by: Jan Gruuthuse on August 12, 2014, 03:18:07 AM
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)
Title: Re: Tinypy exception: KeyError nud
Post by: yktan on August 13, 2014, 01:45:21 AM
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?
Title: Re: Tinypy exception: KeyError nud
Post by: Jan Gruuthuse on August 13, 2014, 06:22:02 AM
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 (http://avidemux.org/smuf/index.php/topic,12105.0.html)
- Sample script : Convert a whole folder (http://avidemux.org/smuf/index.php/topic,16140.0.html)
Title: Re: Tinypy exception: KeyError nud
Post by: AQUAR on August 13, 2014, 11:02:22 AM
Maybe you are using a nightly!
The installer version has both spider monkey and tinypy.
Title: Re: Tinypy exception: KeyError nud
Post by: yktan on August 14, 2014, 03:01:42 AM
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?
Title: Re: Tinypy exception: KeyError nud
Post by: Jan Gruuthuse on August 14, 2014, 06:31:25 AM
Probably you can find some answers in this posting: Have problem with CLI and Scripts on Windows build 2.6 versions (http://avidemux.org/smuf/index.php?topic=10684.0)

Title: Re: Tinypy exception: KeyError nud
Post by: yktan on August 15, 2014, 07:13:56 AM
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.