Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- mkdir -p output/
- ls *.mp4 | while read -r l;
- do
- sec=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$l")
- round_sec=${sec%.*}
- if [[ $round_sec -lt 60 ]]; then
- loop=$(expr 60 / $round_sec)
- round_loop=$(expr ${loop%.*} + 2)
- # echo $l $round_loop $round_sec
- echo "ffmpeg -stream_loop ${round_loop} -i "${l}" -c copy output/${round_loop}_${l}" >> run.sh
- fi
- done
- bash run.sh
- rm -rf run.sh
Add Comment
Please, Sign In to add comment