by Russ TannerrtJPG2Video Command Line Utility

Version 1.10 Documentation

rtJPG2Video Version 1.10 Documentation

Table of Contents

New Features

Overview

Quick Start

Tips & Tricks

Argument Reference

New Features

-video-size - This argument was added to provide the ability to specify the dimensions (height:width) of the created video.

Overview

rtJPG2Video is a Windows command line utility that makes it easy to assemble a large number of JPG images into a video. It is especially useful for processing many directories at a time making batch processing easy.

rtJPG2Video uses the free mencoder.exe utility to create high-quality video, so mencoder must be installed on the system. Here is a link to download it: mencoder.exe (Windows binary)

Basic Process Flow

rtJPG2Video begins by searching the directory specified with the -dir argument. If this directory contains one-or-more JPG images, then processing of this directory begins. If this directory does not contain one-or-more JPG images, then — if the -r or -r-depth arguments are specified — processing begins in the next recursive directory.

If the argument -subtitle-text has been specified, then the specified title is built and saved in an "SRT" file in the current directory for use by mencoder.exe. To lean how subtitles are built, see the documentation for the -subtitle-text argument. The name of "SRT" file can be specified using the -srt-filename argument.

Next, rtJPG2Video calls mencoder to build a video using all JPG files in the current directory. The name of the video file can be specified with the -video-filename argument.

Finally, if the -r or -r-depth arguments are specified, rtJPG2Video iterates to the next directory. Otherwise, processing ends.

Quick Start

Below is a list of common-usage examples.

Display usage information

rtJPG2Video displays basic usage information if called without any arguments.

rtJPG2Video

You can also specify the "usage" argument explicitly.

rtJPG2Video -usage

When the -usage argument is specified, the program will exit immediately after displaying usage information. No file processing will take place and all other arguments will be ignored.

Display version information

rtJPG2Video displays version information using the -version argument.

rtJPG2Video -version

Results

1.00

The program only displays version information, nothing else. This is done so other programs can easily determine the version of rtJPG2Video being used and alter their behavior accordingly.

When the -version argument is specified, the program will exit immediately after displaying version information. No file processing will take place and all other arguments will be ignored.

Display settings information

Sometimes, you may want to see what settings will be used during a job so you can be sure they are correct. Use the -say-settings argument.

rtJPG2Video -say-settings

The program displays a complete list of settings are they are going to be used by the program. This allows you to fine-tune the arguments you use before beginning an actual job.

When the -say-settings argument is specified, the program will exit immediately after displaying the current settings. No file processing will take place and all other arguments will be ignored.

Convert all JPG files in a directory to a video

You want to merge all JPG images in a particular directory into a video file:

rtJPG2Video -dir D:\timelapse

This will create a video in the D:\timelapse directory from all JPG files in that directory. The file will be named "_movie.avi" by default.

If the directory you are specifying contains spaces, be sure to quote it:

rtJPG2Video -dir "D:\timelapse photos"

Convert all JPG files in a directory to a video and add a subtitle

You want to merge all JPG images in a particular directory into a video file and you want to display a subtitle on the video:

rtJPG2Video -dir D:\timelapse -subtitle-text "Chemtrail Activity in West Palm Beach"

This will create a video in the D:\timelapse directory from all JPG files in that directory. The file will be named "_movie.avi" by default. A subtitle will be added to the video.

You can specify the font typeface and size for the subtitle using the -subtitle-font-file and -subtitle-font-size arguments:

rtJPG2Video -dir D:\timelapse -subtitle-text "Chemtrail Activity in West Palm Beach"
-subtitle-font-file "C:\Windows\Fonts\verdana.ttf" -subtitle-font-size 50

Convert all JPG files in all sub directories to videos

You want to merge all JPG images in a group of directories into videos:

rtJPG2Video -dir D:\timelapse -r

In this case, you can use the recursion argument (-r) to recurse all directories below the one specified. This will create a video file in each directory which contains one-or-more JPG files. Directories which contain no JPG files will be ignored.

Specify the output video size

You want the created video to have different dimensions than the original images:

rtJPG2Video -dir D:\timelapse -r -video-size 800:600

