Agora SEI information
By default, Agora adds the encoding information of the current video to the transcoded H264/H265 SEI (Supplemental Enhancement Information) during Media Push. The encoding information is a JSON string. The following is the sample code:
The definition of the parameters:
Parameter | Description |
---|---|
canvas | The canvas information. It contains the following properties:
|
regions | The layout information of the host. It corresponds to the transcodingUsers member in the LiveTranscoding class. It contains the following properties:
|
ver | The version of the SEI protocol. The current version is 20190611. |
ts | Timestamp (ms) of the current encoding information. |
app_data | Extra user-defined information. It corresponds to the transcodingExtraInfo member in the LiveTranscoding class. |
The structure of SEI
The SEI information is as follows:
In which:
06
: The SEI frame.64
: The SEI frame type defined by the user. Here we define it as 100.bd
: The length of the SEI frame. The following are some sample calculations rendered in decimal and hexadecimal:- If the length is 922, because 922 can be divided by 255 (
0xff
) three times and the remainder is 157 (0x9d
), thenbd
isffffff9d
. - If the length is 572, because 572 can be divided by 255 (
0xff
) two times and the remainder is 62 (0x3e
), thenbd
isffff3e
. - If the length is 234, because 234 divided by 255 (
0xff
) gives 0 and the remainder is 234 (0xea
), thenbd
isea
.
- If the length is 922, because 922 can be divided by 255 (
- Other digits: Content of the SEI frame.
FAQ
Q: If I use the SEI frame in Media Push, is it necessary to use the signaling system to send the layout information? Do I use either signaling or SEI?
A: Adding the H264/H265 SEI information to the video stream during Media Push is different from sending the uplink data. Only the app_data
parameter of the SEI information relates to the uplink data.
Q: Does the signaling system send the layout information? Why does the SEI frame contain the layout information?
A: Agora puts the layout information in the SEI frame because the audience members in the LIVE_BROADCASTING
profile also need the layout information of the current stream to set the window region of the hosts.