Use MFReader to read SCTE-104 messages stored in an MXF file's SMPTE ST 436 ANC data. The SDK recognizes ANC packets with DID 0x41 and SDID 0x07, parses supported messages, and attaches the resulting XML to the corresponding frame under the string key SCTE-104.
Read messages from frames
Open the MXF file with ReaderOpen, then check SCTE-104 on every frame in your normal frame loop. Messages may occur later in the file, so checking only the first frame is insufficient.
This C# snippet belongs inside that loop and assumes reader is an already opened IMFReader:
MFFrame frame = null;
string scte104 = null;
try
{
((IMFSource)reader).SourceFrameGet(10000000, out frame, "");
if (frame != null)
frame.MFStrGet("SCTE-104", out scte104);
}
finally
{
if (frame != null)
System.Runtime.InteropServices.Marshal.ReleaseComObject(frame);
}
if (!string.IsNullOrWhiteSpace(scte104))
{
Console.WriteLine(scte104);
}Process or save each non-empty XML string. Depending on the message type, its root element is single_operation_message or multiple_operation_message. After reading finishes, call ReaderClose and release the reader COM object owned by your application.
Multiple messages on one frame: SCTE-104 holds only the last successfully parsed message written to that frame. Each subsequent message written to the same key replaces its previous value. Checking every frame therefore does not guarantee extraction of every message when several messages reach one frame. To inspect the individual ANC packets, read ANC.Line.N for the relevant line numbers, as described below.
If no message is returned
- Check frames throughout the relevant part of the file. An empty value on one frame does not establish that the entire file contains no SCTE-104 messages.
- Confirm that the MXF file contains SMPTE ST 436 ANC data carrying SCTE-104 packets with DID 0x41 and SDID 0x07.
- Fragmented SCTE-104 messages are not supported by this parsing path. Messages that fail parsing are skipped.
For packet inspection, read ANC.Line.N with MFStrGet, replacing N with the actual ANC line number in the file. See Sending and receiving custom ANC data packets for the packet representation.
For general trigger handling and insertion, see SCTE-35 and SCTE-104 triggers.
Availability depends on the SDK build. Contact Medialooks Support to confirm that your installed build includes MXF SCTE-104 extraction.
Still have questions?
Tell us what didn’t work or what you’d like clarified.