Guest User

Untitled

a guest
May 26th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. for pptName in ./*.pptx; do
  4. mkdir "${pptName}_folder"
  5. cd "${pptName}_folder"
  6. unzip "../$pptName"
  7. cd ppt/media
  8. if [ -f "media1.mp4" ]; then
  9. for filename in ./*.mp4; do
  10. ffmpeg -i "$filename" -vf scale=1920:1080 -strict -2 -c:v libx264 -crf 30 -preset slow "${filename}_small.mp4"; cat "${filename}_small.mp4" > "$filename"; rm "${filename}_small.mp4"
  11. #ffmpeg -i "$filename" -vf scale=1280:720 -strict -2 -c:v libx264 -crf 30 -preset slow "${filename}_small.mp4"; cat "${filename}_small.mp4" > "$filename"; rm "${filename}_small.mp4"
  12. done
  13. fi
  14. cd ../../
  15. NEW_FILE=$(basename "${pptName}" .pptx)
  16. zip -r "../${NEW_FILE}_small.pptx" ./*
  17. # zip -r "../${pptName}_small_720.pptx" ./*
  18. cd ..
  19. rm -rf "${pptName}_folder"
  20. done
Add Comment
Please, Sign In to add comment