VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Hi guys,

    I am using AviDemux to deinterlace my MPEG2 files. (Actually, they are .TOD, but Avidebux copes well with them).

    I have all my *.TOD files in a 'Raw' folder. At the moment, I manually go through each file, select it, select the filters, and Save. Takes ages. Is there a script that can use that would go through a target folder, open each file, apply my deinterlace filter, and save to a destination folder?

    I have no scripting experience - just hoping I can get a pointer and get started.
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    1. Open your tod video in avidemux and set all the settings. Under File -> Save Project as a file like deinterlace.js

    2. Open notepad and copy and paste all this
    Code:
    :: avidemux batch
    :: Edit variables (programm OUTDIR PROJECT)
    :: Edit to select desired file type.(line 26)
    :: Edit "shutdown" line for desired action 
    :: Copy this file to directory with video to be processed and run.
    ::
    @echo off
    cls
    echo ..... Processing Video - Please Wait !! .....
    echo.
    echo.       Computer will SHUTDOWN after processing if
    echo.           psshutdown is unremarked.
    echo.
    echo ..... Processing Video - Please Wait !! .....
    
    SETLOCAL
    
    set programm="C:\Program Files\Avidemux 2_4\avidemux2_gtk.exe"
    :: Do NOT enclose OUTDIR value in quotes!That will cause format error when %OUTDIR%%%i.tod is enclosed. ("%OUTDIR%%%i.tod") becomes (""%OUTDIR%"%%i.tod")
    set OUTDIR=C:\folder\output\
    set PROJECT="C:\folder\deinterlace.js"
    
    :: %%i and %OUTDIR%%%i.tod are enclosed with quotes because file names contain spaces
    for %%i in (*.tod) do (
    start /w "" %programm% --nogui --load "%%i" --run %PROJECT% --save "%OUTDIR%%%i.mpg" --quit
    )
    echo.
    echo.
    echo. ____!!Processing Complete!!____
    echo.
    Pause
    ENDLOCAL
    Replace the programm location to your location to the avidemux.
    Change the OUTDIR location to a output folder where the files should be saved.
    Change the PROJECT location to the deinterlace.js file you created in avidemux.
    Save the file as avidemux.bat in your folder with the tod files.

    Then just double click on the .bat file to run it. Or run from a command box/cmd. But try on a few files first, put the avidemux.bat and some tod file in a folder and run.

    All this information can you find in the avidemux forum also.
    Quote Quote  
  3. Thanks Baldrick!

    Sorry for the delay.. never knew there was a reply.

    I am using your batch file, and it's nearly working...

    When I start it, I get a 'File cannot be opened' error, but when I OK that, it starts.... Working on it...

    Also, it keeps processing the first file... So, the files names in output are all correct, but they contain video from the first .TOD file...
    Last edited by Cralis; 5th Mar 2010 at 16:26.
    Quote Quote  
  4. Member
    Join Date
    Mar 2010
    Location
    Germany
    Search Comp PM
    I had another Problem, which I had solved with avidemux manually.
    But I too, wanted to automate this for all files in one directory.
    Thaks to Baldrick - his script helped me getting the right Commands for the automatization of avidemux.

    The reason for Cralis always processing the first file is, I think:
    Prozessing a project, as avidemux saves it, at first loads the file which has been loaded when saving the project.
    Solve this by deleting the corresponding lines (use a Text-Editor) in the project-file.
    I did the same. Compare my projectfile before and after deletion.
    i changed my pathes and filenames to BIG-LETTERS and
    the 8 lines (Line 7 to 14) to delete are marked with 3 leading Stars ***.
    The rest ist the original project as saved by avidemux.
    Because of me using Linux, / ist used in a path, where \ will be used in windows.
    Because of me solving another problem, the lines may look different, but I hope,
    the lines to be deleted can be found with this example:

    //AD <- Needed to identify//
    //--automatically built--
    //--Project: /PATH-OF-PROJECT/NAME-OF-PROJECT

    var app = new Avidemux();

    ***//** Video **
    ***// 01 videos source
    ***app.load("/PATH-OF-VIDEOSOURCE/NAME-OF-VIDEOSOÄURCE");
    ***//01 segments
    ***app.clearSegments();
    ***app.addSegment(0,0,28496);
    ***app.markerA=0;
    ***app.markerB=28495;

    //** Postproc **
    app.video.setPostProc(3,3,0);

    app.video.fps1000 = 25000;

    //** Filters **

    //** Video Codec conf **
    app.video.codec("Copy", "CQ=4", "0 ");

    //** Audio **
    app.audio.reset();
    app.audio.codec("copy",32519,0,"");
    app.audio.normalizeMode=0;
    app.audio.normalizeValue=0;
    app.audio.delay=0;
    app.audio.mixer="NONE";
    app.audio.scanVbr();
    app.setContainer("AVI_UNP");
    setSuccess(1);
    //app.Exit();

    //End of script

    I hope, this will help you.
    Quote Quote  
  5. Member
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    Maybe this writeup will help someone. It provides an breakdown of the basic elements of an Avidemux script.

    http://bitsynthesis.com/2010/06/avidemux-basic-script-elements/
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!