img2mpg

Langue: en

Version: 1 January 2003 (mandriva - 01/05/08)

Section: 1 (Commandes utilisateur)

NAME

img2mpg - MPEG portfolio images multiplexer

SYNTAX

img2mpg [ options ] -o <output MPEG file> -i <input image files>

REQUIREMENTS

This script use this packages :

ImageMagick version >= 5.4.8 [ http://www.imagemagick.org/ ]
MjpegTools version >= 1.6.0 [ http://mjpeg.sourceforge.net/ ]

With this packages, 'img2mpg' use this externals binary programs :

- 'montage' from ImageMagick for resize the images for the TV screen size.
- 'composite' from ImageMagick for make the transition between images.
- 'convert' from ImageMagick for convert the images before MPEG encoding.
- 'identify' from ImageMagick for check the background image file size.
- 'ppmtoy4m' from MjpegTools for create a video stream from the image.
- 'yuvscaler' from MjpegTools for adapt the video stream size before MPEG encoding.
- 'mpeg2enc' from MjpegTools for encode the video stream in MPEG file.
- 'mp2enc' from MjpegTools for encode on a MP2 file a WAV sound file if necessary.
- 'mplex' from MjpegTools for multiplex the MPEG file and the MP2 sound and convert the final MPEG file to a DVD/XVCD/SVCD/VCD format compatible with vcdimager program.

DESCRIPTION

The 'img2mpg' bash script convert some images on MPEG sequences with a specific duration and merge all images on an single MPEG file. It use the MjpegTools and ImageMagick packages.

Between the images, you can insert a basic transition. You can also add an audio track on the images sequence with a MP2 or WAV file.

All images will be automatically scaling to the good size for the video format. Also a specific background color or a image file could be used.

You can use this for to build some DVD/XVCD/SVCD/VCD portfolios for your home DVD player. Use 'vcdimager' for create this...

The video types and formats supported by this script are :

VCD :


  Resolution : 352x288 (PAL/SECAM) / 352x240 (NTSC).
  Frames / s : 25 (PAL/SECAM) / 30 (NTSC).
  MPEG type : MPEG-1.
  Video CDR duration (650Mo) : 74 minutes.
  Video bitrate : 1,150 kbit/s.
  Sound format : MP2.
  Audio bitrate : 224 kbit/s.
  DVD player compatibility : medium.
  Image restitution : medium.

SVCD :


  Resolution : 576x480 (PAL/SECAM) / 480x480 (NTSC).
  Frames / s : 25 (PAL/SECAM) / 30 (NTSC).
  MPEG type : MPEG-2.
  Video CDR duration (650Mo): 60 minutes.
  Video bitrate : 2,500 kbit/s.
  Sound format : MP2.
  Audio bitrate : 224 kbit/s.
  DVD player compatibility : good.
  Image restitution : good.

XVCD :


  Resolution : 720x576 (PAL/SECAM) / 720x480 (NTSC).
  Frames / s : 25 (PAL/SECAM) / 30 (NTSC).
  MPEG type : MPEG-2.
  Video CDR duration (650Mo) : 50 minutes.
  Video bitrate : 2,500 kbit/s.
  Sound format : MP2.
  Audio bitrate : 224 kbit/s.
  DVD player compatibility : medium.
  Image restitution : excelent.

DVD :


  Resolution : 720x576 (PAL/SECAM) / 720x480 (NTSC).
  Frames / s : 25 (PAL/SECAM) / 30 (NTSC).
  MPEG type : MPEG-2.
  Video CDR duration (650Mo) : 15 minutes.
  Video bitrate : 8,000 kbit/s.
  Sound format : MP2.
  Audio bitrate : 224 kbit/s.
  DVD player compatibility : excelent.
  Image restitution : excelent.

Note : The XVCD resolution is the same of DVD !

OPTIONS

-v <num> : verbose level on the console. The possible values are '0' for none (default), '1' for informations and warnings, or '2' for debug messages.

--with-gui : running with the 'Kimg2mpg' KDE GUI frontend. Specifics messages will be showing on the console. For more informations about Kimg2mpg, see this URL : http://kvcdtools.free.fr

-t <num> : enable transition between images with a specific speed. The possible speed values are '1' for slow, '2', '4', '5', '10', or '20' for fast. When you enable this option, the script make with ImageMagick package a beautiful merging transition between images. Warning : it's a long calculating process.

The transitions durations are :

Speed '1' : PAL/SECAM (25 f/s) = 4000 ms | NTSC (30 f/s) = 3333 ms.
Speed '2' : PAL/SECAM (25 f/s) = 2000 ms | NTSC (30 f/s) = 1666 ms.
Speed '4' : PAL/SECAM (25 f/s) = 1000 ms | NTSC (30 f/s) = 0833 ms.
Speed '5' : PAL/SECAM (25 f/s) = 0800 ms | NTSC (30 f/s) = 0666 ms.
Speed '10' : PAL/SECAM (25 f/s) = 0400 ms | NTSC (30 f/s) = 0333 ms.
Speed '20' : PAL/SECAM (25 f/s) = 0200 ms | NTSC (30 f/s) = 0166 ms.

-T <Temporary folder> : use a specific folder for create the temporary files ('/tmp' for example). If you don't use this option, all temporary files will be created in the current active folder.

-f <Video format> : MPEG video format. The possible values are 'DVD', 'XVCD' (default), 'SVCD', or 'VCD'. See the DESCRIPTION section for more details.

-n <Video type> : video type for your TV screen. The possible values are 'PAL' (default), 'NTSC', or 'SECAM'.

-b <background file> : specify the 768x576 pixels background image file name. If you don't use this option, a default temporary black image file will be used.

-c <RGB color> : if you don't use the background image file, you can change the default background color (black = default). Use an hexadecimal RGB color value (example : AA001F).

-d <num> : duration for each image in MPEG file. The default value is 10 secondes. The minimal value is 1 secondes.

-a <MPEG audio file> : MP2 audio file to merge with the video sequence.

-w <wav audio file> : WAV audio file will be converted in MP2 file and merging with the video sequence.

-o <output MPEG file> : the ouput MPEG file name. If you don't use this option, a temporary file will be created.

-i <input images files> : images files name to merge in MPEG.

-h | --help : output help information and exit.

Notes :

- The -i option must be the last option in the command line.
- If you use some whitespaces in the path folders/files, use '"' around the complete path string.

RETURN VALUES

0 -> Process finish succefuly.
1 -> Error.

EXAMPLES

# img2mpg -f SVCD -d 15 -w Music.wav -o MyPortfolio.mpg -i 01.jpg 02.jpg 03.jpg 04.jpg

Build PAL (default) SVCD MPEG file with the 'Music.wav' sound file and this image files sequence :

01.jpg 02.jpg 03.jpg 04.jpg

For each image on the portfolio, the screen show duration is 15 seconds. The output file is 'MyPortfolio.mpg'. There isn't transition between images.

# img2mpg -n NTSC -t 2 -o MyPortfolio.mpg -i *.png

Build XVCD (default) NTSC MPEG file with a transition between images (speed 2) with all local PNG image files. The image files sequence use the local filesystem sort.

AUTHORS

This man page was written by Gilles CAULIER.
If you have questions, remarks, problems or you just want to contact the author :
  caulier.gilles@free.fr

The main mailing list for the MJPEG-tools is:
  mjpeg-users@lists.sourceforge.net

For more info, see our website at
  http://mjpeg.sourceforge.net

SEE ALSO

ImageMagick(1), mjpegtools(1), vcdimager(1)

Kimg2mpg GUI WEB site project : http://kvcdtools.free.fr