VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. I asked this question some time back, a year ago maybe (might not have been this forum). The question wasn't understood and I think I got an "it can't be done" response and another convoluted one that I didn't understand. Anyway, re-visiting this problem as I'd like to get resolution once and for all.

    Yes, Avidemux settings can be saved to a preset. I stumbled upon this a couple months back or so:
    http://www.avidemux.org/admWiki/doku.php?id=tutorial(colon)presets (because of colon in URL, link to the left might not work. If so, go to "Tutorials & guides" on menu on left and choose "Presets").

    However, now, as then, the instructions don't work. They're not comprehensive enough. Last time I tried it, I gave up since it took me a couple of hours of work and I didn't get a working solution. This time, I've wasted only half an hour but I know one thing for sure needs fixing. The tutorial above _seems_ to be taking into account video only. The audio settings aren't saved. We need all the items we select in GUI to be reflected in the custom script (except for input video and output video, of course).

    Here is a test script with all my Video/Audio general settings in a temporary project file (no extra filters, though. Those are individual to each AVI file, if even needed):


    //AD <- Needed to identify//
    //--automatically built--
    //--Project: C:\Documents and Settings\....\Application Data\avidemux\jobs\/AVI - XviD, MP3 Preset file.js

    var app = new Avidemux();

    //** Video **
    // 01 videos source
    app.load("D:/1. Menu.avi");
    //01 segments
    app.clearSegments();
    app.addSegment(0,0,929);
    app.markerA=0;
    app.markerB=928;

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

    app.video.fps1000 = 29970;

    //** Filters **

    //** Video Codec conf **
    app.video.codecPlugin("92B544BE-59A3-4720-86F0-6AD5A2526FD2", "Xvid", "CQ=4", "<?xml version='1.0'?><XvidConfig><presetConfiguration><n ame>&lt;default&gt;</name><type>default</type></presetConfiguration><XvidOptions><threads>0</threads><vui><sarAsInput>false</sarAsInput><sarHeight>1</sarHeight><sarWidth>1</sarWidth></vui><motionEstimation>high</motionEstimation><rdo>dct</rdo><bFrameRdo>false</bFrameRdo><chromaMotionEstimation>true</chromaMotionEstimation><qPel>false</qPel><gmc>false</gmc><turboMode>false</turboMode><chromaOptimiser>false</chromaOptimiser><fourMv>false</fourMv><cartoon>false</cartoon><greyscale>false</greyscale><interlaced>none</interlaced><frameDropRatio>0</frameDropRatio><maxIframeInterval>300</maxIframeInterval><maxBframes>2</maxBframes><bFrameSensitivity>0</bFrameSensitivity><closedGop>false</closedGop><packed>false</packed><quantImin>1</quantImin><quantPmin>1</quantPmin><quantBmin>1</quantBmin><quantImax>31</quantImax><quantPmax>31</quantPmax><quantBmax>31</quantBmax><quantBratio>150</quantBratio><quantBoffset>100</quantBoffset><quantType>h.263</quantType><intraMatrix><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value><value>8</value></intraMatrix><interMatrix><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value><value>1</value></interMatrix><trellis>true</trellis><singlePass><reactionDelayFactor>16</reactionDelayFactor><averagingQuantiserPeriod>100</averagingQuantiserPeriod><smoother>100</smoother></singlePass><twoPass><keyFrameBoost>10</keyFrameBoost><maxKeyFrameReduceBitrate>20</maxKeyFrameReduceBitrate><keyFrameBitrateThreshold >1</keyFrameBitrateThreshold><overflowControlStrength> 5</overflowControlStrength><maxOverflowImprovement>5</maxOverflowImprovement><maxOverflowDegradation>5</maxOverflowDegradation><aboveAverageCurveCompressi on>0</aboveAverageCurveCompression><belowAverageCurveCom pression>0</belowAverageCurveCompression><vbvBufferSize>0</vbvBufferSize><maxVbvBitrate>0</maxVbvBitrate><vbvPeakBitrate>0</vbvPeakBitrate></twoPass></XvidOptions></XvidConfig>");

    //** Audio **
    app.audio.reset();
    app.audio.codec("Lame",112,20,"70 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 ");
    app.audio.normalizeMode=0;
    app.audio.normalizeValue=0;
    app.audio.delay=0;
    app.audio.mixer="NONE";
    app.audio.scanVbr();
    app.setContainer("AVI");
    setSuccess(app.save("E:/0DESKTOP/Delete this avi line from script.avi"));
    //app.Exit();

    //End of script


    According to the tutorial page, we should be able to strip the specifics like input and output videos so that the saved custom script works on any video we open.

    I've tried the instructions but always get errors. The script shows up fine in custom pulldown menu but never has worked no matter how much I try to slim it down like the tutorial says. I keep getting this error tonight:

    ---------------------------
    Info
    ---------------------------
    Spidermonkey ECMAScript Error

    C:\Documents and Settings\...\Application Data\avidemux\custom\/AVI- XviD,
    MP3.js: line 4:
    Msg: TypeError: app.video has no properties
    Not an ECMAScript file. Try open it with 'File' -> 'Open...'
    ---------------------------
    OK
    ---------------------------


    How can the above be stripped of extra WHILE LEAVING IN AUDIO MP3 DETAILS, yet still work?

    Thanks.
    Quote Quote  
  2. I have come back to this issue again and again and keep checking back here to see if anyone has offered advice. No go on the latter, obviously.

    Anyone who uses Avidemux for any length of time I'm sure comes to the same spot as I did, you want to save presets. And the trouble with saving settings as a project rather than as a preset will run into same restrictions, move the video file that the project refers to makes the script stop working. Avidemux doesn't like that the file gets edited. I have some success when I ensure my text editor saves in DOS mode rather than Unicode (it doesn't seem to like Unicode), but most of the time I get the "not an EMACS script" error whenever I touch any script manually.

    I've found other identical sets of instructions as the above page for "converting" projects to a script that will work without a video reference so that one doesn't have to keep doing things the hard way ... but the end result never works!

    - http://en.flossmanuals.net/avidemux/ch021_create-presets/
    - http://blog.torgodevil.com/archives/539 (under heading: "Save Custom video settings" under "Tips:"
    - http://forum.doom9.org/showthread.php?t=126164 (under "How can I save/load my x264 or Xvid settings in Avidemux?")

    Unbelievable to me that following every single tutorial above doesn't produce a working result and that all attempted scripts fail.

    When you just transfer the project file to the custom avidemux folder in the Application Data folder and add the .js extension, the file will open in Avidemux just fine. Make _any_ edit, no matter how insignificant, and the script always becomes unusable.

    Why is this and how can one get the resulting preset to work?

    I am using Avidemux v2.5.3 (have tried all latest versions as they've come out, none come close to doing what v2.5.3 does so haven't been able to upgrade).

    Please advise on how to get the scripts to work. What is missing in all the above tutorials?
    Quote Quote  
  3. Anyone?

    Doesn't anyone know how to get this to work? All instructions found on the net make for a script that doesn't work and gives error prompts.

    Thanks.
    Quote Quote  
  4. Member
    Join Date
    Feb 2004
    Location
    Virginia
    Search Comp PM
    You can not include the following lines in your custom preset script:
    //** Video **
    // 01 videos source
    app.load("D:/1. Menu.avi");
    //01 segments
    app.clearSegments();
    app.addSegment(0,0,929);
    app.markerA=0;
    app.markerB=928;

    I'm not sure if you can include the follow lines since I have never included them in any of my custom preset scripts:
    //** Postproc **
    app.video.setPostProc(3,3,0);

    app.video.fps1000 = 29970;
    Quote Quote  
  5. Thanks for your reply.

    Nothing, and I mean nothing, has worked. I've tried all the example preset instructions I've ever found and AviDemux just doesn't like any of them. But I believe I have a clue now on what is going on. All posts talk about editing the scripts with Notepad. And I've edited with Notepad and Metapad, but neither gets working results. The instant I've ever made even the smallest edit, the script becomes unusable by AD. And the instant I've even touched a project file, it breaks that script, too! One time recently, when an external hard drive failed to load up properly and Windows assigned to it a new drive letter, all I did was go into the project script and change the drive letter and AD could no longer work with the script. That suggests that Avidemux is extremely sensitive to format somehow.

    When I opened a working existing .JS Avidemux script file and overwrite the contents with this:

    var app = new Avidemux();
    //** Video Codec conf **
    app.video.codec("X264","AQ=22","188 00 00 00 00 00 00 ..... 00 00 ");
    //** Audio **
    app.audio.codec("lame",128,12,"00 00 00 00 02 00 00 00 00 00 00 00 ");
    //End of script

    (this example script comes from here: http://forum.doom9.org/showthread.php?t=126164))

    When I try to use that script, I get this error:

    ---------------------------
    Info
    ---------------------------
    Spidermonkey ECMAScript Error C:\Documents and Settings\...\Application Data\avidemux\jobs\Test.js: line 3:
    Msg: TypeError: app.video has no properties
    Not an ECMAScript file. Try open it with 'File' -> 'Open...'
    ---------------------------
    OK
    ---------------------------

    Now, putting aside comment about app.video not having properties, the part "Not an EXMAScript file" pops up as the most common error after trying to use any script I've edited.

    The only custom scripts that have ever worked are project files copied directly to the custom folder with absolutely NO EDITS MADE to it! The instant I do, the preset no longer works. That seriously defeats the purpose; one has no flexibility with Avidemux's scripts!

    I saved to different formats available in Metapad and Notepad (i.e., Unix, Unicode, DOS, etc.) none of these tried formats produced a workable script that AD would accept.

    Can anyone suggest how to edit presets so that they finally work with AD? Thx.
    Quote Quote  
  6. You have to open a video first, then apply the custom script. Avidemux is complaining that there is no video currently open.
    Quote Quote  
  7. Member
    Join Date
    Feb 2004
    Location
    Virginia
    Search Comp PM
    app.video.codec("X264","AQ=22","188 00 00 00 00 00 00 ..... 00 00 ");
    This line in the code can't be right; parameters ( ..... ) are missing.
    Quote Quote  
  8. Originally Posted by mooseydoom View Post
    You have to open a video first, then apply the custom script. Avidemux is complaining that there is no video currently open.
    Not the case. The issue is the script. Video file was open, script EMACS error popped up. 2 separate issues. Problem is not with a missing video.
    Quote Quote  
  9. Originally Posted by pjcrown View Post
    app.video.codec("X264","AQ=22","188 00 00 00 00 00 00 ..... 00 00 ");
    This line in the code can't be right; parameters ( ..... ) are missing.
    Okay, as I said, that part was irrelevant to the issue at hand ("Now, putting aside comment about app.video not having properties, ..."), the error message still points to an EMACS script problem.

    As I mentioned before - actual project script files work fine if transferred from jobs folder to custom folder _without_any_editing_ They have the reference to a video, which is not good, but they work. However, the very _instant_ I edit the file (no matter which text format I choose to use), that corrupts the script somehow and Avidemux rejects them.

    Which is how I figured out that the problem wasn't with the parameters used whatsoever, it seems, but that Avidemux seems to have a very narrow window of format acceptance.

    I need to know what application to use - certainly NOT any text editor I have - that Avidemux will recognize?????!! All the examples online talk about using Notepad to edit but none of the resulting scripts ever work. And this error is pretty consistent:

    "Not an EMACScript file. Try open it with 'File' -> 'Open...'"

    Anyone know of an editor that produces scripts Avidemux will accept?
    Quote Quote  
  10. Member
    Join Date
    Feb 2004
    Location
    Virginia
    Search Comp PM
    I just use WordPad to edit project files to create my preset files and have never had a problem. I have 10 different preset files in my custom folder right now. I'm also using Avidemux version 2.5.2.
    Quote Quote  
  11. Member
    Join Date
    Jan 2003
    Location
    India
    Search Comp PM
    With avidemux 2.5.3, saving the project file and then using notepad to delete line loading your video
    "// 01 videos source
    app.load("D:/1. Menu.avi");"
    and saving the file works.
    You need to load your video followed by load project file.
    Project file i created is :

    //AD <- Needed to identify//
    //--automatically built--
    //--Project: E:\Downloads\trial.js

    var app = new Avidemux();

    //** Video **
    //01 segments
    app.clearSegments();
    app.addSegment(0,0,3205);
    app.markerA=0;
    app.markerB=3204;
    app.rebuildIndex();

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

    app.video.fps1000 = 29970;

    //** Filters **
    app.video.addFilter("denoise","lumaLock=4","lumaTh reshold=10","chromaLock=8","chromaThreshold=16","s ceneChange=30");

    //** Video Codec conf **
    app.video.codecPlugin("32BCB447-21C9-4210-AE9A-4FCE6C8588AE", "x264", "AQ=26", "<?xml version='1.0'?><x264Config><presetConfiguration><n ame>&lt;default&gt;</name><type>default</type></presetConfiguration><x264Options><threads>0</threads><deterministic>true</deterministic><threadedLookahead>-1</threadedLookahead><idcLevel>-1</idcLevel><vui><sarAsInput>false</sarAsInput><sarHeight>1</sarHeight><sarWidth>1</sarWidth><overscan>undefined</overscan><videoFormat>undefined</videoFormat><fullRangeSamples>false</fullRangeSamples><colorPrimaries>undefined</colorPrimaries><transfer>undefined</transfer><colorMatrix>undefined</colorMatrix><chromaSampleLocation>0</chromaSampleLocation></vui><referenceFrames>3</referenceFrames><gopMaximumSize>250</gopMaximumSize><gopMinimumSize>0</gopMinimumSize><scenecutThreshold>40</scenecutThreshold><bFrames>3</bFrames><adaptiveBframeDecision>1</adaptiveBframeDecision><bFrameBias>0</bFrameBias><bFrameReferences>normal</bFrameReferences><loopFilter>true</loopFilter><loopFilterAlphaC0>0</loopFilterAlphaC0><loopFilterBeta>0</loopFilterBeta><cabac>true</cabac><interlaced>false</interlaced><constrainedIntraPrediction>false</constrainedIntraPrediction><cqmPreset>flat</cqmPreset><intra4x4Luma><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value></intra4x4Luma><intraChroma><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value></intraChroma><inter4x4Luma><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value></inter4x4Luma><interChroma><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value></interChroma><intra8x8Luma><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value></intra8x8Luma><inter8x8Luma><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value><value>16</value></inter8x8Luma><analyse><partitionI4x4>true</partitionI4x4><partitionI8x8>true</partitionI8x8><partitionP8x8>true</partitionP8x8><partitionP4x4>false</partitionP4x4><partitionB8x8>true</partitionB8x8><dct8x8>true</dct8x8><weightedPredictionPframes>smart</weightedPredictionPframes><weightedPrediction>true </weightedPrediction><directPredictionMode>spatial</directPredictionMode><chromaLumaQuantiserDifferenc e>0</chromaLumaQuantiserDifference><motionEstimationMet hod>hexagonal</motionEstimationMethod><motionVectorSearchRange>16 </motionVectorSearchRange><motionVectorLength>-1</motionVectorLength><motionVectorThreadBuffer>-1</motionVectorThreadBuffer><subpixelRefinement>7</subpixelRefinement><chromaMotionEstimation>true</chromaMotionEstimation><mixedReferences>true</mixedReferences><trellis>finalMacroblock</trellis><fastPSkip>true</fastPSkip><dctDecimate>true</dctDecimate><psychoRdo>1</psychoRdo><noiseReduction>0</noiseReduction><interLumaDeadzone>21</interLumaDeadzone><intraLumaDeadzone>11</intraLumaDeadzone></analyse><rateControl><quantiserMinimum>10</quantiserMinimum><quantiserMaximum>51</quantiserMaximum><quantiserStep>4</quantiserStep><averageBitrateTolerance>1</averageBitrateTolerance><vbvMaximumBitrate>0</vbvMaximumBitrate><vbvBufferSize>0</vbvBufferSize><vbvInitialOccupancy>0.9</vbvInitialOccupancy><ipFrameQuantiser>1.4</ipFrameQuantiser><pbFrameQuantiser>1.3</pbFrameQuantiser><adaptiveQuantiserMode>variance</adaptiveQuantiserMode><adaptiveQuantiserStrength>1 </adaptiveQuantiserStrength><mbTree>true</mbTree><frametypeLookahead>40</frametypeLookahead><quantiserCurveCompression>0.6</quantiserCurveCompression><reduceFluxBeforeCurveCo mpression>20</reduceFluxBeforeCurveCompression><reduceFluxAfterC urveCompression>0.5</reduceFluxAfterCurveCompression></rateControl><accessUnitDelimiters>false</accessUnitDelimiters><spsIdentifier>0</spsIdentifier><sliceMaxSize>0</sliceMaxSize><sliceMaxMacroblocks>0</sliceMaxMacroblocks><sliceCount>0</sliceCount></x264Options></x264Config>");

    //** Audio **
    app.audio.reset();
    app.audio.codec("Faac",128,4,"80 00 00 00 ");
    app.audio.normalizeMode=0;
    app.audio.normalizeValue=0;
    app.audio.delay=0;
    app.audio.mixer="NONE";
    app.setContainer("MATROSKA");
    setSuccess(1);
    //app.Exit();

    //End of script
    Quote Quote  
  12. Member
    Join Date
    Jan 2003
    Location
    India
    Search Comp PM
    started custom preset with
    var app = new Avidemux();
    then everything from

    //** Video Codec conf **

    and saved it in the scripts/auto folder as all files- "trial.js" (wnen it is not meant to be a text file, i always use the quotes around file name while saving)
    load video file-Auto menu shows trial as an option and works perfectly.
    Quote Quote  
  13. Well, have continued working with the custom scripts and I seem to have the problems ironed out. One somewhat unrelated problem was very obvious in hindsight but was so unexpected it took some time to find it. I'll start with that before going on to the custom scripts issue:

    When I saved projects, an example source video path is this:

    O:/0DESKTOP/Movies2reencode/Test/Test.flv (FORWARD slashes)

    AviDemux project files actually refer to that path "incorrectly" with forward slashes. The actual and real path is:

    O:\0DESKTOP\Movies2reencode\Test\Test.flv (BACK slashes)

    Since I have a shell extension that with a couple of clicks saves full file paths via a context menu option, when initially working with project files and renaming video source files, I'd edit the file paths and then scripts would fail. Once I knew this, I could still use my context menu item but would just go and search-and-replace slashes till correct.

    Again, dumb but you don't always expect such simple errors so it takes time to see them.

    *************************************

    On to custom script issues.

    It also took some doing to remember to change my text editor's format to DOS text mode. That seemed to be a big one. By default, my text editor, Metapad, uses one of the other 5 formats available (factory default I think is Unicode).

    Secondly, although AviDemux doesn't usually save these files with an extension, I learned that AD still works best if these files are identified with a .js extension. Since I did all these things, I haven't had any trouble. DOS mode and .js extension and then, like magic, no more problems!

    Go figure.

    I've now been creating and working with custom scripts for a few weeks now with absolutely no problems (knock on wood!).

    Thanks for everyone's help. The problems were obscure and not readily identifiable. Since I figured things out, though, no more problems after a few weeks.

    Cheers,

    Quote Quote  



Similar Threads

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