View Full Version : MPEG4 Modifier Command Line Version (Updated 2007-Jan-13)
Moitah
27th October 2006, 08:04
Requires .NET Framework 2.0 or a recent version of Mono (http://www.mono-project.com/) (with the latter it should run fine in Linux, OS X, etc).
Arguments: [switches] source_path [dest_path]
dest_path is only optional with --info or --frame-list
Switches:
--unpack Remove packed bitstream.
--pack Add packed bitstream.
--par <val> Set the pixel aspect ratio, <val> is:
square - Square Pixel Shape
43pal - 4:3 PAL Pixel Shape
43ntsc - 4:3 NTSC Pixel Shape
169pal - 16:9 PAL Pixel Shape
169ntsc - 16:9 NTSC Pixel Shape
custom <width:height> - Custom Pixel Shape
--field-order <val> Change the interlaced field order, <val> is:
tff - Top Field First
bff - Bottom Field First
--info Display detailed information about the video.
--frame-list <path> Write a text file containing each frame's type,
timestamp, and size to the location specified.
--always-write Write a new file even if the video format isn't being
changed (useful for converting OpenDML AVIs < 2GB to
standard AVIs).
It has return values to aid scripting:
0 = Everything was successful.
1 = Some type of error (invalid arguments, couldn't open file, file was corrupt, etc).
2 = Aborted because output file was already in the desired format (e.g. --unpack was used on a file that didn't have packed bitstream).
Example usage: mono mmcl.exe --unpack /home/jdp/Desktop/test.avi /home/jdp/Desktop/test-new.avi
.bat file for batch unpacking in Windows. Paste this into Notepad, correct the path to mmcl.exe, and save it as a .bat file in the same folder as your AVI files. Open the folder in Explorer and double-click the .bat file. The unpacked AVIs will be written in a new folder (only the ones that needed to be unpacked).
@ECHO OFF
md unpack
FOR %%I IN (*.avi) DO "C:\Program Files\MPEG4 Modifier\mmcl.exe" --unpack "%%~fI" "%%~dpIunpack\%%~nxI"
Download: MPEG4 Modifier CL (http://www.moitah.net/download/latest/MPEG4ModifierCL.zip) v1.4.4 (Binary and Source)
Update: It's now possible to run MPEG4 Modifier GUI version in Mono since Mono 1.2.3 was released.
mod
27th October 2006, 09:14
Thanks a lot. I'm going to try it this weekend :)
int10h
2nd November 2006, 15:26
Works fine, thank you !
Debian users should install the libmono-system2.0-cil manually to get it work.
p4t0z3u
4th November 2006, 18:32
Works fine for me on Mac OS X.4.8, as usual !
Using Mono 1.1.18_0 for PPC
Moitah
6th November 2006, 07:51
Released version 1.4.3. Fixes a bug that can cause synch problems with some (rare) files, adds the ability to pack files containing drop frames, and removes the --user-data switch (it's shown in the --info text now).
Moitah
11th November 2006, 05:50
I figured out that there's only one thing keeping MPEG4 Modifier 1.4.3 from running on Mono, it's the "Shown" event added in WinForms 2.0. I worked around this and made a compile that runs mostly fine in Mono. Screenshot of MPEG4 Modifier 1.4.3 running on Mono 1.2 in Ubuntu:
http://www.moitah.net/misc/MPEG4Modifier-Ubuntu.png
Opening a file via the file dialog didn't work so well, it seems the file type filtering is broken and it doesn't show any files at all, but you can navigate to the folder and type in the filename manually. Or don't use the file dialog at all, just drag your file onto the "AVI Source" textbox.
It's here (http://www.moitah.net/download/byversion/MPEG4Modifier-1_4_3-MonoFix.zip) if anyone wants to try it.
EDIT: Compiled a new version, increased the size of some controls to fix the text being cut off.
EDIT2: I think the file dialog issue is fixed in Mono SVN as of 2006-11-17, the file dialog filtering should be fine in the next Mono release.
plugh
14th November 2006, 01:53
Just tried the CL tool out.
Is there is a way to get the "frame list"?
If not, feature request: "--list filename" option
Also, would it be possible to include frame size in the output? (I'm trying to track down an encoding problem, and frame size would be very helpful)
Thanks!
Moitah
14th November 2006, 03:16
@plugh: Done. The byte size written in the list refers to the size of the VOP plus any headers that go with it (there should only be headers before I-VOPs, such as the VOL and user data). For videos with packed bitstream, if you want to know the size of a packed frame, just add up the size of both VOPs contained in that frame.
plugh
14th November 2006, 06:37
Wow you're fast! I was about to edit my earlier post and ask for quant as well, if available (would be additional support for my xvid bug inquiry), but size should be enough...
thanks!
Moitah
14th November 2006, 07:03
Per-frame quant info would be useful, I might look into it.
Moitah
14th November 2006, 07:09
Reuploaded to fix something I forgot to change in the usage text.
plugh
14th November 2006, 19:45
Thanks again - it did/showed exactly what I needed.
likeatim
21st November 2006, 13:03
Hi, I tried to add this to the right click menu in Windows XP, but I'm not a real talent in this...
I tried this, but to no avail:
Anyone point me in the right direction?
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Mpeg4Unpack]
@="Mpeg4 Unpack"
[HKEY_CLASSES_ROOT\Directory\shell\Mpeg4Unpack\command]
@="e:\\_standalone\\video\\mpeg4modifier\\mmcl.exe --unpack \"%1"\"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Mpeg4Unpack]
@="Mpeg4 Unpack"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Mpeg4Unpack\command]
@="e:\\_standalone\\video\\mpeg4modifier\\mmcl.exe --unpack \"%1"\"
[HKEY_CLASSES_ROOT\Drive\shell\Mpeg4Unpack]
@="Mpeg4 Unpack"
[HKEY_CLASSES_ROOT\Drive\shell\Mpeg4Unpack\command]
@="e:\\_standalone\\video\\mpeg4modifier\\mmcl.exe --unpack \"%1"\"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\Mpeg4Unpack]
@="Mpeg4 Unpack"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\Mpeg4Unpack\command]
@="e:\\_standalone\\video\\mpeg4modifier\\mmcl.exe --
unpack \"%1"\"
I have to more suggestions:
Add an option to search through subfolders - is that possible? Add an option to delete the original file once it has been repaired...
Guepard58
24th November 2006, 10:28
hi,
Sorry for my english. I have a little prb with mp4Modifier and mono. Why when i select .avi file mp4m down? , drag'n'drop also. (Linux Mandriva 2007) , it is a librairie??? please help me if possible. thanks you
Guepard58
24th November 2006, 12:24
Oups, sorry, bad librairy of gnome. It's ok . Very good job .ty
A++++
:thanks:
Moitah
14th January 2007, 00:52
1.4.4 released, fixes problem where DivX subtitles were broken after being run through MPEG4 Modifier.
likeatim
14th January 2007, 13:06
is it also possible to change the video header with this command line tool like with the GUI-Version?
likeatim
18th January 2007, 08:09
is it also possible to change the video header with this command line tool like with the GUI-Version?
I meant userdata, sorry.
Moitah
18th January 2007, 08:14
@likeatim: When unpacking or packing, the command line version updates the user data automatically. But there isn't any way right now to manually edit the user data.
likeatim
18th January 2007, 21:22
@likeatim: When unpacking or packing, the command line version updates the user data automatically. But there isn't any way right now to manually edit the user data.
maybe you could make that an option?
cause for some weird reason, my standalone player plays everything (even packed bitstream) if the userdata is set to "DivX999b000p"
also, an option to delete or overwrite the original file would be tha bomb... ;)
thanks for the great tool!
shevegen
20th January 2007, 03:04
Moitah, could you list the downloads in your FIRST post, if possible please?
Its a lot easier to keep track of the latest version.
Or link to a little webpage that lists them. Thanks :)
nickrout
5th February 2007, 11:08
I am getting this error in mono:
[nick@bilbo ~/mpeg4modifier]$ mono MPEG4Modifier.exe
Mono System.Windows.Forms Assembly [$auto_build_revision$]
Keyboard: United States keyboard layout (phantom key version)
Could not set X locale modifiers
KDE colorscheme read
** (MPEG4Modifier.exe:36789): WARNING **: Missing member add_Shown in type Form, assembly /usr/local/lib/mono/gac/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
Unhandled Exception: System.MissingMethodException: Method not found: 'System.Windows.Forms.Form.add_Shown'.
in <0x00000> <unknown method>
in <0x00015> JDP.frmMPEG4Modifier:.ctor (System.String[] args)
in (wrapper remoting-invoke-with-check) JDP.frmMPEG4Modifier:.ctor (string[])
in <0x00028> JDP.Program:Main (System.String[] args)
Anyone got an ideas on how to diagnose and fix this?
Moitah
8th February 2007, 18:46
@nickrout: Try Mono 1.2.3 which was just released yesterday. It now supports the Form_Shown event. I was able to run MPEG4 Modifier 1.4.4 in Mono 1.2.3 in Windows without any changes.
bollstedt
24th April 2007, 17:23
Hi,
I need a batch program for windows like the one which is shown in the entry posting. But I don't want to change the packet bitstream stuff in my avis.
Aspect Ratio is my problem! I want to batch the Pixel AR to 4:3 PAL with the aid of a command line batch program. I've tried to replace the "unpack" string into --par<43pal>, but it didn't work.
So, may somebody help me with the command lines and the synthax?
Thanks
ilovejedd
24th April 2007, 19:30
Change --unpack to --par 43pal.
bollstedt
24th April 2007, 20:22
it works!!
thanks a lot
olnima
4th May 2007, 11:59
maybe you could make that an option?
cause for some weird reason, my standalone player plays everything (even packed bitstream) if the userdata is set to "DivX999b000p"
also, an option to delete or overwrite the original file would be tha bomb... ;)
thanks for the great tool!
I'm working on another GUI-batch-mode-version right now.
Is everything still playable if You just add "DivX999b000p"
to the existing (or not) UserData? That shouldn't be too difficult to implement for batch-mode. If this isn't a solution there won't be another one I think, because You can have 0, 1 or multiple Userdata-strings and in batch-modus, You do not know if You should add or edit (in second case which one) the string(s).
Olnima
P.S.: ...or maybe I could give You the ability to enter a string (like "DivX999b000p") which is added (if no UserData exists) or replaces the first UD-entry.
subspawn
25th May 2007, 16:51
See In-place search & replace (ipsr) (http://forum.doom9.org/showthread.php?t=124794) on this forum as well :) Tiny lean & mean C prog for in-place manipulation of UserData in xvid's. Works great in Batch mode :)
Btw: MPEGModifierCL & GUI both rock :) The unpack functionality is great and I've learned many things from it's code
mkgordon
30th May 2007, 17:34
Greetings,
I have a bunch of AVI files on an external Firewire drive. I'd like to run them through the --unpack process, prior to burning the files to a DivX disk so I can eventually watch them on my DivX enabled DVD player.
I tired just now to use the CLI version of 1.4.4 via Mono 1.2.3 to do this.
I used the following code:
----------------
Machine-iMac-G5:/volumes/400Gig/FolderName mike$ for i in 'ls'; do mono /Users/me/Desktop/MPEG4ModifierCLFolder/mmcl.exe --unpack $i converted_$i;done
----------------
This code always works well when I used it on files on my main hard drive. But I keep on getting errors when I try it on files on my external drive.
----------------
Error: Source file doesn't exist
MPEG4 Modifer CL v1.4.4
http://www.moitah.net/
----------------
But when I run it on a single file on my external drive, it works fine:
----------------
Machine-iMac-G5:/volumes/FolderName mike$ mono /users/mike/Desktop/MPEG4ModifierFolder/mmcl.exe --unpack /Volumes/400Gig/FolderName/Filename1.avi /users/mike/Desktop/MPEG4ModifierFolder/mmcl.exe --unpack /Volumes/400Gig/FolderName/Filename1.unpack.avi
Loading: 100.0%
Aborting: Video already has the desired format.
----------------
Any suggestions? If you don't know, can you refer me to someone?
Cheers,
Mike
shevegen
2nd June 2007, 00:54
This weekend I finally have the time to test this all
more thoroughly so hopefully I can provide some feedback soon :)
intellimoo
13th November 2007, 00:10
Moitah:
Do you have a version of MPEG4 Modifier CL in callable library form, like a .dll or .ocx? I would love to be able to use this from a program "natively" rather than shelling the .exe, e.g. (especially just for the unpacking ability).
Moitah
13th November 2007, 00:20
@intellimoo: No, but if your code is .NET also it would be easy to compile it into a class library and use the classes yourself. Or just compile the .cs files right into your project if it's C#.
intellimoo
30th November 2007, 09:49
@intellimoo: No, but if your code is .NET also it would be easy to compile it into a class library and use the classes yourself. Or just compile the .cs files right into your project if it's C#.Ah, darn, vb.net for me. Hopefully I can figure something out....
If anyone is willing to make just the --unpack function (with an --always-write option) into a class I can use in vb.net, that would rock. ;)
plugh
31st March 2008, 21:27
Per-frame quant info would be useful, I might look into it.
Just ran into a situation where being able to --frame-list the frame quants would be extremely helpful. Are you taking requests?
J-Wo
4th February 2009, 01:41
This batch file is great! But instead of unpacking them to another folder, can I write the new files in the same folder as the originals only with the word "unpack" at the end of the file name?
halsboss
6th February 2009, 10:28
hello. is there a non .NET version ?
kypec
6th February 2009, 13:55
This batch file is great! But instead of unpacking them to another folder, can I write the new files in the same folder as the originals only with the word "unpack" at the end of the file name?
Try this:@ECHO OFF
FOR %%I IN (*.avi) DO "C:\Program Files\MPEG4 Modifier\mmcl.exe" --unpack "%%~fI" "%%~nIunpack%%~xI"
halsboss
23rd February 2009, 14:29
One of the best programs ever. Kills the "non packed bitstream .AVI returning frames out of order under certain circumstances" issue dead... http://forum.doom9.org/showthread.php?p=1244222#post1244222
Pity about the .Net requirement, but there you go.
halsboss
21st March 2009, 00:26
Thinking of trying to convert this to non .Net ... any hints or suggestions, or even better has anyone else had a go ?
Nexin
21st April 2009, 11:27
Please do,do,do dah da,da,da :D Convert it not to use .NET then let us have it spread everywhere for us to use. Maybe then Moitah will appreciate the need for non .NET tools. :)
halsboss
21st April 2009, 15:48
Moitah has done an absolutely brilliant job with mpeg4modifier and has knowledge/skills >>> than I. I'm betting it'll never be able to reach motiah's heights.
I am currently looking at vb6 commandline version 0.1a which only does a form of pack/unpack on well-formed mpeg4-asp+mp3 AVIs. If I had C skills and a C compiler it might be easier... but I don't. The raw non-microsoft-api avi (riff file) parsing/demuxing seems to be working in debug mode for <1Gb files so far, I must take a look at mpeg4modifier to see how motiah did it. So far I have zero google hits for VB mpeg4-asp parsing code to help me on my way :)
halsboss
28th April 2009, 04:34
Hmm, how to do the "strikethrough" font. Not knowing java, I'd mistakenly thought it was going to be relatively like firefox addons where you can edit the source, bung it into .JAR appropriately, and off you go. Nope, lack of knowledge got my hopes up. Well ! Came across a java version by barakori which was based on mpeg4modifierCL 1.3.4 (unpack only). So I' have a look at a switch to trying to update this to unpack/pack only from mpeg4modifierCL 1.4.4 although it seems a somewhat daunting task after considering the changelog (and not knowing either java nor C# :))...
http://www.xmixdrix.com/tools/unpackmp4.html
http://forum.doom9.org/showthread.php?t=105923
Nexin
10th May 2009, 14:35
Intresting..
If you choose to download and view the source, please remember this is a rough port from C#, hence many of the names start with an upper-case letter, which is against the Java standard
So there is code in C# i wonder if motiah is coding this in C# before converting it to .NET. If so it would be no problem for motiah to release a C# version win32 of this tool, how about it motiah. :)
halsboss
10th May 2009, 15:00
Isn't C# a .NET product with .NET features ? I'd thought the changelog said something like that.
Anyway, most of the way there now with a VB6 prog with unpack/pack only. Only mpeg4 style bitstream handling to go (have to fight with the VB6's lack of unsigned datatypes and no native bitshifting instructions and some other deficiencies in language design) and then the "startcode packet" rearranging (I have their file positions located in tables) and then AVI file writing with a new odml2 index (I ignore the AVI index and rebuild from scratch). A good thing Motiah's code is there to clarify what's what; the java code is good too, just have to remember it's big-endian byte positioning. I wish I knew C and had a free compiler, it might have been a lot easier. All done with dynamic arrays, it takes quite a lot of memory (a few hundred meg; but that's why we buy memory - to use it) and is NOT built for speed :) I read somewhere that VB6 runtime comes with XP and later, which suits my only objective. Now, I don't think I can post an exe because of licensing ...
Nexin
10th May 2009, 16:49
Yes you can post a pm for where you have placed it ;)
I didn't know C# was .net i thought it was C or C+ or C++ or a variant of C. You know how ProjectX (i know you do) had the java bits it needed self contained. Maybe you could do similar, then the tools appeals to everyone, instant run abilty. Maybe even someone make a gui frontend for it.
Big endian does that mean its not optimised for intel cpu's ?
I don't know the consequence that it may imply, btw i only use intel cpu's.
Moitah
27th May 2009, 17:55
I'll be impressed if you get it working in VB6 :). Actually it was the language I started with (well, VB5) and used for 4 years before I switched to C#.
But why all this effort to avoid .NET? What about Mono? Last time I checked, MPEG4 Modifier runs fine with Mono in Windows except for loading a file by drag-and-drop.
halsboss
28th May 2009, 11:29
My sympathies, battling with VB's lack of some fundamentals; it was conceived in the olden days. The effort is free (only my time) and I'd like a clean, fast, less bloated and less vulnerable PC, which means just now ignoring .net and its brethren. Some time I might have to bite the bullet, but not just yet. The risk/bloat/value equation is not yet positive for me, yours is the only essential program requiring .NET which I've come across for my small niche needs. I admit to stalling it for the moment, doing other things, prior to implementing what I know will be slow bitstream handling.
Gew
12th November 2010, 20:54
Just so everyone knows. The CLI version runs flawless over WINE (Linux).
The GUI version seems to be a problem, at least with Ubuntu 10.10.
Thanks for a great application Moitah!
Ty in adv~
jarr_d
31st December 2010, 22:49
hey trying to batch mode --par 43ntsc all the files in a folder to switch their display pixels to 4:3
Could use a bit of help with the command line.
much thanks,
FOR %%I IN (*.avi) DO mmcl.exe --par 43ntsc %%I
isnt working....
b66pak
31st December 2010, 23:02
try:
FOR %%I IN (*.avi) DO mmcl.exe --par 43ntsc %%I %%~nI.43ntsc.avi
_
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.