TechTip - Closed Caption Verification and Debugging

Verifying closed caption insertion

You can easily verify that appropriate 608 /708 captions have been inserted in a stream by:

  1. Launching Expert-Caption
  2. Drag and drop your captioned MPEG file onto the File to Decode Edit Box
  3. Depress the View button.

The Decode window will open and the video will be displayed.  The 608 captions will be rendered over the video in the locations as defined by the CEA-608 specification.  You can enable the 708 captions to be rendered over the video by checking the Text Overlays | Closed Captioning | CEA-708 option.  (You may want to uncheck the CEA-608 option). Any CEA-708 captions encountered in the stream will be displayed in the locations as defined by the CEA-708 specification.

The Text Overlays | Closed Captioning | CEA-708 RAW TEXT displays all 708 text encountered in the stream as it is encountered regardless of the 708 control codes.  This is useful in cases where incorrect 708 control characters prevent the display.

The Text Overlays | Closed Captioning | Analog option converts the old “line 21” dashes on the analog line on the screen to CEA-608 and displays the 608 over the video.  The analog data can appear on any line of the video. You can select the line number that the analog captions appear on by entering the line number in the Configure | Fix Stream | Xcode Analog Captioning from line edit box.  The captions are not often on line 21.

Note: PixelTools MPEGRepairHD includes all the capabilities of Expert-Caption. The controls are located on the left-hand side of the MPEGRepairHD GUI.

Debugging missing captions

A file called Decode.log is created or overwritten in the folder containing the source video each time Expert-Caption is run. You can view this file in a text editor. Errors encountered in the captioning insertion (such as unable to find the associated .scc file) are printed in this file.  Every line of the caption .scc file will be printed listing the frame number where the captions start. A typical print out of correct caption insertion can appear in the decode log file as:

Process Next DDL Line :33

Next Parameter change read from DDL File Type: 0 at Hr:0  Mn:0  Sc:2  Fr:6

Which will be frame:66 at FrameRate 29.97 CurrentChangeFrame: 36

SccLength: 17 

When each pair of captions is actually inserted in the stream:

Stuff Hex Data Into Frame :36

Found Selected Decode Hex User Data FC: 9426  FD: 8080 Frame:36  (ActionFrame:

36  idx: 0) GOP Time Code: 0:0:0:28   PendingFrames:16

If you see lots of “Process Next DDL” messages, Expert-Caption has properly opened the .scc file and is reading through the file.  If you don’t see corresponding “Stuff Hex Data Into Frame” the time code in the .scc file may not correspond with the time codes in the .MPG file.

If you don’t seen any Process Next DDL message, Expert-Caption may not have found the .scc file in the folder where your source video is located.

Extracting the Raw Caption Data

If the log file indicates that the captions are being inserted but they are not being played back on the decoder, you can extract and analyze the user_data (that holds the captioning data) from the video stream by:.

  1. Launch Expert-Caption
  2. Drag and Drop your MPEG file under question onto the File to Decode edit box.
  3. Depress the St speed button at the top of the Interface to open the Statics window
  4. Check the View | Video Statistics | User Data menu item in the Statistics Window
  5. Depress the View button to start the decode.

The decoder log file should contain the user_data in each frame.:

user_data with no captions should appear as:
47 41 39 34 03 d4 ff fc 80 80 fd 80 80 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 ff 00 00

user_data with 608 and 708 captions should appear as:
47 41 39 34 03 d4 ff fc 94 26 fd 80 80 ff 4f 3a fe 99 38 fe e3 31 fe 72 1f fe 20 97 fe d5 15 fe 0c 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 ff 00 00

In the above example, fc 94 26 represents the 608 user_data for CC1 and CC3; fd 80 80 represents the NULL user_data for CC2 and CC4.

In the above example, the fe 99 38  fe e3 31 through the end of the line represents the 708 data.

So by studying the data patterns in the user_data, you can get an idea if 608 and/or 708 captions are present in the elementary video. 

If captions are present in user_data but not being displayed, you can try running the decode selecting various menu items in the Statistics window   Video Statistics | Digital Captioning | CEA Field1,  CEA Field2, CEA-708 ALL WINDOWS, or CEA-708 All Frames.  This may provide hints as to why the captions are not showing up in your decoder.

Interpreting user_data

Below is a typical print out of a frame of user_data that includes CEA-608 and CEA-708 captioning:

Pic User Data at offset:4947366 
Frame 197  LastGopFrameNumber: 197  temp_ref: 0
47 41 39 34 03 54 ff fc 97 a2 fd 80 80 ff c5 28 fe 74 20 fe 44 61 fe 6e 6e fe 79 3f fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 ff 00 00

The header 47 41 39 34 indicates that this is ATSC formatted data and the following 03 indicates that it is captioning data

fc 97 a2 fd 80 80  represents the two byte pairs of 608 data contained in the frame.
97 a2  is the byte pair formerly stored in line 21 and  80 80 (Null data) is the byte pair formerly stored in line 22 (the alternative caption channel often used for another language).

The 708 caption data follows the 608 data:
ff c5 28 fe 74 20 fe 44 61 fe 6e 6e fe 79 3f fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 fa 00 00 ff 00 00

The 708 data is inserted in triple data words.  The first word indicates if there is data present and the last two words are the data.

The first word of ff indicates the start of the 708 data
The word fe indicates that the 708 data continues in this packet.
The word fa indicates that there is no 708 data in this triple set.

So by reviewing the extracted user_data, you can see if there is captioning data present and what types. Most frames will show NULL 608 data (80 80) and NULL 708 data (00 00) as the captioning is often sparsely distributed in the user_data.

 

Let us know if we can help or request a free demo of our products. View our products features at a glance.

Visit our products page and check out at our PixelTools Store to purchase any of our products

MPEGRepairHD and Expert-HD are trademarks of PixelTools Corporation. All other brand names are trademarks or registered trademarks of their respected holders.


Thank you for your interest in PixelTools

 

| Contact Us

 
© 2023 PixelTools| Privacy Policy