Author Topic: [SOLVED] Custom presets not showing up in "Custom" menu  (Read 6126 times)

bamboozle

  • Newbie
  • *
  • Posts: 17
[SOLVED] Custom presets not showing up in "Custom" menu
« on: April 04, 2015, 02:40:36 PM »
Hi all,

I have followed this tutorial 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?
« Last Edit: April 04, 2015, 07:32:18 PM by bamboozle »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6022
Re: Custom presets not showing up in "Custom" menu
« Reply #1 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
2.6 audio track switching in job.py

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.
« Last Edit: April 04, 2015, 07:33:58 PM by Jan Gruuthuse »

bamboozle

  • Newbie
  • *
  • Posts: 17
Re: Custom presets not showing up in "Custom" menu
« Reply #2 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.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6022
Re: Custom presets not showing up in "Custom" menu
« Reply #3 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
Code: [Select]
//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:
Code: [Select]
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:
Code: [Select]
#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:
Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
Editor.openVideo("/media/user/Werk/0xp1000/010seconds1920x1080.ts");
Editor.segments.clear()
Editor.segments.add(0, 10240000, 0);
Editor.setMarkers(0, 10240000);

bamboozle

  • Newbie
  • *
  • Posts: 17
Re: Custom presets not showing up in "Custom" menu
« Reply #4 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.
  • use the "Save as project" menu entry to backup your settings/presets
  • remove the file-specific settings from the saved presets (e.g. loadVideo, clearSegments, addSegment, markerA, markerB)
  • make sure that file extension for your custom presets is .py (not .js)
  • move the presets file to the folder \Users\<UserName>\AppData\Roaming\avidemux\custom (for Avidemux 2.6+ on Windows 7)
  • restart Avidemux

Again, thanks a lot for your help, Jan!

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6022
Re: [SOLVED] Custom presets not showing up in "Custom" menu
« Reply #5 on: April 04, 2015, 07:35:07 PM »
Your welcome, thanks for feedback, other windows users will appreciate this.