Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2011 by jrierab
  4. #
  5. # This script usage is described in:
  6. # http://anomenaidesa.blogspot.com/2011/07/edicio-de-videos-mpeg-capturats-la-tdt.html
  7. #
  8. # Author can be contacted there also.
  9. #
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version.
  15. #
  16. # Mediainfo PPA
  17. # http://ppa.launchpad.net/shiki/mediainfo/ubuntu
  18.  
  19. _zenity="/usr/bin/zenity"
  20. DIR="/home/jordi/Vídeos/AliDVR/"
  21.  
  22. while [ true ]
  23. do
  24.  
  25. DIR=$(${_zenity}    --title  "Escull els vídeos a unir" \
  26.             --file-selection --directory \
  27.             --filename="$DIR" )
  28.  
  29. if [ $? -eq 0 ]
  30. then
  31.     FILES=`find $DIR/* -maxdepth 0 -name *.MPG | sort | tr '\n' ' '`
  32.     if ["$FILES" -eq ""]; then
  33.         ${_zenity} --error --text="No s'han trobat *.MPG al directori!"
  34.     else
  35.         if [ ! -f "$DIR/000_all.mpg" ]; then
  36.             #${_zenity} --info --text "cat $FILES > $DIR/000_all.mpg"
  37.             cat $FILES > $DIR/000_all.mpg
  38.         fi
  39.         DELAY=`mediainfo $DIR/000_all.mpg | grep Delay | tr -d "Delay relative to video          :"`
  40.         ${_zenity} --info --text "Fixa't en el Desplaçament de temps: $DELAY"
  41.         avidemux --load $DIR/000_all.mpg
  42.     fi
  43. else
  44.   #${_zenity} --error --text="No s'ha escollit cap fitxer"
  45.   exit
  46. fi
  47. done