Skip to main content

Module timecode_overlay

Module timecode_overlay 

Source
Expand description

Timecode overlay module for rendering timecode as text overlay on video frames.

This module provides the ability to render timecode values as text overlays that can be composited onto video frames. It integrates with the burn-in module and supports multiple display styles, positions, and formatting.

§Features

  • Configurable overlay position (corners, center, custom coordinates)
  • Multiple font size presets (small, medium, large, custom)
  • Background box rendering with configurable opacity
  • Drop-frame and non-drop-frame visual indicators
  • Field dominance indicators for interlaced content
  • Timecode + metadata (reel name, scene/take) overlay

§Example

use oximedia_timecode::{Timecode, FrameRate};
use oximedia_timecode::timecode_overlay::{OverlayConfig, OverlayPosition, render_overlay};

let tc = Timecode::new(1, 30, 0, 12, FrameRate::Fps25).expect("valid tc");
let config = OverlayConfig::default();
let overlay = render_overlay(&tc, &config);
assert!(!overlay.text.is_empty());

Structs§

OverlayConfig
Configuration for the timecode overlay.
OverlayStamper
A timecode overlay layer that can stamp successive frames.
RenderedOverlay
Rendered overlay result containing text, position info, and styling.
Rgba
RGBA colour (0-255 per channel).

Enums§

FontSize
Font size preset for the overlay text.
OverlayPosition
Position of the timecode overlay on the video frame.

Functions§

background_rect
Render a background box behind the overlay text.
compute_position
Compute pixel coordinates for the overlay given frame dimensions.
estimate_text_width
Estimate the pixel width of the overlay text for a monospaced font.
render_batch
Batch render overlays for a sequence of timecodes.
render_overlay
Render a timecode overlay with the given configuration.