Active Format Description (AFD) tells downstream equipment which part of the picture holds the useful image, for example "16:9 picture letterboxed in a 4:3 frame". A receiver or an aspect-ratio converter uses it to crop or scale the picture correctly. In SDI, AFD travels as an ANC packet with DID 0x41 and SDID 0x05 (SMPTE ST 2016-3).
An AFD value has two parts:
- AFD code (4 bits) – where the active picture is;
- aspect ratio flag (1 bit) – the aspect ratio of the coded frame: 0 for 4:3, 1 for 16:9.
Common AFD codes
| Code | Binary | Meaning |
|---|---|---|
| 8 | 1000 | The active image fills the whole frame |
| 9 | 1001 | 4:3 image, centered (pillarbox in a 16:9 frame) |
| 10 | 1010 | 16:9 image, centered (letterbox in a 4:3 frame) |
| 11 | 1011 | 14:9 image, centered |
| 13 | 1101 | 4:3 image, safe to crop to 14:9 |
| 14 | 1110 | 16:9 image, safe to crop to 14:9 |
| 15 | 1111 | 16:9 image, safe to crop to 4:3 |
| 2, 3, 4 | 0010, 0011, 0100 | Box at the top: 16:9, 14:9; box wider than 16:9, centered |
Codes 1, 5, 6, 7 and 12 are reserved. The SDK does not send them.
Sending AFD on SDI output
AFD output is available on Blackmagic and Bluefish444 cards. It is on by default (output.afd_packets=true), but without settings the SDK sends AFD only for 16:9 SD frames.
Blackmagic Design
| Property | Default | What it does |
|---|---|---|
output.afd_packets |
true | Enables AFD output. |
output.afd_code |
-1 | AFD code to send on every frame, 0–15. -1: automatic, see below. |
output.afd_ar |
-1 | Aspect ratio flag: 0 (4:3) or 1 (16:9). -1: 1 for HD formats and for frames with a 16:9 aspect ratio, 0 otherwise. |
cc_line_sdi |
9 | Line on which the AFD packet is sent (the same line as captions). |
With output.afd_code=-1, AFD is sent only when the frame format is NTSC 16:9 or PAL 16:9: the code is 10 (16:9 letterbox) and the flag is 1. For other frames nothing is sent. To always send AFD, set a code:
// MFormats
renderer.PropsSet("output.afd_code", "8"); // full frame
renderer.PropsSet("output.afd_ar", "1"); // 16:9
// MPlatform, after DeviceSet
m_objRenderer.PropsSet("device::output.afd_code", "8");
m_objRenderer.PropsSet("device::output.afd_ar", "1");Set output.afd_packets to false to stop AFD output completely.
Bluefish444
With output.afd_packets=true (default), AFD code 10 with the 16:9 flag is sent for NTSC 16:9 and PAL 16:9 frames. No AFD is sent for other formats, and the code cannot be changed. To send another value, disable automatic AFD and send your own packet as shown below.
Passing AFD from input to output
A captured AFD packet is an ordinary ANC packet. Capture ANC (vanc.capture_anc on Blackmagic, always on for DELTACAST and Bluefish) and the packet arrives as ANC.Line.N with DID 65 and SDID 5. A renderer that outputs ANC.Line.N sends it again.
On Blackmagic, the renderer also copies an AFD packet of line N to line N+562, the second field of 1080i, unless the frame already has a packet for that line.
If the frame carries an AFD packet and the renderer adds its own AFD at the same time, two AFD packets are sent. Disable one of them: set output.afd_packets to false, or remove the AFD packet from the frame.
Sending your own AFD packet
To control AFD per frame, for example to change it when the program changes, send it as an ANC.Line.N packet. The payload is 8 bytes; the first byte holds the code and the flag:
static string AfdPacket(int afdCode, bool wide)
{
// Byte 0: bit 7 = 0, bits 6..3 = AFD code, bit 2 = aspect ratio flag, bits 1..0 = 0
byte b0 = (byte)((afdCode & 0x0F) << 3 | (wide ? 0x04 : 0x00));
// Bytes 1..7: reserved and bar data, all zero when no bars are signalled
return $"<packet DID='0x41' SDID='0x05'>{b0:X2}00000000000000</packet>";
}
// Full frame, 16:9, on line 11
frame.MFStrSet("ANC.Line.11", AfdPacket(8, true));Disable automatic AFD (output.afd_packets=false) so that the card does not add a second packet. The renderer must output ANC.Line.N packets; see the device table in Configuring SDI devices.
Limitations
- AFD is not decoded on input: read the packet from
ANC.Line.Nif you need its value. - AFD is not written into files, except as an ANC packet in the MXF ST 436 track (see SMPTE ST 436 ancillary data in MXF files).
- AJA and DELTACAST renderers do not generate AFD. DELTACAST sends an AFD packet that you put into
ANC.Line.N.
Still have questions?
Tell us what didn’t work or what you’d like clarified.