Using the Movie Maker software from the Command Line
Goals:
- Start a Server from the command line
- Connect to the server to check its status/alive state/history
- Connect to the server using the client from the command line
This guide will show you how to use the convenient command line utilities for creating a movie from a previously generated set of images. These tools are useful for batch jobs where little or nothing changes between each movie created. Lets start by starting up a server.
The server is a stand-alone class that is run on its own. It accepts two arguments. The first argument to the server is the TCP port it should listen to. The second argument is optional and specifies the Message of the Day, which is a string that will be displayed at the top of any server status requests. This can be useful for public servers, so people can know to whom and to where they are connecting.
Once the server is running, we can now connect to it and check things like its status (uptime and job counters) as well as test to ensure that it is still running. The latter is good for cron jobs that will ensure the server is still running. There is a seperate class for this called
ServerStatus?. This class takes 3 arguments: hostname, port, and the identifier for the action to run. The first two are self explanatory, while the last deserves some attention. There are 4 actions that
ServerStatus? can report: status, history, isAlive, and clean. Status will return the server's MOTD, uptime, current number of jobs, and total number of jobs. History returns the last 15 jobs processed by the server. The history contains the hostname, ip, and port of the client, the time connected and time disconnected, the duration of the job, and the number of images processed. isAlive will return "Alive" if the server sends a response, and nothing if there isn't. This can then be used in, for example, a
bash script in an
if statement. Finally, the clean action. This will tell the server to attempt to clean any temporary work files it happened to leave behind. The server only does this if there are no current jobs. If there are current jobs, the response is "Busy, Nothing Cleaned". Otherwise, "X File(s) Deleted", where X is the number of files deleted, is returned.
Now let's take a look at the Client. The command line version of the client is capable of just about everything that the GUI version is. You can still add text screens to the movies, with the only difference being options for the text screens apply to all screens, not just one. First, lets look at the required command line options for running the client:
| --port <port> | connects to the specified port |
| --input-dir <dir> | load all .png images from this directory for use in the movie |
| --output <file> | the filename to save the movie to |
As you can see above, there are only three required options. If the hostname is not given, the client will connect to
localhost by default. Now lets look at the optional commands:
| --host <hostname> | by default it uses localhost, but otherwise connect to specified remote host |
| --fps <framerate> | used to specify the number of frames per second. The default is 24 fps |
| --compress | compress the images using JPEG compression. Compression is done at the server. If this is set, the movie will be a Quicktime .mov file. Without compression, the resulting movie will be a raw .AVI file. |
| --quality <percent> | specify the quality for the compression. 0% being the worst, 100% being the best. Default compression quality is 75% |
| --text <x,y,z...> | adds a text intro screen to the video. The format is as follows: x = font size, y = font justification (C, L, or R), and z = any number of comma delimeted strings. Each string is a new line on the screen. Each '--text' line found denotes a new screen. |
| --text-show <duration> | sets the duration of the text screens. The default is for 2 seconds |
| --date <loc> | Show the date in the form "Month Day, Year" in the specified location. The location value is optional, which defaults to bottom right. Valid inputs are TL, TC, TR, and BR (Top Left, Top Center, Top Right, and Bottom Right) |
| --font <font-name> | the font to use in the text screens. The default is "Arial" |
| --font-color <hex> | sets the font color, Default is black. Must be in the hex (HTML) form for colors - RRGGBB |
| --bg-color <hex> | Sets the background color, Default is white. Must be of the hex (HTML) form for colors - RRGGBB |
| --bg-alpha <alpha> | sets the transparency of the background. Valid numbers range from 0 to 255, with 0 being completely transparent, and 255 being solid |
Let's try some examples to see the above options in action.
In this scenario let's assume the server is running on the localhost, port 9999, the images are contained in
/home/bob/grapecluster/images, and Bob wishes to save the movie to
/home/bob/movies/gc.avi. Bob doesn't want any compression or any other options, just the bare minimum that will make a movie:
--port 9999 --input-dir /home/bob/grapecluster/images --output /home/bob/movies/gc.avi
Now Bob wants a compressed version at 50% of the same thing above:
--port 9999 --input-dir /home/bob/grapecluster/images --ouput /home/bob/movies/gc-compressed.mov --compress --quality 50
Now Bob wants an intro screen that says "Bob's Movie" on one line, followed by a line that says "Made with Grapecluster" on a second line. He wants the font size to be 50pt, and he wants it centered:
--port 9999 --input-dir /home/bob/grapecluster/images --output /home/bob/movies/gc.avi --text 50,C,"Bob's Movie","Made with Grapecluster"
The above quotes around "Bob's Movie" and "Made with Grapecluster" are important, otherwise the spaces will throw off the option parser.
Finally, Bob wants to add a second screen to the above that says "Grapecluster Rules!":
--port 9999 --input-dir /home/bob/grapecluster/images --ouput /home/bob/mobies/gc.avi --text 50,C,"Bob's Movie","Made with Grapecluster" --text 50,C,"Grapecluster Rules!"
--
AndrewRader?