Tech Tips - CGMS and APS Flag Insertion

Overview

PixelTools products can add CGMS and APS copy protection flags during encoding or to an existing stream without re-encoding.

CGMS and APS flags, embedded in an MPEG stream, instruct recording equipment whether to permit copying of the MPEG or not.

These flags are inserted in the MPEG elementary user data.

Demo of CGMS flags

Download the CGMSDemo.zip file to obtain a demo of MPEGRepair that adds CGMS data while encoding or to an existing stream. Just unzip the zip file and run the CGMSDemo.bat file to launch the demo.   The MPEGRepairHD will encode a sort frame sequence and add the GCMS copy once flag and the APS Type 2 flags at appropriate intervals during encoding.  You can verify these flags using the Decode Section of MPEGRepairHD by depressing the St (Statistics window) speed button and selecting the Video | Video Statistics | User Data option during decoding.

 

Adding copy flags via MPEGRepairHD GUIencoding example

During Encoding
To enable the addition of CGMS and APS data while encoding a file, depress the Optimize Encode | Configure |  Line 21 tab.  Check the Add XDS Flags option.  Then select the appropriate CGMS flag option: Copy Freely, Copy Once, or Copy never.  Select the appropriate APS flag: off, Type 1, Type 2, or Type 3.  Depress the Apply button. Click on image to see full screen.

During encoding of your source video, your selected flags will be added to the elementary stream at appropriate intervals.

 

Add to an existing stream
To enable the addition of CGMS and APS to an existing file, depress the Decode Function Enable | Configure |  Fix Stream tab.  Check the Insert XDS flags.  Then select the appropriate CGMS flag option: Copy Freely, Copy Once, or Copy never.  Select the appropriate APS flag: off, Type 1, Type 2, or Type 3.  Enter or Browse the resultant file (containing the flags) in the Save Fixed File edit box. Depress the Apply and OK button.

Select the elementary MPEG file you wish to add the flags to in the MPEG File to Decode or Analyze Edit box using the Browse button. Depress the Control Decode | Run process to start the insertion process.  You can speed up the insertion process by depressing the Speed Button with the line through the monitor to turn off the display during encoding. Click on image to see full screen.

 

Adding copy flags via Expert Workshop® SDK

During Encoding
To enable the addition of CGMS and APS data while encoding a file, set the appropriate CGMS and APS values in the XdsCGMS and XdsAPS members of the Line21Params_struc. ( ptool_XDS_CGMS_Type and  ptool_XDS_APS_Type enumerate the values.) The Line21Params_struc structure is part of the ExpEncParameters_str that is used in the ExpEncodeConfigure API call.  This set up will cause the CGMS and APS data to be added as user_data at appropriate intervals during the encoding.

Add to an existing stream
To enable the addition of CGMS and APS data to an existing MPEG file, set the appropriate CGMS and APS values in the XdsCGMS and XdsAPS members of the ExpDecFix_str. ( ptool_XDS_CGMS_Type and  ptool_XDS_APS_Type enumerate the values.) Add the name of the resultant output file to the DecodeFixName member of the ExpDecFix_str. The ExpDecFix_str  is part of the VidDecodeParams_struc which is used in the ExpDecodeConfigure API call.  While decoding an MPEG elementary file, the files contents are copied to the DecodeFixName file and user_data with selected CGMS and APS values are added at appropriate intervals.

Specification

The CGMS and APS flags are added to the MPEG video user data as Extended Data in the line 21 emulation of digital data as specified in the ATSC A53 Digital Television, ANSI/SCTE 21 2001, and CEA 608 Standard specifications.

Supplemental Information

PixelTools line 21 support
At the lowest level, MPEGRepairHD is capable of adding frame accurate user_data during MPEG encoding or to an already existing video elementary stream.  This will support all of the data services provided that the data is packaged in the correct format. MPEGRepairHD can add up to 128 eight bit data bytes to designated frames during encoding using an Encoding Decision List (EDL) file or to an existing MPEG stream using a Decoding Decision List (DDL) file.  These text files specify the frame number and corresponding data bytes which will be inserted in the user_data at the selected picture header.  The data bytes must be formatted appropriately per the desired usage. The encoding EDL and the decoding DDL files utilize the identical format.

At a higher level, MPEGRepairHD can add the CGMS and APS beacons periodically throughout a stream during encoding or to an existing stream.  MPEGRepairHD includes an Encode | Configure | Line 21 Data dialog that allows you to specify the CGMS and APS flags that will be added during encoding at the proper intervals.  MPEGRepairHD also includes options in the Decode | Configure | Fix Stream dialog that enable you to specify the CGMS and APS flags that will be added to an existing MPEG stream at proper intervals.

 

MPEGRepairHD and ExpertWorkshop SDK are trademarks of PixelTools Corporation. All other brand names are trademarks or registered trademarks of their respected holders

©1998-2008 PixelTools Corporation