NoPaste Service
DOWNLOAD
Language: Bash
Author: Matrix86
Description: Divx2DVD.sh
Date: 07/03/08 17:39
  1. #!/bin/sh
  2. # Script per la conversione di filmati Divx/Xvid in DVD. Specificare in ingresso il nome del file avi.
  3. # Lo script creerà automaticamente una ISO pronta da masterizzare con l immagine del DVD! =)
  4.  
  5. dir="DVD"
  6. tmp=0
  7.  
  8. function usage(){
  9.   echo -e "Divx2Dvd Conversion Script"
  10.   echo -e "Usage: `basename $0` <inputfile>\n"
  11.   exit 1
  12. }
  13.  
  14. if [ ! $# -eq 1 ]; then
  15.   usage
  16. fi
  17.  
  18. if [ ! -e $1 ]; then
  19.   echo -e "Il file $1 non è stato trovato!\nUscita!"
  20.   exit 1
  21. fi
  22.  
  23. while [ -d $dir-$tmp ];
  24. do
  25. #  echo "La cartella $dir-$tmp esiste"
  26. :  $[ tmp++ ]
  27. done
  28.  
  29. dir=$dir-$tmp
  30. tmp=0
  31.  
  32. echo "Creo la cartella temporanea $dir."
  33.  
  34. mkdir $dir
  35.  
  36. while [ -e videotemp-$tmp ];
  37. do
  38. :  $[ tmp++ ]
  39. done
  40.  
  41. mencoder -of mpeg -mpegopts format=dvd -srate 48000 -ofps 25 -ovc lavc -oac lavc \
  42.          -lavcopts vcodec=mpeg2video:vhq:vrc_buf_size=1835:keyint=15:vrc_maxrate=9800:vbitrate=9000:aspect=4/3:acodec=ac3:abitrate=192  \
  43.          -af volume=10.1 $1 -o videotemp-$tmp.mpg
  44.  
  45. dvdauthor -t videotemp-$tmp.mpg -o $dir -c "0,0:30,1:00,1:30,2:00,2:30,3:00,3:30,4:00"
  46.  
  47. # Creazione tavola dei contenuti:
  48. dvdauthor -T -o $dir
  49.  
  50. # Creazione ISO:
  51. mkisofs -dvd-video -o $dir.iso $dir