How to Set Start Timecode in FFmpeg
Configuring the start timecode of an output video file is essential
for professional video editing, synchronization, and broadcast
compliance. This guide explains how to set an initial timecode using
FFmpeg's built-in -timecode option, covers the proper
timecode format, demonstrates how to apply it with or without
re-encoding, and highlights key considerations regarding frame rates and
container formats.
Basic Syntax
To set the initial timecode, use the -timecode flag
followed by the timestamp in the HH:MM:SS:FF
(Hours:Minutes:Seconds:Frames) format:
ffmpeg -i input.mp4 -timecode 01:00:00:00 output.movIn this example, the resulting video file will have its embedded
timecode track start at exactly 01:00:00:00.
Applying Timecode Without Re-Encoding (Stream Copy)
If your output container supports timecode tracks (such as MOV, MP4,
or MXF), you can write or update the timecode without re-encoding the
video streams by using -c copy:
ffmpeg -i input.mov -c copy -timecode 10:00:00:00 output.movThis updates the metadata and adds or rewires the timecode track instantly without degrading visual quality.
Drop-Frame vs. Non-Drop-Frame Timecodes
For standard integer frame rates (such as 24, 25, or 30 fps), non-drop-frame format uses colons:
ffmpeg -i input.mp4 -timecode 01:00:00:00 -c copy output.movFor NTSC fractional frame rates (such as 29.97 fps), you should
specify drop-frame timecode by using a semicolon (;) before
the frame digits to prevent drift over time:
ffmpeg -i input.mp4 -timecode 01:00:00;00 -c copy output.movSpecifying Output Framerate
FFmpeg calculates the frame value (FF) relative to the
video frame rate. If you are re-encoding or the container frame rate is
ambiguous, explicitly state the frame rate using the -r
option before the timecode flag:
ffmpeg -i input.mp4 -r 25 -timecode 02:00:00:00 -c:v libx264 -c:a aac output.mp4Supported Containers
The -timecode option primarily writes dedicated timecode
tracks into containers that natively support them:
- QuickTime MOV (
.mov): The most compatible format for professional NLEs like Premiere Pro, DaVinci Resolve, and Final Cut Pro. - Material Exchange Format (
.mxf): Broadcast standard; fully compatible with embedded timecodes. - MP4 (
.mp4): Supports the timecode track, though some consumer media players may ignore it.