automating video conversion with Avidemux

1,152 views
Skip to first unread message

Ulrich Stern

unread,
Aug 18, 2012, 3:00:31 PM8/18/12
to ct...@googlegroups.com
All,

I have been using Avidemux for some time to convert AVIs into a format that works well in Ctrax, so it was time to automate the conversion of multiple videos.  The attached script converts all videos in the directory the user selects, from my recording format (H.264, 640x480, 15fps, color) to my tracking format (M-JPEG, 320x240, 7.5fps, greyscale).  The comments in the script give more details on usage and how to customize it for different formats.

Cheers,

Uli
convertForCtrax.js

JJ

unread,
Oct 7, 2013, 6:18:39 PM10/7/13
to ct...@googlegroups.com
Hello Ulrich,
I am interested in trying to utilize your script in order to automate our video conversions.  No one in our lab is especially well-versed in javascript.  Is there any chance you have additional instructions which may help us to implement the script?  The version of avidemux we have installed is 2.6.1.  Is that a newer release than is described in your code?
I appreciate your help! 
 
Best,
Natalie

Ulrich Stern

unread,
Oct 8, 2013, 2:56:30 PM10/8/13
to ct...@googlegroups.com, Ulrich Stern
Natalie,
 
The script works in Avidemux 2.5.6.  But when I tried to upgrade to 2.5.6-1 a while back, it no longer worked.  I just tried the latest version (2.6.6), and the script no longer works there, either; it seems they switched to Python for their scripting language.  Version 2.5.6 (which I use on our tracking machines) is still available at, e.g., http://sourceforge.net/projects/avidemux/files/avidemux/2.5.6/.
 
As a quick test, just save the script and then open it in Avidemux via “File –> Load/Run Project...”  If you get the pop-up “Please select video directory by selecting a file in it” the script started properly.
 
The fastest way to figure out how to write the JavaScript for a conversion different from the one in my script is typically to do the conversion manually, do “Save Project” to generate the JavaScript, and then copy the relevant lines from that script into mine -- usually the part under “filters” in my script would change.  The Avidemux wiki also has pages about Scripting (http://avidemux.org/admWiki/doku.php?id=using:scripting) and a Scripting tutorial (http://avidemux.org/admWiki/doku.php?id=tutorial:scripting_tutorial); both are still for JavaScript.  :)
 
Cheers,
 
Uli
--
You received this message because you are subscribed to the Google Groups "ctrax" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ctrax+un...@googlegroups.com.
To post to this group, send email to ct...@googlegroups.com.
Visit this group at http://groups.google.com/group/ctrax.
For more options, visit https://groups.google.com/groups/opt_out.

Ulrich Stern

unread,
Oct 8, 2013, 3:18:06 PM10/8/13
to ct...@googlegroups.com, Ulrich Stern
PS: attached an Avidemux script for a different conversion.  Crops on all 4 sides of a 1080p video, and then turns it into 320x320.  Also skips more frames at the beginning of the video (FIRST_FRAME) since our 1080p videos have a second or so in the beginning where the brightness is unstable.
convertCrop1080p.js
Reply all
Reply to author
Forward
0 new messages