#!/bin/bash
#                  /usr/local/bin/jpg2mp4
# http://crystalfaeries/posix/bin/jpg2mp4
# celeste:crystalfaery 2015-10-13 17:58:16+00:00
# http://superuser.com/a/624574[1]
# http://www.commandlinefu.com/commands/view/14881/convert-all-jpeg-images-to-mp4
# Combine a series of similarly named JPEG images into an mp4 video, for each argument.
# Output is to current directory
# Input may be relative to $CWD or absolute path.

until [ $# -le 0 ]
do
	cat *"$1"*.jpg | ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - -vcodec libx264 "$1".mp4
	shift
done


syntax highlighted by Code2HTML, v. 0.9.1