etmccalc is a tool which makes calculations with timecodes and related ways of measuring time for audio-visual media.
etmccalc tool exclusively uses system and C/C++ standard libraries. So, no other packages have to be installed for
etmccalc to work properly.
The Windows binary is included in the package. To obtain the linux binary, (or the cygwin one), simply unpack the package, and launch
make in the obtained directory. This should also work for Mac OS X and probably all POSIX-like systems.
If the Windows binary doesn't work on your Windows system, please take a look to this page.
This tool (and the underlying libraries) are released under the GNU General Public License. This is the default licence, but, under some circumstances, other licences (with less restrictions, like GNU Lesser General Public License) are possible. Please contact me for more details.
This tool is in the early stages of development, so the way to use it will probably be changed in the future.
This is the general command line syntax:
etmccalc [<options>] <fps> [<timcode>[ <timecode>[...]]]
(-f|--format) <format>: output formating specification. Default is the content of the enviroment variable
ETMCCALC_FORMATor, if empty or not defined, '
%P'. See below for more details.
(-p|--punctuations) <punctuations>: punctuations used for
%p(see above). Default is the content of the enviroment variable
ETMCCALC_PUNCTUATIONSor, if empty or not defined, '
;:'. See below for more details.
fpsis the frames-per-second specification for the result (an integer,
nfor not realtime)),
timecodethe timecode for the calculation (currently in
h:m:s:f@fpsformat ; for
fpsvalue, see above).
| ||Amount of days|
| || Same as
| ||Hours in the day|
| ||Total amount of hours|
| ||Minutes in the hour|
| ||Total amount of minutes|
| ||Seconds in the minute|
| ||Total amount of seconds|
| ||Frames in the second|
| ||Total amount of frames|
| ||Remainder as float (for testing purpose)|
| ||Remainder as fraction (for testing purpose)|
| ||FPS-type dependent punctuation (see below)|
| || After Effect format (
| || Final Cut Pro format (
1 by default). Optional set of following flags :
,: the decimal separator to use,
The punctuations option is used for the '
%p' format marker. For drop frame, the first character is used. For non-real-time, the second character is used if set. If not defined the one for drop frame is used. For non drop frame, the third character is used if set. Alternatively the one for non-real-time is used.
These optional markers specify how the timecode values are rounded, but don't cause anything to be display. You have to specify a display marker (see above) to see some output.
This rounding markers affect the timecode as a whole. For example, if you specify
%<m (round down the minutes), the seconds (and frames) value will always be 0.
| ||Round down|
| ||Mathematical rounding (default rounding)|
| ||Round up|
hfor hours, and so on …)
Let's say you want to convert an NTSC/29.97 frame count to a PAL frame count:
etmccalc -f '%F' 25 '7035@30d' => 5863
The last example will round as taught in school. So if you are interested in the size of the error you can do this:
etmccalc -f '%F %c' 25 '7035@30d' => 5863 -0.0143
The result now contains a second value that tells you the error in seconds. A negative value means that the actual value should be smaller by the amount given. In this case the value was about 1/100 of a second smaller (0.01 seconds). The resulting value is too large by the same amount.
If you want to force rounding up or rounding down you can do it like this:
etmccalc -f '%>0F%F %c' 25 '7035@30d' => 5864 0.0257
For rounding down just swap the ”>” with a ”<”.
There currently is no obvious way to convert from seconds (as a float value) to anything else. Here is a workaround:
etmccalc -f '%<0F%F' 30d '1.7035@10000' => 51
Due to the variable types used, the maximum frame rate is 4294967295 fps. This is also the maximum value for any other integer.
For those who don't want or cannot compile binaries for Mac OS X, there are some precompiled Mac OS X binaries made by Jan Weiß (who also helped with testing, suggestions and updating of this page) in the download section.