ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.35k stars 5.33k forks source link

RTMP: Support parse and convert HDR information. #3508

Closed winlinvip closed 1 year ago

winlinvip commented 1 year ago

In the new RTMP specification, the PacketType=PacketTypeMetadata is HDR, SRS need to parse it and convert to other formats. For example, MPEGTS or MP4 has its own specification.

Note that it should work good for RTMP clients, SRS will pass by it, because it's defined in video tags.

// VideoTagBody does not contain video data. VideoTagBody
 // instead contains an AMF encoded metadata. See Metadata Frame
 // section for an illustration of its usage. As an example, the metadata
 // can be HDR information. This is a good way to signal HDR
 // information. This also opens up future ways to express additional
 // metadata that is meant for the next video sequence.
 //
 // note: presence of PacketTypeMetadata means that FrameType
 // flags at the top of this table should be ignored
 4 = PacketTypeMetadata

See https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp-v1.pdf