Bash with arguments to modify ffmpeg command -


i'm trying make bash script takes arguments start time , time, takes input file , output file name. if start time , end time left out, execute input , output.

i've been trying can use script.sh -t1 00:00:00 -t2 00:00:20 far have prompting values.

#!/bin/bash read -ep "enter path .mov-file: " file ifs=: read -rp "where should trimming start? (hh:mm:ss): " shour smin ssec ifs=: read -rp "when should trimming end? (hh:mm:ss): " ehour emin esec ifs=: read -rp "output file: " output start=$(( shour*3600 + smin*60 + ssec )) end=$(( ehour*3600 + emin*60 + esec )) duration=$(( end - start ))  ffmpeg -i "$file" -t "$duration" -c:v libvpx -crf 4 -b:v 1500k -vf scale=640:-1 -c:a libvorbis $output   

please point me in right direction! i've tried using if/else doesn't work.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -