Sunday, March 18, 2007

SMPTE / EBU time code regular expresion for .net RegularExpressionValidator

SMPTE / EBU time code is used by the video & audio industries for providing frame-accurate time references for editing video & audio tape, or as a master time reference for radio / TV stations. When used for editing, the code is typically recorded on a spare audio or time code track on the tape. SMPTE (Society of Motion Picture & Television Engineers) code runs at 29.97 frames/second; EBU (European Broadcasting Union) code runs at 25 frames/second. These codes send Hour, Minute, Second and Frame data. These codes are basically audio in nature. Another variety of these editing codes known as "VITC" (Vertical Interval Time Code or "vit-see") is video in nature; it is recorded on unused lines in the Vertical Interval of the video signal. ESE manufactures a number of VITC products, primarily for military clients; we can support VITC for other applications on a custom basis.

Time code has following format
XX:XX:XX:XX
where X is a digit (0-9)
Regular expresion that validates that string is:
\d\d:\d\d:\d\d:\d\d

Example:

<asp:RegularExpressionValidator ID="revEndTimeCode" runat="server" ErrorMessage="End time code should be in XX:XX:XX:XX format where X is digit" ValidationExpression="\d\d:\d\d:\d\d:\d\d" ControlToValidate="tbEndTimecode" ValidationGroup="Scene">Valid format is XX:XX:XX:XX</asp:RegularExpressionValidator>

2 comments:

Anonymous said...

Great work.

Anonymous said...

Danke sehr an den Autor.

Gruss Nelly