If you don't specify a video size argument (-video-size), then the created video defaults to the same dimensions as the source JPG images. Using the -video-size argument, you can force the created video to the dimensions you desire.

The argument consists of the desired height and width separated by a colon: -video-size height:width

Only recurse directories immediately below the one specified

You want to merge all JPG images into a video for all directories that are immediately below the one specified:

rtJPG2Video -dir D:\timelapse -r-depth 1

In this case, you can use the recursion-depth argument (-r-depth) to recurse directories immediately below the one specified. Directories below those directories will not be iterated.

This will create a movie file in each directory which contains one-or-more JPG files. Directories which contain no JPG files will be ignored.

Only recurse directories matching a specified regular expression

You want to merge all JPG images into a video for all subdirectories matching a specified regular expression:

rtJPG2Video -dir D:\timelapse -r -dir-filter "monthly"

In this case, only directories containing the phrase "monthly" will be iterated.

Specify the home directory of mencoder

You want to process a job but the path that mencoder.exe resides in is not included in the Windows PATH variable:

rtJPG2Video -dir D:\timelapse -mencoder-path "C:\utilities\mplayer"

This enables you to use rtJPG2Video under more diverse circumstances.

Tips & Tricks

This section contains various information to help you use this program effectively.

Command Line Arguments with Spaces

If you need to supply a command line argument that contains spaces, you can surround the argument with double-quotes:

rtJPG2Video -mencoder-path "C:\Program Files\MPlayer"

In this example, the quotes are necessary because the -mencoder-path argument contains spaces. If the quotes were not supplied, then Files\MPlayer would be considered a new argument, which would generate an "Invalid argument" error.

Argument Reference

-dir

-dir-filter

-log-path

-mencoder-path

-r

-r-depth

-say-settings

-sleep-time

-srt-filename

-subtitle-font-file

-subtitle-font-size

-subtitle-text

-usage

-version

-video-codec

-video-filename

-video-frames-per-second

-video-size

-dir

This specifies the directory we are going to process. If directory-recursion is specified (-r or -r-depth) then recursion begins with this directory.

If this is omitted, it defaults to the current directory (the one that the program was launched from).

Examples

rtJPG2Video -dir "C:\Timelapse Images\January 2011"

This will process JPG images in the specified directory. The quotes are required because the directory contains a space.

rtJPG2Video -dir "C:\Timelapse Images\January 2011" -r

This will process JPG images in the specified directory. Then, because the recursive argument is specified (-r) all directories below it will be recursed. The quotes are required because the directory contains a space.

rtJPG2Video -r

This will process JPG images in the same directory in which rtJPG2Video was launched. Then, because the recursive argument is specified (-r) all directories below it will be recursed. You can see the actual directory that will be used by specifying the -say-settings argument:

rtJPG2Video -say-settings

-dir-filter

This is a regular expression that filters directories when directory recursion is used (-r or -r-depth).

The directory specified in -dir is always processed for JPG images, but if the -r or -r-depth arguments are specified, then -dir-filter only recurses directories that match its regular expression.

If this is omitted, then no directory filtering takes place.

Regular expressions are processed by the PowerBasic regular expression engine. You can find specifications for it here:
PowerBasic Regular Expressions

Examples

rtJPG2Video -dir "C:\Timelapse" -dir-filter 2011

This will process only directories containing the string "2011".

-log-path

This is an absolute path to the log file.

This log file keeps an easily-readable record of all directories that were processed. It also makes it easy to find directories that were not processed due to some kind of error.

If this is omitted, then no log file is generated.

If the specified log file already exists, new log entries are appended to it.

Examples

rtJPG2Video -log-path "C:\Timelapse\log.txt"

If the path contains a space, then quotes are required.

-mencoder-path

This is an absolute path to the mencoder.exe executable file.

This is only required if the Windows environment variable PATH does not contain the directory containing mencoder.exe.

If this is omitted, then rtJPG2Video attempts to find mencoder based on the Windows PATH environment variable. If rtJPG2Video can't find it, then an error will be displayed.

Details

