Last active
August 10, 2017 08:55
-
-
Save parixitjani/5c5206c3868e8f78dc20f89aa4273b08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for mfile in $ifiles | |
do | |
outfile=${mfile%.*} | |
ext=${mfile##*.} | |
#convert to mp4 if file is not mp4 | |
if [ $ext != 'mp4' ] | |
then | |
_ffmpegcmd1="ffmpeg -loglevel panic -y -i $mfile -deinterlace -pix_fmt yuv420p -an -vf scale=640:trunc(ow/a/2)*2 -vcodec libx264 -threads 0 "$outfile".mp4" | |
$_ffmpegcmd1 | |
fi | |
_ffmpegcmd2="ffmpeg -loglevel panic -y -i "$outfile".mp4 -deinterlace -pix_fmt yuv420p -an -vf scale=640:trunc(ow/a/2)*2 -c:v libx264 -r 60 -c:a aac -ar 48000 -b:a 160k -strict experimental -f mpegts "$outfile".ts" | |
$_ffmpegcmd2 | |
vfile="$vfile""$outfile"".ts""$seperator" | |
done | |
ffmpeg -loglevel panic -y -i "concat:$vfile" -c copy -bsf:a aac_adtstoasc $ofile | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment