Advertisement
metalx1000

Trim all Video Clips in a Folder - MELT - MLT

Nov 5th, 2014
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. #!/bin/bash
  2. #Script by Kris Occhipinti
  3. #http://filmsbykris.com
  4. #GPLv3 - http://www.gnu.org/licenses/gpl-3.0.txt
  5. #Source code https://github.com/metalx1000/Video-and-Film-Scripts
  6. #This Script is designed to trim all video clips in a folder
  7.  
  8. if [ $# -lt 4 ]
  9. then
  10.     echo "Useage: $0 <file type> <start frame> <number of frames> <output dir>"
  11.     echo "Example: $0 MOV 30 120 /tmp/output"
  12.     exit 0
  13. fi
  14.  
  15. ext="$1"
  16. in="$2"
  17. out="$3"
  18. outputdir="$4"
  19.  
  20. echo "creating \"$outputdir\""
  21. mkdir -p "$outputdir" || e="error"
  22.  
  23. if [ "$e" = "error" ]
  24. then
  25.     echo "Can't create $outputdir"
  26.     exit 1
  27. fi
  28.  
  29. for i in *.$ext
  30. do
  31.     melt $i in=$in out=$out -consumer avformat:${outputdir}/$i acodec=mp2 ab=128k
  32. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement