The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Wumpus Video Protocol

Video data is sent with headers in this order of bytes:

  • 2 bytes: Magic number (0xFB42)

  • 2 bytes: Protocol version (this document specifies version 0x0001)

  • 2 bytes: Codec ID (h.264 = 0x0001, JPEG = 0x0002)

  • 4 bytes: Flags

  • 4 bytes: Payload length

  • 2 bytes: Width of video

  • 2 bytes: Height of video

  • 4 bytes: Adler32 checksum of payload

  • 4 bytes: Frame count of video

  • 6 bytes: Reserved for future use

This will be followed by the payload data.

Flags

The following bits are specified for the Flags field.

1 - Reserved for future use
2 - If 1, this frame is a keyframe. Codecs where every frame is effectively a keyframe (e.g. MJPEG) should always set this to 1.
3 - If 1, the frame count value has overflowed

Heartbeats

To ensure clients are still connected, the client should periodically send a Hearbeat packet. If the server does not see a heartbeat within a specified time period (e.g. every 1 minute), it may terminate the connection. Clients should send Heartbeats much more often than that (say every 10 seconds).

The Heartbeat is also sent to initiate a connection.

The Heartbeat packet is structured as the following:

  • 2 bytes: Magic number (0xFB42)

  • 14 bytes: All zeros (reserved for future use)