Has anyone tried muxing with Avidemux instead of converting yet?

Discussion in 'iPad' started by jroeben, May 9, 2010.

  1. jroeben macrumors newbie

    May 9, 2010
    I don't have an iPad yet (will get one on the 28th here in Germany) but I was wondering if anyone has tried muxing Xvid files to MP4 with Avidemux yet?
    I know for a fact that these files work on an iPhone and knowing they will also work on an iPad would probably influence my preorder decision re. the version (32 or 64).

    Muxing a file is incredibly fast compared to converting it via e.g. Handbrake (On my system muxing a 700mb video (1.5 hours) takes about 3 minutes or so with no visible loss in quality and audio in 128kb.) and if it works I might just mux my Xvid videos and go for the 64gb version.

    Maybe someone wants to give it a try and post results?

    Get Avidemux (free)

    2. Open source video.
    Say "yes" to "Build VBR time map?" if it pops up.
    Say "yes" to "Index is not up to date - Rebuild frame" if it pops up.
    3. Set Audio to "AAC (Faac)".
    4. Set Format to "MP4".
    5. Save file with extension mp4.

    Feedback would be greatly appreciated.


    Attached Files:

    • 1.jpg
      File size:
      161.3 KB
    • 2.jpg
      File size:
      54.4 KB
    • 3.jpg
      File size:
      44.3 KB
  2. Macpowered macrumors member


    Feb 4, 2009
    I tried this software when I got my iPad but sadly, it did not work all the time.
  3. jroeben thread starter macrumors newbie

    May 9, 2010
    Meaning? Could you narrow this down a little ...?
  4. M87 macrumors 65816

    Jul 18, 2009
    It worked for me, but I've only tried one video so far. Thanks for the tip!
  5. Macpowered macrumors member


    Feb 4, 2009
    I tried a couple of movies (avi, mkv, divx, xvid etc), and some worked on the iPad and some did not. Very strange because the software is suppose to remux all files to mp4...
  6. jroeben thread starter macrumors newbie

    May 9, 2010
    Well, it can only work with files that were encoded with a MP4 asp derivative (e.g. xvid) as the codec is not touched by Avidemus, it's just the container that is changed. If you try this on a codec that is not playable on the iPad it won't work.
    Btw: avi is just a container, not a codec.
  7. jroeben thread starter macrumors newbie

    May 9, 2010
    Thanks for trying, glad it worked for you.
    Maybe you'll find some time to try a couple of others and report back on the codecs etc.?
  8. M87 macrumors 65816

    Jul 18, 2009
    Sure. The one I mentioned was DivX.
  9. Brokebroker83 macrumors member

    May 3, 2010
    Is there a way we can check if the avi container holds a codec that would work?
  10. jroeben thread starter macrumors newbie

    May 9, 2010

    Just drag it into this and it will say if it's MP4 ASP.
  11. Brokebroker83 macrumors member

    May 3, 2010
    Thanks a lot buddy, that software really helps. :)

    So I tried it out with a few shows I have and it works really well. Of course I havnt converted any 1080P material...but i dont really see the point of doing that anyway.

    One thing I dont get is when i was originally converting videos to ipad format (using ********* iPad Convertor)...my originally files of around 300mb were becoming around 1Gb.

    Anyway know why that was happening?

    PS: Props to the original thread starter...you made my day man!!:D
  12. Brokebroker83 macrumors member

    May 3, 2010
    Hi I was wondering if you knew hot to batch convert files.

    I tried doing the add to job and then running the job, but I have no idea where the converted files were saved!! :(

    Perhaps I'm an idiot. Do you know of any good way to convert a folder full of files into the iPad format (something which basically does what you explained in the start of the thread...but for more than one file).
  13. jroeben thread starter macrumors newbie

    May 9, 2010
    Unfortunately, I don't really know anything about scripting, so please excuse my probably very clumsy attempt at doing this. If anyone knows how to improve this, please post your suggestions (I would like to lose the original extension of the file and end up with just an .mp4 for example). Anyway, this is how it works for me.

    First, you will need the command line version of Avidemux. You can get it here (MacOS):

    Unpack and put it in your applications folder.
    Now open up the GUI version of Avidemux and got to Tools - Preferences. There you'll find a tab "Automation". Open that tab and tick the boxes for "Automatically build VBR map" and "Automatically rebuild index". This is done to make it work with the command line version.

    Now load one .avi file with the GUI version and set the options like you would normally do (and like it is shown in my first post - Set Audio to "AAC (Faac)". Set Format to "MP4".). Do NOT save the .avi file.
    Now go to File - Save Project As and save the project file with any name.

    Open the project file with a text editor and delete the lines (the full lines!) that start with either of the following:


    The resulting file should look something like this:

    //AD  <- Needed to identify//
    //--automatically built--
    //--Project: /Volumes/Media/TV-Serien aktuell/criminal_minds/test
    var app = new Avidemux();
    //** Video **
    // 01 videos source 
    //** Postproc **
    app.video.codec("Copy", "CQ=4", "0 ");
    //** Audio **
    app.audio.codec("Faac",128,4,"80 00 00 00 ");
    //End of script
    Alternatively, you could just paste the above into a new text file ;).

    Save the project file.

    Open a terminal windows.
    CD to a folder with .avi files you want to convert.

    Type the following (In my case I have saved the project file as "remux.txt" to the folder with the .avi files, so you might have to change this to whatever you called yours. Same with the path to Avidemux CLI.):

    for InputItem in *.avi;do /Applications/avidemux2_cli/avi_cli --load  "$InputItem" --run remux.txt --save "${InputItem}-done.mp4"; done
    Hit enter.
    This is what will happen:
    This little script will write all the .avi filenames into the variable InputItem. It will then run Avidemux command line, load the the first file, run the project file with the preconfigured parameters and save the converted file appending -done.mp4 to the original filename. It will do this for all .avi files in the folder.
    So basically just hit enter and wait a couple of minutes for all the -avi files in the folder to complete. Works just fine for me.

    This is extremely amateurish and clumsy, please post your suggestions to improve this.

    If you have a little more time and want to shrink your files a bit, you can always run a Handbrake batch job in a similar way:

    for InputItem in *.avi;do /Applications/HandBrakeCLI -i "$InputItem" -o "${InputItem}-done" -t 1 -c 1 -f mp4 --strict-anamorphic  -e x264 -q 20 -a 1 -E faac -6 dpl2 -R 48 -B 128 -D 0.0 -m -x ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 -v 1; done
  14. billyzenme macrumors member

    Dec 21, 2009
    tried it with my high bitrate HD mkv rips (like at least 8mb/s bitrate and some with at least 20mb/s) with DTS audio tracks and subtitles and crashed the software. I guess I'll stick with my old manual method...
  15. jroeben thread starter macrumors newbie

    May 9, 2010
    Well, this is def. more for the casual encoder ;).
  16. kaelell macrumors 6502

    Nov 16, 2009
    If this works for me this will be a perfect solution, thanks for posting!

    I'd still encode using handbrake for reliability but for those times when you are in a hurry and need a few files then and there then its perfect.
  17. scouf macrumors newbie

    Jun 9, 2008
    Hey Thanks for putting this info out there.

    I do have one issue. I followed your instructions and the video was created, however it is choppy when running it on my mac. I didn't bother copying it to an iPad. Is there anything I can do?

    Thanks again
  18. absolutic macrumors regular

    Jun 5, 2008
    same time as handbrake

    Well, I did convert a video this way tonight, but it took me 15 minutes on my latest quad-core PC desktop. Which is the same time that it takes me to use handbrake. So I don't see advantage timewise.
  19. pondie84 macrumors 6502a

    Jan 28, 2008
    I have the same issue. 1 file it worked perfectly. All the others have had choppy video.
  20. huskerchad macrumors regular

    Jul 17, 2002
    I've got several movies that are xvid/mp3 and I tried a few of them...no luck. iTunes wouldn't import them and quicktime wouldn't play them.

    As someone else said, my i7 converts video so fast that it's not worth a lot of time spent remuxing. Theoretically I have lost some quality with the re-encode, but I don't see it.
  21. BeachChair macrumors 6502a

    Apr 11, 2008
    Copenhagen, Denmark
    I'm experiencing the same choppiness, tried one video so far.

    Is it nessecary to reencode the audio to AAC, if it's in MP3?

    Edit: Should have mentioned the choppiness was only when playing it on my macbook.

    I copied it to the iPad and it plays smoothly there :)

    Thanks, this is much faster than reencoding
  22. Alexeh macrumors newbie

    Jul 1, 2010
    Hello there,

    Sorry to jump in like this with a first post but I'm in a real hurry to avidemux a heap of AVI's with no knowledge of scripting whatsoever.. I've tried editing the .txt files as noted in the very helpful post, but unfortunately it keeps saying the 'input item is unexpected' :(

    I have all the latest software versions and put them all in one folder, along with all of the avi's; T:\avi

    So I tried stuff like this:

    for InputItem in *.avi;do /avi --load "$InputItem" --run remux2.txt --save "${InputItem}-done.mp4"; done

    for InputItem in *.avi;do /avi/avidemux2_cli.exe --load "$InputItem" --run remux2.txt --save "${InputItem}-done.mp4"; done

    for InputItem in *.avi;do t:\avi --load "$InputItem" --run remux2.txt --save "${InputItem}-done.mp4"; done

    I've wasted a few hours with this (even trying to download GNU Bash to put this into Windows terms [ http://www.avidemux.org/admWiki/doku.php?id=using:command_line_usage on the bottom ]

    Whilst someone might be able to just help me within a minute. Don't have the Ipad yet, have to do a journey of several hours on Saturday.. Quite a lot of stress here..

    Hope someone can redirect me to the right path here.. remembering it's on Windows and the directory is T:\avi

    Any reply would be a great help guys, thanks :)

    Alexander S.
  23. pondie84 macrumors 6502a

    Jan 28, 2008
    I can confirm that although the files play choppily in Quicktime on my iMac they play fine in VLC and on my iPad. It also is very quick.
  24. thedarkhorse macrumors 6502a

    Sep 13, 2007
    I haven't muxed, converted, compressed or reencoded anything for my ipad. I downloaded air video the first day that converts on the fly and have been fine. I watch 720p mkvs on it on my home network with on the fly conversion and it looks great.

Share This Page