Descrizione
Questo script trasforma uno o più files in formato avi/mpeg/simili in formato mpeg adatto ai normali lettori DVD che non sono compatibili con i formati DivX. Dopo aver fatto la trasformazione masterizza su DVD i files risultanti.
Perché lo script funzioni è necessario che
- sia installato mktemp
- sia installato ffmpeg
- sia installato growisofs
- ci siano almeno 10Gb liberi nella directory in cui viene lanciato lo script (per masterizzare un DVD da 4.7Gb)
Uso
mtodvd.sh file1 [file2 ... ]
dove i file specificati sono file video in un quache formato capibile da ffmpeg (si veda la relativa documentazione).
Bachi noti
- Non compie alcun controllo sulla dimensione del file convertito in formato DVD VIDEO, quindi è possibile che il DVD non venga masterizzato se i files risultanti dalla conversione sono più grandi della capacità del DVD vergine inserito nel masterizzatore.
mtodvd.sh
#!/bin/bash
# mtodvd.sh converts from various video formats to dvd-video and burns
# the resulting files onto dvd media
# Copyright (C) 2008 Lucio Crusca <lucio_at_sulweb.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
function atexit()
{
rm -rf $ALLMPGS "$TEMPDIR"
exit 0;
}
trap 'atexit' INT TERM EXIT
export TMPDIR="."
TEMPDIR=`mktemp -d`
ALLMPGS=""
for f in $@ ; do
IFILE="$f"
if ! [ -r "$IFILE" ] ; then
echo "$IFILE non e' un file video leggibile."
exit 1
fi
done
for f in $@ ; do
IFILE="$f"
TEMPMPG=`mktemp`
ffmpeg -i "$IFILE" -target pal-dvd -y "$TEMPMPG"
ALLMPGS=$ALLMPGS" $TEMPMPG"
done
if [ "$ALLMPGS" == "" ] ; then
echo "Specificare almeno un file video."
exit 2
fi
dvdauthor -t -c 0:10:00,0:20:00,0:30:00,0:40:00,0:50:00,1:00:00,1:10:00,1:20:00,1:30:00,1:40:00,1:50:00,2:00:00,2:10:00,2:20:00,2:30:00,2:40:00,2:50:00,3:00:00 $ALLMPGS -o "$TEMPDIR"
dvdauthor -T -o "$TEMPDIR"
growisofs -Z /dev/dvd -speed=4 -dvd-video "$TEMPDIR"