Normally, when you download and install mencoder.exe on your computer, you will want to modify the PATH environment variable so it contains an entry for the the directory containing mencoder.exe. This will allow Windows (and rtJPG2Video) to find mencoder no matter where it resides.

Setting the PATH variable can be done from the Windows control panel. Here are a few pages showing how to do this:

» Windows 2000/XP
» Vista
» Windows 7

As an alternative to setting the PATH environment variable on Windows, you could simply copy mencoder.exe to a directory that already has an entry in the PATH variable. An example of such directories would be:

» C:\Windows
» C:\WINNT
» C:\Windows\System32

Examples

If you don't want to bother setting the PATH variable, you can just tell rtJPG2Video where to find mencoder.exe by specifying the -mencoder-path argument:

rtJPG2Video -mencoder-path "C:\Program Files\MPlayer\mencoder.exe"

Of course, the argument must actually point to mencoder.exe on your computer. If the path contains a space, then quotes are required.

-r

This causes the program to recurse directories. This is identical to specifying:

-r-depth -1

In fact, if you specify the -r argument and then view the settings, you will notice that -r simply changes the value of -r-depth to -1:

rtJPG2Video -r -say-settings

If this is omitted, then the program does not recurse directories unless -r-depth os specified.

If both -r and -r-depth are specified, the value specified in -r-depth takes presidence. In fact, -r is actually just a shortcut for -r-depth -1.

Examples

rtJPG2Video -r

This causes the program to recurse all directories below the current one. If there are JPG files in the current directory, a video file is built from them as well.

-r-depth

This causes the program to recurse directories to the specified depth.

If 0 (zero) is specified, then no directory recursion takes place. Only JPG files in the current directory (if they exist) are used to build a movie.

If 1 (one) is specified, then only directories in the current directly are recursed. Directories below that are ignored. JPG files in the current directory (if they exist) are also used to build a movie.

if -1 (negative-one) is specified, then directory recursion is infinite.

If this is omitted, then the program does not recurse directories (identical to -r-depth 0).

If both -r and -r-depth are specified, the value specified in -r-depth takes presidence. In fact, -r is actually just a shortcut for -r-depth -1.

Examples

rtJPG2Video -r-depth -1

This causes the program to recurse all directories below the current one. If there are JPG files in the current directory, a video file is built from them as well.

rtJPG2Video -r-depth 0

No directories are recursed . If there are JPG files in the current directory, a video file is built from them only.

rtJPG2Video -r-depth 1

Only directories immediately below the current on are recursed. Directories below that are ignored. If there are JPG files in the current directory, a video file is built from them as well.

-say-settings

This causes the program to display all current settings. When this argument is specified, no processing takes place. The program simply exits after displaying settings.

This is useful for debugging your command line arguments before actually processing files.

Examples

rtJPG2Video -say-settings

This displays all program settings.

-sleep-time

This causes the program to sleep for a specified number of milliseconds after building each movie file.

This is useful if you are running other important processes on a computer and want to give back some time to the operating system for use with other processes.

You may specify any value greater-than or equal-to zero. If you specify a negative value, an error will occur.

Examples

rtJPG2Video -sleep-time 5000

Causes the program to sleep for 5 seconds (5,000 milliseconds) after building each movie.

-srt-filename

This specifies the name of the SRT file that will be created in each processed directory that contains one-or-more JPG images. This file is only generated if -subtitle-text is specified. If -subtitle-text is not specified, this argument is ignored.

If omitted, this defaults to "_title.srt".

Details

An SRT file is a special file format used to specify titles in movies. The file format is fairly simple and is used by mencoder when generating subtitles in movies.

If -subtitle-text is specified, rtJPG2Video creates an SRT file in each directory it processes which contains one-or-more JPG images. This SRT file is then used by mencoder to build and display a subtitle.

You can control the name of the SRT file that is created in each directory by specifying this argument.

You can learn more about SRT files by searching the internet, although knowledge of SRT files is not necessary to build movie subtitles using rtJPG2Video.

Examples

rtJPG2Video -subtitle-text "Bangor, ME, 2011" -srt-filename srt.txt

This causes the program to name the SRT file "srt.txt". Quotes are necessary only if the the argument contains spaces.

-subtitle-font-file

