Editing video for LCA

I’ve just finished writing a small script that will help us edit and transcode video recorded at LCA 2007. Since we will record directly to DVD, we will need a simple laptop with a DVD drive and the installed software gmplayer and ffmpeg2theora to do the editing and transcoding, before uploading to a Web server. Which means that just about all LCA participants are potential helpers for making sure the video material gets published on the same day.

If you happen to be a LCA participant and want to help ascertain video publishing happens, please walk up to the video guys and offer your editing & transcoding help.

Ah yes, and here is the script – in case anyone is interested:


#!/bin/sh

# usage function
function func_usage () {
echo "Usage: VOB2Theora.sh "
echo " starttime/endtime given as HH:MM:SS"
echo " filename input file for conversion"
}

# convert from SMPTE to seconds
function func_convert2sec () {
tspec=$1;
tlen=${#tspec} #strlen

# parse seconds out of string
tsecstart=$[ ${tlen} - 2 ]
tsec=${tspec:$tsecstart:2} #substr

# parse minutes
tminstart=$[ ${tlen} - 5 ]
if test $tminstart -ge 0; then
tmin=${tspec:$tminstart:2} #substr
else
tmin=0
fi

# parse hours
thrsstart=$[ ${tlen} - 8 ]
if test $thrsstart -ge 0; then
thrs=${tspec:$thrsstart:2} #substr
else
thrs=0
fi

# calculate number of seconds from hrs, min, sec
tseconds=$[ $tsec + (($tmin + ($thrs * 60)) * 60) ]
}

# test number of parameters of script
if test $# -lt 3; then
func_usage
exit 0
fi

# convert start time
func_convert2sec $1
tstart=$tseconds

# convert end time
func_convert2sec $2
tstop=$tseconds

# input file
inputfile=$3
if test -e $inputfile; then
echo "Converting $3 from $tstart sec to $tstop sec ..."
echo ""
else
echo "File $inputfile does not exist"
exit 1;
fi

# convert using ffmpeg2theora
strdate=`date`;
strorga="LCA";
strcopy="LCA 2007";
strlicense="Creative Commons BY SA 2.5";
strcommand="ffmpeg2theora -s $tstart -e $tstop --date '$strdate' --organization '$strorga' --copyright '$strcopy' --license '$strlicense' --sync $inputfile"

echo $strcommand;

sh -c "$strcommand";

Ralph Giles made an improved version of the VOB2Theora script. It can be found at http://mirror.linux.org.au/linux.conf.au/2007/video/VOB2Theora_v2.sh.

Leave a Reply

Your email address will not be published. Required fields are marked *