A script for batch converting multiple folders (for easy overnight runs)

Started by star99ers, February 15, 2012, 04:21:31 AM

Previous topic - Next topic

star99ers

This is a script I made for batch converting multiple folders in one run. I used the on the wiki as a starting point. I found that script was useful, but meant that I could only run one folder at a time, even if I had lots of videos that I wanted to convert overnight, for example.

To use the script:

  • Open a video file from one of your source folders, and generate a .js by tweaking the video/audio settings and saving as a project.
  • Edit the settings.js file from the rar, and place the video settings from your saved project into the convertFile() function.
    Make sure that you get rid of  calls to app.clearSegments(), app.addSegment(), app.markerA()/B(), and the setSuccess(1) call at the bottom.
    Also change the String in destExtension() to match your desired output, and change the separator string in sep() if you run Unix.
  • Run the batch.js file from the rar in Avidemux as a project. It will ask you for a source directory, then a destination directory, until you cancel a source directory selection.
    For each source directory choice, you must select a file with the same extension as the files that you want to convert (e.g. If you select ".avi", all ".mp4" files are ignored).
  • An information dialog will appear, indicating the number of source and destination directories selected.
  • The program will now convert the files from one source directory, and place them into the corresponding destination directory.

I have run the script a few times, and it seems to run without issue. The only potential problem I can see is that the video settings in the settings.js folder might not work well with different source videos (if the source videos had different frame rates, for example).


Tutorial I followed from the wiki:
http://www.avidemux.org/admWiki/doku.php?id=tutorial:batch_processing