Last active
December 18, 2015 05:59
-
-
Save lisamelton/5737083 to your computer and use it in GitHub Desktop.
Batch control for the "transcode-video.sh" script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# batch.sh | |
# | |
# Copyright (c) 2013-2014 Don Melton | |
# | |
# This version published on October 22, 2014. | |
# | |
# Batch control for the "transcode-video.sh" script. | |
# | |
# Input is read from a file named "queue.txt" which must be in the same | |
# directory as this script. | |
# | |
# The queue format is just a carriage return-delimited list of full paths to | |
# media files. The paths can contain spaces and shouldn't be quoted. | |
# | |
# The path is first deleted from the "queue.txt" file and then passed as an | |
# argument to the "transcode-video.sh" script. | |
# | |
# To pause after the "transcode-video.sh" script returns, simply insert a | |
# blank line at the top of the "queue.txt" file. | |
# | |
# Usage: | |
# | |
# ./batch.sh | |
# | |
readonly queue="$(cd "$(dirname "$0")" && pwd)/queue.txt" | |
input="$(sed -n 1p "$queue")" | |
while [ "$input" ]; do | |
sed -i '' 1d "$queue" || exit 1 | |
transcode-video.sh "$input" | |
input="$(sed -n 1p "$queue")" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment