Skip to content

Instantly share code, notes, and snippets.

@lemiorhan
Last active October 2, 2018 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lemiorhan/87e98d7630a8e602199da2f568858458 to your computer and use it in GitHub Desktop.
Save lemiorhan/87e98d7630a8e602199da2f568858458 to your computer and use it in GitHub Desktop.
#!/bin/bash
VIDEO_PATH=$1
cd $VIDEO_PATH
echo "Video edit script is ready to run at $VIDEO_PATH"
for folder in `find . -mindepth 1 -type d`
do
cd $folder
if [[ -z $(ls -al | grep min.mp4) ]]; then
echo "======================= Processing ===:> Folder $(pwd)"
ffmpeg -f concat -safe 0 -i <(for f in ./*.MP4; do echo "file '$PWD/$f'"; done) -c copy output.mp4
ffmpeg -i output.mp4 -b 8507k min.mp4
rm output.mp4
fi
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment