# hour not supported yet. # for now if you want to do hours add 60 to the minutes so 63:5 is 64 minutes 5 seconds # -- #puts "1-60,2-120, #puts "60 times table-" n=10 a="" for i in 1..(n-1) a=a+i.to_s+"-"+(60*i).to_s+"," end a=a+n.to_s+"-"+(60*n).to_s puts "60 times table-" puts a puts "ffmpeg -ss 0 -i infile.mp4 -c copy -t 5 output.mp4" puts "eg type $3:09 3:15" puts "btw if 3:09 3:15 that's 189s-195s which is -ss 189 -t 6" f=gets.chomp thetwotimes=f.split(" ") puts "you want #{thetwotimes[0]}-#{thetwotimes[1]}" #puts thetwotimes[0] t1s=thetwotimes[0].split(":")[0].to_i*60+thetwotimes[0].split(":")[1].to_i t2s=thetwotimes[1].split(":")[0].to_i*60+thetwotimes[1].split(":")[1].to_i puts "that's " + t1s.to_s + " to " + t2s.to_s puts "so from " + t1s.to_s + " for " + (t2s-t1s).to_s + " seconds" # https://superuser.com/questions/1287650/ffmpeg-is-not-even-cutting-this-and-other-mp4s-to-the-nearest-second puts "ffmpeg -ss #{t1s} -i infile.mp4 -vcodec libx264 -acodec libvorbis -t #{t2s-t1s} output.mp4"