Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- SAVEIFS=$IFS
- IFS=$(echo -en "\n\b")
- if [ ! -d "60FPS" ]; then
- mkdir 60FPS;
- fi
- for f in *.mp4;
- do
- #Get video FPS
- FRAMERATE=$(exiftool -s -s -s -videoframerate $f);
- #Remove decimals
- FRAMERATE=$(echo ${FRAMERATE%.*});
- #Get video bitrate average
- BITRATEVIDEO=$(ffprobe -v error -select_streams v:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 $f);
- #Calculate needed bitrate
- BITRATEVIDEO=$(( ( (BITRATEVIDEO / FRAMERATE) * 60) / 1000 ));
- if (( FRAMERATE < 60)); then
- echo "framerate for $f is ${FRAMERATE} so we will convert it.";
- ffmpeg -i $f -b:v ${BITRATEVIDEO}K -c:a copy -filter:v "minterpolate=fps=60:mi_mode=mci:mc_mode=aobmc:me_mode=bidir:vsbmc=1" "60FPS/${f%.mp4}_60fps.mp4";
- else
- echo "framerate for $f is ${FRAMERATE} so we will ignore it.";
- fi
- done
- IFS=$SAVEIFS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement