What Time Formats Are Valid in SMIL clipBegin and clipEnd?
Synchronized Multimedia Integration Language (SMIL) supports two
primary time value categories for the clipBegin and
clipEnd attributes: Clock Values and SMPTE Timecodes. These
attributes allow authors to extract specific sub-clips from continuous
media objects such as audio or video files. Depending on the SMIL
profile and player implementation, clock values can be expressed in full
clock format, partial clock format, or timecount values with metric
units, while SMPTE timecodes allow frame-accurate clipping for
professional media.
Clock Values
Clock values describe time offsets relative to the start of the referenced media item. SMIL allows three distinct syntax variations for clock values:
- Full Clock Format (
hh:mm:ss.fraction): Specifies two digits for hours, two digits for minutes, and two digits for seconds, optionally followed by a decimal point and fractional seconds. For example,01:15:30.50indicates 1 hour, 15 minutes, 30 seconds, and 500 milliseconds. - Partial Clock Format (
mm:ss.fraction): Specifies two digits for minutes and two digits for seconds, with an optional fractional second component. For example,02:45represents 2 minutes and 45 seconds, while00:12.75represents 12.75 seconds. - Timecount Values (
value[metric]): Specifies an integer or floating-point number followed immediately by an optional time unit indicator. If no metric is explicitly provided, the default unit is seconds (s). The supported metrics are: - Hours (
h): e.g.,1.5h(1 hour and 30 minutes) - Minutes (
min): e.g.,45min(45 minutes) - Seconds (
s): e.g.,90sor90(1 minute and 30 seconds) - Milliseconds (
ms): e.g.,1500ms(1.5 seconds)
SMPTE Timecode Values
For frame-accurate positioning within professional broadcast and
editing formats, SMIL also supports SMPTE (Society of Motion Picture and
Television Engineers) timecodes. SMPTE values require the explicit
smpte:, smpte-25:, smpte-30:, or
smpte-30-drop: prefix to define the exact frame rate and
drop-frame specifications:
- Standard SMPTE (
smpte:hh:mm:ss:ff): Follows standard 24, 25, or 30 frames-per-second timecodes using colons between all fields, such assmpte:00:01:20:12. - Drop-Frame SMPTE
(
smpte-30-drop:hh:mm:ss;ff): Used for NTSC color television broadcasts (29.97 fps) where dropped frames are accounted for, typically delimited with a semicolon before the frame count (e.g.,smpte-30-drop:00:10:00;02).
Syntax Rules and Special Values
When applying clipBegin and clipEnd
attributes within SMIL elements like <audio>,
<video>, or <ref>, specific syntax
constraints apply:
- Unsigned Values: The values supplied to
clipBeginandclipEndmust always be non-negative. - No Whitespace: No whitespace is permitted between
the numerical digits and their corresponding time metric (for example,
10 sis invalid, whereas10sis valid). - Special Identifiers: In certain SMIL profiles,
clipBegincan be set to0or0sto indicate the absolute beginning of the media, andclipEndcan accept implementation-specific keywords or be omitted to span until the native media file duration concludes.