#! /bin/bash echo "Input num : " read num for (( i=1; i<=$num; i=i+1 )) do (time ./ffmpeg -threads $i -i nihao.mp4 -vcodec h264 -vb 1800000 -r 25 -movflags faststart -qscale:v 4 -acodec aac -ab 128000 -ac 2 -ar 44100 -f mp4 -y /home/inleft/test.mp4) | tee $i.txt done