I wish to know how to calculate the difference among two video timecodes tha are in frames (in this case, a second equals 30 frames).
Let say the point A is 600 (00:00:02) and the point B is 120 (00:00:04).
How can I calculate the difference among pont A and B and echo the result in the 00:00:00.00 format (h:m:s) using bash?
UPDATE:
This is perfection: http://www.1728.com/angle.htm
First off, the
exportstatements are redundant since the current shell is expanding$Aand$B.To get those numbers from the timestamps, GNU
datewill help:Now you can do your calculations, then translate back at the end for display (as Edwin Buck said, don’t try to store intermediate results in this format):