Update FTL Format authored by Nicolas Pope's avatar Nicolas Pope
...@@ -20,25 +20,25 @@ All subsequent data is MsgPack encoded. All subsequent data consists of a tuple ...@@ -20,25 +20,25 @@ All subsequent data is MsgPack encoded. All subsequent data consists of a tuple
struct StreamPacket { struct StreamPacket {
int64_t timestamp; int64_t timestamp;
uint8_t streamID; uint8_t streamID;
uint8_t channel_count; uint8_t frame_number;
ftl::codecs::Channel channel; ftl::codecs::Channel channel;
}; };
``` ```
A stream packet locates a data packet within the overall context. It identifies which stream it belongs to and which channel within that stream, along with a timestamp to position it. `channel_count` is used when indicating that multiple channels constitute a completed frame. This may be 0 if a packet does not need to be considered atomically a part of the complete frame. A stream packet locates a data packet within the overall context. It identifies which stream it belongs to and which channel within that stream, along with a timestamp to position it. `frame_number` is used as an initial offset in the event that multiple packets are required to represent all sources. It is normally 0 unless there are more than 9 cameras and the tiling mechanism exceeds hardware decoding limits.
```c++ ```c++
struct Packet { struct Packet {
ftl::codecs::codec_t codec; ftl::codecs::codec_t codec;
ftl::codecs::definition_t definition; ftl::codecs::definition_t definition;
uint8_t block_total; uint8_t frame_count;
uint8_t block_number; uint8_t bitrate;
uint8_t flags; uint8_t flags;
std::vector<uint8_t> data; std::vector<uint8_t> data;
}; };
``` ```
The packet structure provides details relevant to the encoding. `codec` is one of: JPG, PNG, H264, HEVC, JSON, MSGPACK, RAW and some others. `definition` identifies one of a predefined set of resolutions such as 1920x1080. `block_total` is the total number of packets that make up the current frame for the current channel in the current stream. Usually `block_total` is 1 unless a concurrent chunking encoder is used that then sends those chunks immediately. `block_number` is the sequence number for the current block and will always be 0 if `block_total` is 1. `flags` should be 0 or set to codec specific values. `data` contains the raw encoded data for the frame. The packet structure provides details relevant to the encoding. `codec` is one of: JPG, PNG, H264, HEVC, JSON, MSGPACK, RAW and some others. `definition` identifies one of a predefined set of resolutions such as 1920x1080. `frame_count` is the total number of frames contained, as tiles, within this packet. `bitrate` indicates the encoding quality, it is possible for the same channel to have multiple versions at different bitrates. A large number is a higher rate. `flags` should be 0 or set to codec specific values. `data` contains the raw encoded data for the frame.
### Version 0 ### Version 0
No longer valid. Did not have the 64 byte index header and had different packet structures. No longer valid. Did not have the 64 byte index header and had different packet structures.
... ...
......