October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
DocumentaryTube
24/7 streaming

How to Add an On-Screen Clock to an FFmpeg YouTube 24/7 Stream

Use FFmpeg’s drawtext filter to overlay local time or UTC on a YouTube 24/7 stream, with guidance on escaping, fonts, styling, and troubleshooting.

By DocumentaryTube Team 5 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use FFmpeg’s drawtext video filter to burn a clock into the frames sent to YouTube. Choose localtime to show the FFmpeg host’s configured local time, or gmtime to show UTC. The example below demonstrates a wall clock; its exact escaping may need adjustment for your shell and how you assemble the filtergraph.

Overlay a clock with drawtext

drawtext renders text over video. Add it to the video filtering path before the outgoing video is encoded. A schematic filter value for a date-and-time clock is:

drawtext=fontfile=/path/to/font.ttf:text='%{localtime:%Y-%m-%d %H\:%M\:%S}':x=20:y=20:fontsize=32:fontcolor=white:box=1:[email protected]

Replace /path/to/font.ttf with a font file that exists and can be read by the account running FFmpeg. This example places white text near the upper-left corner, at a nominal size of 32, on a semi-transparent black box. Treat those values as a starting point, not a tested layout for every resolution or video.

Escaping is the part most likely to need adaptation. Colons and backslashes may be interpreted by the shell, the filter syntax, or both. FFmpeg documents multiple levels of escaping; a text file can avoid some escaping problems. Test the exact command in the shell and process environment that will run the continuous stream before relying on it.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Choose local time or UTC

  • localtime: shows the FFmpeg host’s configured local timezone. Use it when viewers should see the time for that host’s location.
  • gmtime: shows UTC. Choose it when you want a time display independent of the host’s local timezone setting.

A wall clock reflects the host clock as frames are processed; it is not a timecode or elapsed timestamp derived from the media’s presentation time. FFmpeg documents separate localtime, gmtime, and pts expansions. The filter does not synchronize the host clock or confirm its timezone, so check both on the machine running the stream.

Put the filter into your existing FFmpeg command

  1. Check the executable and font. Confirm that the FFmpeg build you will actually run includes drawtext, and choose a stable, readable font path accessible to its process account.
  2. Add the overlay to the video path. For a straightforward command, supply the filter with -vf. If your command already uses a more involved filtergraph, incorporate the overlay with -filter_complex rather than replacing other required video processing.
  3. Preserve audio mapping. Keep the audio input and mapping appropriate to your existing command. drawtext modifies video; it does not determine how your audio should be selected or sent.
  4. Test before leaving it unattended. Run the assembled command and verify that the clock appears, updates, uses the intended timezone, and remains readable over the moving footage. Check the command under the same shell and account used for the 24/7 process.
  5. Keep the rest of the stream configuration intact. Input, output protocol, video and audio codecs, frame rate, bitrate, and YouTube ingest settings depend on your setup. The overlay requires video filtering and encoding; it cannot be added while simply stream-copying already encoded video.

FFmpeg’s filtergraph documentation covers filter usage and overlay composition: FFmpeg Filters Documentation. The schematic filter above is not a complete ingest command and is not a claim that a particular end-to-end command was tested.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Make the clock readable and reliable

  • Use a high-contrast treatment. Adjust text color, size, border or shadow, and background box with the documented drawtext options. If the image behind the clock changes, a box or border can help separate the text from the footage.
  • Keep it in the safe visible area. Choose coordinates that avoid important documentary imagery and leave enough margin from the frame edges. Check the result at the resolution viewers will receive.
  • Make the time basis explicit. A host move, rebuild, or timezone change can alter what localtime displays. UTC avoids dependence on the local timezone setting, but still relies on the host clock being correct.
  • Check the installed FFmpeg build. The current online manual may differ from an older or specially built executable. FFmpeg’s documentation is regenerated nightly and recommends consulting the local documentation for older builds: FFmpeg Documentation.

The documented drawtext filter uses libfreetype; its stated configure requirements include --enable-libfreetype and --enable-libharfbuzz. Supplying fontfile gives the filter a specific font file. The font option and font fallback depend on additional fontconfig support, while text_shaping depends on fribidi. Consult the filter reference for the options available in your build: FFmpeg drawtext filter reference.

Troubleshoot common clock problems

  • “No such filter” or an unavailable drawtext filter: The executable may have been built without the required support. Check the local build and documentation; use an executable with the needed filter libraries.
  • Font errors or missing text: Verify that the font file exists and is readable by the process account. Use a stable absolute path rather than relying on a working directory that may change.
  • Invalid arguments or malformed clock text: Review escaping at each parsing layer. Test the exact command in the target shell; consider a text file if escaping the filter argument is cumbersome.
  • Wrong timezone or clock: Confirm the host’s timezone when using localtime, or select gmtime for UTC. Check the host clock separately; the filter does not correct it.
  • Clock is difficult to see: Increase the font size, move it to a less busy area, or adjust the text color, border, shadow, and box. Preview the actual output rather than assuming a setting will suit every video.
  • Audio or output behavior changes after adding the filter: Review your existing stream mapping and filtergraph. The clock changes the video path; audio selection, encoding, and output protocol remain specific to the original command.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or let it run in the cloud

If you do not want an FFmpeg machine and home connection to stay on, StreamNeo keeps an uploaded video or playlist running as a YouTube live stream from the cloud. Upload your recording, add your YouTube stream key once, and go live. It plays uploaded videos rather than broadcasting a camera, and the overlay method above is the do-it-yourself route when you need a clock rendered into the video.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
  • Nothing has to stay on at home; the stream runs from the cloud.
  • Each slot streams the uploaded quality up to 4K 60fps at one flat price per slot, with no re-encode or quality tiers.
  • Automatic recovery is included if YouTube drops the stream.
  • The first day is free with no card, once per account.

Monthly: $9.99 per month. See StreamNeo for details, then start your free first day.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Screening Room

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.