convert video files from MOD format to AVI/MPG/other formats

If you own a JVC Everio (or other model) harddisk video camcorder, chances are it writes video files in MOD format instead of AVI or MPG format. After doing some research, I learned that the MOD files are actually MPEG2-PS format, so simply renaming the files to MPG is fine for most purposes.

However, some people (like me) would rather have the video files in AVI format, for playing on video players, video editing, posting on YouTube, or e-mailing to friends and family. JVC provides a utility on the CD that comes with the camcorder that works quite well, however it only runs in Windows and I have no desire to try it in WINE. Instead, I decided to create a bash script that uses the widely popular 'ffmpeg' program to convert the MOD files from MPEG2-PS format into XviD AVI format. It will also batch rename MOD files into MPG files.

This is my first bash script, so I would appreciate any bug reports, feedback or feature suggestions that you may have. Just e-mail me at dylan(dot)cooke@gmail(dot)com.

Download and Install Instructions:

mod2avi v0.5b - v0.5 (beta) - May 24th/2008

Installing (note: you must have ffmpeg installed to use mod2avi)
1. Log in as root at the command prompt.
2. Use wget to download and install the script: # wget -O /usr/local/bin/mod2avi
3. Ensure the script has the proper ownership: # chown root.root /usr/local/bin/mod2avi
4. Ensure the script has the proper permissions: # chmod 755 /usr/local/bin/mod2avi
5. Return to normal command prompt and type 'mod2avi' to verify installation.

Usage Information:

Usage: mod2avi [-options] files..
Converts video files from MOD format to AVI/MPG/other formats.
-h (show help/about screen)
-r [frame rate] (default 29.97)
-s [frame size] (default 720x480)
-v [video bitrate] (default 4500k)
-a [audio bitrate] (default 192k)
-f [audio frequency] (default 48000)
-n (no audio in resulting file)
-m (mono mode, default is stereo)
-d (delete original MOD files)
-q (quiet mode, suppress output)
-o (only rename files to MPG, do not re-encode)
-p [profile name] (highqual, youtube, email)
files.mod (wildcards supported)

highqual - 29.97fps, 720x480, 4500kbit video, 192kbit audio, 48khz, stereo
youtube - 25fps, 320x240, 2500kbit video, 128kbit audio, 44khz, stereo
email - 12fps, 256x224, 200kbit video, 64kbit audio, 22khz, mono


Convert using defaults (makes high quality files):
$ mod2avi *.mod

Convert for posting on YouTube (medium quality files):
$ mod2avi -p youtube mov014.mod mov015.mod

Convert with custom encoding options:
$ mod2avi -r 24 -s 640x480 -v 6500k -a 256k -f 44100 *.mod

Rename to MPG only (do not convert):
$ mod2avi -o *.mod

JVC and Everio are trademarks of JVC Americas Corp.