Closed captions (CC) are a text transcript of the dialogue and important sounds of a program. They travel with the video and the viewer can turn them on or off. Captions are required for most broadcast programs in the USA, Canada and several other countries.
The SDK reads captions from files and SDI inputs, passes them through the pipeline with each frame, and sends them to SDI outputs, files and network streams. You can also preview, create, replace and remove captions.
Caption standards
| Standard | What it is |
|---|---|
| CEA-608 (EIA-608, "line 21") | The original analog caption standard. Each frame carries two bytes per field. Field 1 holds caption channels CC1 and CC2, field 2 holds CC3, CC4 and XDS data (program name, rating). Only basic Latin characters and simple styling. |
| CEA-708 | The digital TV standard: up to 63 services, Unicode text, windows, fonts and colors. A CEA-708 stream also carries the CEA-608 bytes for older receivers. |
How the captions are carried depends on the transport:
- SDI: in VANC packets – a Caption Distribution Packet (CDP, SMPTE 334-2) with CEA-708 and CEA-608 data, or CEA-608 byte pairs alone (SMPTE 334-1). In NTSC SD, CEA-608 can also be on analog line 21.
- Compressed video: as ATSC A/53 user data inside the MPEG-2 or H.264 video stream.
- Files: inside the video stream, in a separate track (QuickTime/MP4 CEA-608 track, MXF SMPTE ST 436 track) or in a sidecar file (SCC, MCC).
Captions in the SDK
Each frame carries the captions that belong to it as binary frame data:
| Key | Content |
|---|---|
C608 |
4 bytes: the CEA-608 byte pair of field 1 and of field 2, with parity bits |
C708 |
A CDP with the tag ccdp in front |
GA94 |
ATSC A/53 caption data with the tag GA94 in front |
A source sets the keys it has data for. Outputs build the form they need from what is on the frame:
-
SDI output sends the CDP from
C708; without it, the CDP is built fromGA94or fromC608. CEA-608 is taken fromC608or extracted from the CDP orGA94. -
File and stream writers with
embed_ccconvertGA94,C708orC608(in this order) into A/53 user data.
So a CEA-608-only source still produces a CDP, and a CEA-708 source still provides CEA-608 for older equipment. A CDP built from C608 carries CEA-608 data only. To add a native CEA-708 service converted from CC1 on a Blackmagic output, enable cc_output.convert_608_to_708 (see Configuring SDI devices).
The binary format of these keys and how to read them is described in Frame metadata: MFStrGet, MFStrSet, MFDataGet and MFDataSet.
Sources of captions
| Source | How captions are read |
|---|---|
| MPEG-2, H.264 video with A/53 captions (TS, PS, MP4, MOV, MXF and others) | Automatically |
| QuickTime/MP4 with a CEA-608 track | Automatically |
| MXF with a SMPTE ST 436 track holding CDPs | Automatically (see SMPTE ST 436 ancillary data in MXF files) |
| SCC, MCC or SDK ANC sidecar file next to the video | Automatically, or set with force_cc_file (see Closed captions in SCC, MCC and ANC sidecar files) |
| SRT and ASS subtitle tracks | Converted to CEA-608 text in C608 when the track is selected with subtitle_track
|
| SDI input | After enabling caption capture (see Configuring SDI devices) |
| Your code | Set C608/C708/GA94 on each frame (see Generating CEA-608 captions in code) |
To see where the captions of an opened file come from, read info::cc_type of MFReader (file::info::cc_type of MFile), for example file(SCC), CDP(C708).
Outputs of captions
| Output | What to do |
|---|---|
| SDI (Blackmagic, AJA, DELTACAST, Bluefish444) | Captions on the frame are sent by default. See Configuring SDI devices. |
| MPEG-2 or H.264 video in files and network streams | Enable embed_cc (see Embedding, replacing and removing captions in files and streams) |
| SCC and ANC sidecar files | Written by MFWriter and MWriter (see Closed captions in SCC, MCC and ANC sidecar files) |
| MXF SMPTE ST 436 track | As CDP packets in ANC.Line.N with mxf.anc_write
|
| Preview | MCCDisplay draws captions over the video (see Previewing captions and subtitles with MCCDisplay) |
Supported hardware
| CEA-608 on line 21 (NTSC) | CEA-608 / CEA-708 in ANC (SD and HD) | |
|---|---|---|
| Blackmagic Design, input | yes | yes |
| Blackmagic Design, output | yes | yes |
| AJA, input | yes | yes |
| AJA, output | yes | yes |
| DELTACAST, input and output | — | yes |
| Bluefish444, input | yes | yes |
| Bluefish444, output | — | yes |
SMPTE ST 2110-40 (ancillary data over IP) is not supported.
Licensing
Captions require a license with the Closed Captions option. Without it, caption data is removed from frames and is not output.
Still have questions?
Tell us what didn’t work or what you’d like clarified.