FFmpeg Cookbook
JA

Timecode Converter

Convert between HH:MM:SS.mmm time, total seconds, frame numbers and HH:MM:SS:FF timecode, at 23.976 to 60 fps, with drop-frame at 29.97 and 59.94 fps.

e.g. 01:23:45.678
e.g. 90.5
The first frame is 0. e.g. 2715
FF is the frame. Drop-frame uses ; before FF (e.g. 00:01:30;15)
Time
—
Total Seconds
—
Frame Number
—
Timecode
—
Popular uses
Match subtitles and edit pointsConvert frame numbersCheck drop-frame timing

How to use

  1. Enter a valueType into any one of time, total seconds, frame number or timecode.
  2. Pick FPS23.976 / 24 / 25 / 29.97 / 30 / 50 / 59.94 / 60.
  3. Read resultThe other three values are calculated automatically.

Recommended settings

Phone and screen recordings
30 or 60 fps (match the source)
A different FPS gives a different frame number, so use the source’s rate.
Movies / drama
24 / 23.976 fps
Film footage is normally 24p (or 23.976p).
TV broadcast (North America, Japan)
29.97 fps
TV in North America and Japan uses 29.97 fps, a rate inherited from NTSC.

When it goes wrong

Does not match the timecode in an editor

Cause: The drop-frame setting differs from the editor. At 29.97 fps non-drop, the timecode falls behind real time by about 3.6 seconds per hour.

Fix: If the editor separates the frames with “;”, turn drop-frame on; with “:”, turn it off.

Questions

What is drop-frame?

A way of counting 29.97 fps timecode so it stays in step with real time. It skips frame numbers 00 and 01 at the start of every minute, except every tenth minute (00, 10, 20…). No actual frames are removed.

23.976 vs 24?

23.976 fps (exactly 24000/1001) is 24 fps slowed by 0.1% to suit NTSC television. The difference is about 3.6 seconds per hour.

More detail (settings, limits, FFmpeg commands)

What each setting means

FPS
Frames per second. The frame number is seconds × FPS, rounded.
Drop-frame
Shown for 29.97 and 59.94 fps, and on at first. Drop-frame timecode is written HH:MM:SS;FF and skips the first frame numbers of each minute (00 and 01 at 29.97 fps, 00 to 03 at 59.94 fps), except minutes 00, 10, 20 and so on. Turn it off to count non-drop (HH:MM:SS:FF).
Timecode
HH:MM:SS:FF, as editing software shows it; FF is the frame within the second. A number that drop-frame skips (such as 00:01:00;00) is reported as an error.

Browsers and limits

  • Calculator only; it does not change any video.

The same job with the FFmpeg command line

Pass timecodes to FFmpeg
ffmpeg -ss 00:01:30.500 -to 00:02:00.000 -i input.mp4 -c:v libx264 -c:a aac output.mp4
Times can be written as HH:MM:SS.mmm. -c copy is faster, but the video then starts at a keyframe instead of the exact time.