When the program generates a title for the movie, you can select the font that the title is displayed in. In order to do this, you must supply a complete path to the font-file containing the font you want to use.

If this argument is omitted, the program searches for font files on your computer in the following order. If one is found, it is used by default:

» verdana.ttf
» arial.ttf
» times.ttf
» cour.ttf

If one of the previous font files cannot be found on your computer, then this argument defaults to "" (zero-length). In this case, if you want to display a subtitle in the movie, you must supply this argument with a valid path to the font file you want to use.

This argument is only used if -subtitle-text is specified.

Examples

rtJPG2Video -subtitle-text "This is my title" -subtitle-font-file "C:\My Special Fonts\Monotone Corsiva.ttf"

This causes the program to use the font Monotone Corsiva to display the subtitle.

-subtitle-font-size

This specifies the font size in pixels for the subtitle displayed in a movie.

If this argument is omitted, it defaults to 16.

This argument must be an integer.

This argument is only used if -subtitle-text is specified.

Examples

rtJPG2Video -subtitle-text "This is my title" -subtitle-font-size 40

This causes the program to use a font size of 40 pixels.

-subtitle-text

This specifies the subtitle that will be displayed in the movie.

If this argument is omitted, no subtitle is displayed in the movie.

Details

The subtitle can contain tokens that will be expanded for each movie that is created. The following tokens are currently supported:

» {YearModified}
» {MonthModified}
» {DayModified}
» {CRLF}

{YearModified} {MonthModified} {DayModified}

The value for each of these tokens is taken from the first JPG file found in the directory currently being processed. This arrangement is particularly useful in the following condition:

You have arranged timelapse files into directories for each day. So, if you want to display a subtitle on a movie that contains the date in this format: month/day/year, then you would specify -subtitle-text like this:

rtJPG2Video -subtitle-text "Video Date: {MonthModified}/{DayModified}/{YearModified}"

{CRLF}

This simply expands into a carriage-return followed by a linefeed. This enables you to create titles that span more than a single line:

rtJPG2Video -subtitle-text "Chemtrail Accumulation Timelapse{CRLF}Bangor, Maine"

Examples

rtJPG2Video -subtitle-text "Chemtrail Plumes Spreading{CRLF}Phoenix, Arizona, {YearModified}"

This causes the program to display a 2-line title in each movie. The second line end in the year-modified date of the first JPG file found in each directory processed.

-usage

This displays standard usage information. This program will also display usage information when run with no arguments.

When this argument is used, no file processing takes place.

Examples

rtJPG2Video -usage

This displays the program's usage information.

-version

This displays program-version information.

When this argument is used, no file processing takes place.

Examples

rtJPG2Video -version

This displays the program's version in this format: 1.00

-video-codec

This tells mencoder to use the specified video codec when encoding the movie.

This argument is passed to mencoder in this way:

mencoder ... -ovc lavc -lavcopts vcodec={VideoCodec}"

If omitted, this argument defaults to mjpeg (Motion JPEG).

Examples

rtJPG2Video -video-codec FLV1 -video-filename "myfile.flv"

This will cause mencoder to build the video using the "FLV1" video codec.

-video-filename

By default, the movie files created are named "_movie.avi". You can change this name by using this argument.

If omitted, this argument defaults to "_movie.avi".

Examples

rtJPG2Video -video-filename "VideoOut.avi"

This will cause the created movie to be named "VideoOut.avi".

-video-frames-per-second

This determines frame rate of the created movie in frames-per-second.

The valid range for this argument is 1 to 100, inclusive.

If omitted, this argument defaults to 25.

Examples

rtJPG2Video -video-frames-per-second 12

This will cause the created movie to have a frame rate of 12 frames-per-second.

-video-size

This determines the dimensions (height:width) of the created video. This consists of the desired height and width separated by a colon: -video-size height:width

If omitted, the created video has the same dimensions as the source JPG images.

Examples

rtJPG2Video -dir D:\timelapse -video-size 800:600

This will cause the created movie to have the following dimensions: height: 800 pixels, width: 600 pixels.

rtJPG2Video -dir D:\timelapse

This will cause the created movie to have the same dimensions as the source JPG images.