Watermark Video with Two Timestamps

Abstract: Overlay two distinct timestamps like UTC and AEST on a video using FFmpeg drawtext filter with precise positioning.

Created: 2026-08-27 by

You can watermark a video with two distinct timestamps by using FFmpeg's drawtext filter. This allows you to overlay one timestamp in UTC and another in AEST simultaneously. By specifying separate x and y coordinates for each text instance, you create a professional dual-time display without complex editing software.

Understanding the Drawtext Filter

The core of this solution relies on FFmpeg's powerful drawtext filter. This tool enables you to render text directly onto video frames during the encoding process. It supports various formatting options, including fonts, colors, and dynamic expressions that update every frame. For our specific use case, we need to leverage time-based expressions to ensure the timestamps remain accurate throughout the video duration. When working with multiple overlays, it is crucial to understand that each instance of the drawtext filter must be defined as a separate expression within the filter chain. You cannot simply stack the same filter twice; instead, you chain them together or define them as separate filters linked in sequence. This approach ensures that the rendering engine processes each text element independently, allowing for precise positioning and distinct content.

Constructing the Command Line

To achieve the desired result, you will construct a command that includes two separate drawtext definitions. The first definition handles the UTC timestamp, while the second manages the AEST timestamp. Both filters are combined into a single filter string separated by a comma. Here is the basic structure of the command:
ffmpeg -i input.mp4 -vf "drawtext=text='%{localtime:%Y-%m-%d %H:%M:%S UTC}':x=10:y=10:fontsize=24:fontcolor=white, drawtext=text='%{localtime+8:%Y-%m-%d %H:%M:%S AEST}':x=10:y=50:fontsize=24:fontcolor=white" output.mp4
In this example, the first drawtext instance places the UTC time at the top-left corner (x=10, y=10). The format string %{localtime:%Y-%m-%d %H:%M:%S} generates the date and time in a readable hyphenated format. The second instance shifts the position to y=50 to avoid overlapping with the first timestamp. The key difference here is the addition of +8 to the localtime variable, which adjusts the base time to Australian Eastern Standard Time (AEST), assuming the source video is already in UTC. If your source video is not in UTC, you may need to adjust this offset accordingly. For more advanced customization, consider exploring other video manipulation techniques such as Watermark Video with Two Timestamps. This related guide offers additional insights into layering visual elements effectively.

Positioning and Styling Options

Precise positioning is essential when displaying two timestamps. The x and y parameters control the horizontal and vertical placement of the text, respectively. These values represent pixels from the top-left corner of the video frame. Using relative positioning is also possible by employing expressions like w-tw-10 for right-aligned text, where w is the video width and tw is the text width. Styling the text enhances readability against various backgrounds. The fontsize parameter controls the size of the font, while fontcolor sets the color. You can use hex codes for specific colors, such as 0xFFFFFF for white. Adding a shadow or outline can improve visibility on bright or busy video segments. Although drawtext does not natively support drop shadows, you can achieve this effect by combining it with other filters like boxblur or by pre-rendering the text with transparency. If you are dealing with large files, optimizing the encoding process is vital. Check out Resizing Video with FFmpeg: Two Passes, Without Aspect Ratio, Without Black Borders to learn how to maintain quality while managing file sizes efficiently.

Font Selection and Availability

FFmpeg requires a valid font file to render text. By default, it searches for common system fonts. However, for consistent results across different operating systems, it is recommended to specify the full path to a font file using the fontfile parameter. For example, fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf. Ensure that the font supports the characters you intend to display, especially if you are using special symbols or non-Latin scripts.

Handling Time Zones Correctly

Accurate time zone conversion is critical for dual-timestamp watermarks. The localtime expression in FFmpeg uses the system's local time zone settings unless modified. To convert UTC to AEST, adding 8 hours is standard for standard time. However, during daylight saving periods, some regions in Australia observe AEDT (UTC+10). Therefore, a static offset might not always be correct depending on the date of the video recording. For most security or surveillance applications, a fixed offset is often acceptable due to simplicity. If precise daylight saving awareness is required, you may need to calculate the offset dynamically using external tools or scripts before passing the value to FFmpeg. Alternatively, you can hardcode the specific offset for the known date range of the video footage.

Performance Considerations

Rendering text overlays in real-time can impact performance, especially on lower-end hardware. The CPU usage depends on the complexity of the filter graph and the resolution of the video. Using hardware acceleration, such as NVENC for NVIDIA GPUs or QSV for Intel, can significantly speed up the encoding process. When using hardware encoders, ensure that the filter graph is compatible with the chosen codec. Some advanced filters may not work seamlessly with all hardware acceleration profiles. Testing the command on a short segment of the video first is highly recommended. This allows you to verify the positioning, timing, and styling without waiting for a full-length encode to complete. Adjust the parameters iteratively until the output meets your visual requirements.

Frequently Asked Questions

Why do my timestamps appear pixelated?

Pixelation usually occurs when the font size is too large relative to the video resolution or when scaling down the output. Ensure that the fontsize value is appropriate for the target resolution. Additionally, check if the output video is being downscaled incorrectly after the filter application.

Can I use a custom font for the timestamps?

Yes, you can specify any TrueType or OpenType font by providing its absolute path using the fontfile parameter. Make sure the font is accessible to the user running the FFmpeg command and that it supports the necessary character set for your language.

How do I align the text to the center?

To center the text horizontally, use an expression for the x coordinate such as (w-tw)/2, where w is the video width and tw is the text width. For vertical centering, use (h-th)/2, where h is height and th is text height.

What if my video is not in UTC?

If the source video's metadata does not reflect UTC, the localtime expression will use the system's local time. You must manually adjust the offset in the expression to match the intended time zone. For example, subtract hours if converting from a later time zone to UTC.

Does this method work with MP4 containers?

Yes, FFmpeg can apply these filters to MP4 containers provided the codec supports the resulting stream. H.264 and H.265 codecs are commonly used with MP4 and handle drawtext overlays without issue. Ensure the final container format is compatible with your playback devices.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More