Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: bamboozle on April 04, 2015, 02:40:36 PM

Title: [SOLVED] Custom presets not showing up in "Custom" menu
Post by: bamboozle on April 04, 2015, 02:40:36 PM
Hi all,

I have followed this tutorial (http://www.avidemux.org/admWiki/doku.php?id=tutorial:presets) in order to create my own presets/scripts with custom xvid settings. However, after placing the scripts in the "custom" folder and restarting Avidemux the "Custom" menu remains empty. I have even tried to use the example script from the tutorial but without success.

I'm using Avidemux 2.6.8 on Windows 7 and am placing the scripts in: \Users\<UserName>\AppData\Roaming\avidemux\custom

Any idea what the problem could be? Is the linked tutorial still valid for Avidemux version 2.6.8?
Title: Re: Custom presets not showing up in "Custom" menu
Post by: Jan Gruuthuse on April 04, 2015, 03:03:14 PM
The tutorial is from 2.4 to 2.5.6 era.
You have only avidemux 2.6.8  installed?
Look for a avidemux6 folder. You should have there a sub folder custom.
see
Custom Menu and Saved projects (http://avidemux.org/smuf/index.php/topic,10948.0.html)
2.6 audio track switching in job.py (http://avidemux.org/smuf/index.php/topic,10499.0.html)

not all xvid settings are available in 2.6.8 avidemux.

Make your settings and save from Avidemux: menu: File: Tinypy Project: Save as project.
The saved file.py can then be used from the sub folder custom. You should just remove references to the loaded video file in that project.
Title: Re: Custom presets not showing up in "Custom" menu
Post by: bamboozle on April 04, 2015, 03:25:26 PM
Hi Jan,

thanks for the quick feedback. Yes, Avidemux 2.6.8 is the only version that I have installed on my machine. I had a look around but couldn't find an avidemux6 folder anywhere. I tried to create one myself but that didn't help. However, after renaming my existing script in the avidemux/custom folder from "test.js" to "test.py" it suddenly shows up in the custom menu. So that's one small step forward.  :)

BUT: The script still doesn't work. When I click the menu item I get a "TinyPy Exception" saying "invalid statement 1: var app = new Avidemux();". That's probably because the script is actually JavaScript and not Python as the file extension would suggest.

I had created my script by running "File > Project Script > Save as Project...". There is no "Tinypy Project" entry in my "File" menu. Could this be because I'm using Windows? As far as I know, Windows does not come with a python interpreter installed - in contrast to Linux and Mac.
Title: Re: Custom presets not showing up in "Custom" menu
Post by: Jan Gruuthuse on April 04, 2015, 05:07:41 PM
Sorry no windows here. But here are samples how each look:
SpiderMonkey project is saved as: filename.js and looks like this
//AD  <- Needed to identify //
//--automatically built--

adm.loadVideo("/media/user/Werk/0xp1000/010seconds1920x1080.ts");
adm.clearSegments();
adm.addSegment(0, 0, 10240000);
adm.markerA = 0;
adm.markerB = 10240000;
adm.videoCodec("Copy");
adm.audioCodec(0, "copy");
adm.audioCodec(1, "copy");
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1280");


remove above these references to loaded video:
adm.loadVideo("/media/user/Werk/0xp1000/010seconds1920x1080.ts");
adm.clearSegments();
adm.addSegment(0, 0, 10240000);
adm.markerA = 0;
adm.markerB = 10240000;


Tinypy Project saved as filename.py
and looks like:
#PY  <- Needed to identify #
#--automatically built--

adm = Avidemux()
adm.loadVideo("/media/user/Werk/0xp1000/010seconds1920x1080.ts")
adm.clearSegments()
adm.addSegment(0, 0, 10240000)
adm.markerA = 0
adm.markerB = 10240000
adm.videoCodec("Copy")
adm.audioClearTracks()
adm.setSourceTrackLanguage(0,"eng")
adm.setSourceTrackLanguage(1,"eng")
adm.audioAddTrack(0)
adm.audioCodec(0, "copy");
adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 0,0)
adm.audioAddTrack(1)
adm.audioCodec(1, "copy");
adm.audioSetDrc(1, 0)
adm.audioSetShift(1, 0,0)
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1280")


remove above these references to loaded video:
adm.loadVideo("/media/user/Werk/0xp1000/010seconds1920x1080.ts")
adm.clearSegments()
adm.addSegment(0, 0, 10240000)
adm.markerA = 0
adm.markerB = 10240000


QtScript Project saved as filename.admjs
and looks like:
Editor.closeVideo();
Editor.openVideo("/media/user/Werk/0xp1000/010seconds1920x1080.ts");
Editor.segments.clear()
Editor.segments.add(0, 10240000, 0);
Editor.setMarkers(0, 10240000);

Editor.currentVideoEncoder = CopyVideoEncoder;
Editor.audioOutputs.clear();

audioOutput = new CopyAudioEncoder();
Editor.audioOutputs.add(0, audioOutput);
Editor.audioOutputs[0].drcEnabled = false;
Editor.audioOutputs[0].timeShift = 0;

audioOutput = new CopyAudioEncoder();
Editor.audioOutputs.add(1, audioOutput);
Editor.audioOutputs[1].drcEnabled = false;
Editor.audioOutputs[1].timeShift = 0;

Editor.currentMuxer = MkvMuxer;


remove above these references to loaded video:
Editor.openVideo("/media/user/Werk/0xp1000/010seconds1920x1080.ts");
Editor.segments.clear()
Editor.segments.add(0, 10240000, 0);
Editor.setMarkers(0, 10240000);
Title: Re: Custom presets not showing up in "Custom" menu
Post by: bamboozle on April 04, 2015, 07:31:33 PM
Hi Jan,

thanks for the sample files - I've figured it out now. The problem was the "new" keyword which was left over in my preset file from the outdated example that I had copied.

To sum it up for other people that may come across this post.

Again, thanks a lot for your help, Jan!
Title: Re: [SOLVED] Custom presets not showing up in "Custom" menu
Post by: Jan Gruuthuse on April 04, 2015, 07:35:07 PM
Your welcome, thanks for feedback, other windows users will appreciate this.