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/
  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/T14_DVR/"
  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 *.ts | sort | tr '\n' ' '`
  32.     if ["$FILES" -eq ""]; then
  33.         ${_zenity} --error --text="No s'han trobat *.ts al directori!"
  34.     else
  35.         if [ ! -f "$DIR/000_all.mpg" ]; then
  36.             #${_zenity} --info --text "cat $FILES > $DIR/000_all.ts"
  37.             cat $FILES > $DIR/000_all.ts
  38.             ffmpeg -i $DIR/000_all.ts -map 0:0 -vcodec copy -map 0:1 -acodec copy $DIR/000_all.mpg
  39.  
  40.         fi
  41.         DELAY=`mediainfo $DIR/000_all.mpg | grep Delay | tr -d "Delay relative to video          :"`
  42.         ${_zenity} --info --text "Fixa't en el Desplaçament de temps: $DELAY"
  43.         avidemux --load $DIR/000_all.mpg
  44.     fi
  45. else
  46.   #${_zenity} --error --text="No s'ha escollit cap fitxer"
  47.   exit
  48. fi
  49. done