Tech Tip - Stream Header Replacement

Easy to use tools for modifying streams


MPEGRepairHD can be used to modify stream headers including time code, aspect ratio, pan and scan, etc. and can insert Closed Captioning and CGMS flags all without decoding and re-encoding the original MPEG stream.

The closed captioning can be inserted in support of CEA-708 or CEA-608 specifications with wrappers defined in ATSC, SCTE20, or SCTE21.  Most systems require one or more of these specifications. PixelTools products can also emboss Open Captions (or subtitles) define in a .SCC or .CAP file into a video during captioning.  Closed Captions can be disabled or enabled by the user.  Open Captions are always “on” as they are part of the video.

PixelTools also provides analysis and verification tools that help you determine what kind(s) of captioning are in a MPEG video sample and to verify correct captioning time placement of captioning on your output product.


Header Update using the MPEGRepairHD GUI

The MPEGRepair decode section includes the ability to update stream headers without re-encoding.  The Decode | Configure | Fix Stream dialog controls the stream update process.

Selecting any of the above update options enables the associated option state and enables the Save Fixed File edit box.  Once you have selected the option(s) you wish to update, just select the new flag state that you wish to update in the stream, enter or browse the Save Fixed File that will save the original file including the new fixes, and depress the Decode Run button. Depressing the Monitor Disable button in the center of the tool bar menu will speed up the replacement process.

Stream header replacement using the WorkShop SDK

The Expert WorkShop SDK can be used update headers in existing MPEG file using the SDK’s decode section.  The decode fix options, analogous to the GUI options, are set in the ExpDecFix_str structure in VidDecodeParams_struc structure presented in the ExpDecodeConfigure API call.  Once the fixed items, fixed item states, and fixed output file name have been set, a sequence of calls to ExpDecodeNextFrame will cause the updated stream to be written to the fixed output file.



The Decode Fix operation can be used to set or clear the following flags:


The Decode Fix operation can be used to modify the following header options:

Pan and Scan frame size

The Decode Fix operation can be used to reset ALL of the time code stamps in the elementary GOP headers.  You can enter the time code of the first frame in the fix options and select the drop_frame option if needed.  The Decode Fix will calculate the appropriate time codes for all of the GOP headers and replace the existing time code with this newly calculated time code.

The Decode Fix can be use to add user_data containing CGMS and APS flags as extended user data.   This user data is added throughout the stream at 2 second intervals.

The Decode Fix can also be used to add Pan and Scan frame offsets at each frame and/or closed captioning data at selected frames. 

Refer to the MPEGRepairHD users manual or the Expert WorkShop SDK manual for additional details on the updateable headers.

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

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

Thank you for your interest in PixelTools


| Contact Us

© 2020 PixelTools| Privacy Policy | Site Map