Advertisement
nighthoodie

dovid

Nov 21st, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. ###############
  5. # dovid <videos>
  6. #       - creates single webpage of contact sheets of a dIRECTORY oF vidEOS
  7. ###############
  8. # dependencies:
  9. #
  10. # vcs-creates video contact sheets (previews) of videos. http://p.outlyer.net/vcs/
  11. #
  12. # convert-part of ImageMagick suite, vcs dependent, robust collection of tools and
  13. #       libraries to create, edit and compose bitmap images in over 90 image formats
  14. #       http://www.imagemagick.org/
  15. #
  16. # pdftohtml-pdf to html converter http://pdftohtml.sourceforge.net/
  17. #
  18. ################
  19.  
  20.  
  21. rm="/bin/rm"
  22. mv="/bin/mv"
  23. time="/usr/bin/time"
  24. mkdir="/bin/mkdir"
  25. cd="/usr/bin/cd"
  26. date="/bin/date"
  27. sleep="/bin/sleep"
  28. vcs="/opt/local/bin/vcs"
  29. convert="/opt/local/bin/convert"
  30. pdftohtml="/opt/local/bin/pdftohtml"
  31. ########### contact sheet paramaters
  32. columns="2"
  33. rollsize="4"
  34. frame_height="320"
  35.  
  36. mkdir html_preview_of_these_videos
  37.  
  38. echo
  39. echo "  creating contact sheets..."
  40. echo
  41.  
  42. while [ "$1" != "" ]
  43. do
  44.         echo "  "$1
  45.         echo "          processing..."
  46.         $(vcs --quiet -dt -ds -dp -u "0" -n $rollsize -c $columns -H $frame_height "$1" >/dev/null 2>&1)
  47.         sleep 0.2
  48.         mv $1.png html_preview_of_these_videos/
  49.         shift
  50. done
  51.  
  52. sleep 0.1
  53.  
  54. cd html_preview_of_these_videos
  55.  
  56. echo
  57. echo "  merging documents..."
  58. echo
  59.  
  60. convert *.png index.pdf >/dev/null
  61.  
  62. sleep 0.1
  63.  
  64. rm *.png
  65.  
  66. echo
  67. echo "  generating index file..."
  68. echo
  69.  
  70. pdftohtml -s -noframes index.pdf >/dev/null
  71.  
  72. sleep 0.1
  73.  
  74. rm index.pdf
  75.  
  76. echo
  77. echo "  done."
  78. echo
  79.  
  80. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement