One audio or video frame, as delivered to RTMP.Handler.handle_frame/2.
Fields
:type—:audioor:video.:codec—:aacor:h264(parsed), or the FLV codec of a frame passed through unparsed (:mp3,:speex,:vp6, ...), or{:unknown, id}.:dts— decode timestamp in milliseconds: the RTMP message timestamp. 32-bit, wraps after about 49.7 days.:cts— composition time offset in milliseconds (video only;0for audio). The presentation timestamp isdts + cts— seepts/1.:keyframe?— video keyframe. Alwaysfalsefor audio.:sequence_header?— this frame is decoder configuration, not media: an AAC AudioSpecificConfig or an H.264 AVCDecoderConfigurationRecord. Encoders send one before the first media frame and again if the configuration changes.:parsed?— whether the codec payload was parsed.falsefor codecs that are passed through as-is.:data— the codec payload with the FLV tag header stripped:- AAC sequence header: the AudioSpecificConfig bytes.
- AAC frame: one raw AAC frame (no ADTS header).
- H.264 sequence header: the AVCDecoderConfigurationRecord bytes.
- H.264 frame: length-prefixed (AVCC) NAL units.
- Unparsed codecs: everything after the first FLV tag byte.
:config— for sequence headers, the parsed configuration (seeRTMP.FLV.AudioTagandRTMP.FLV.VideoTag). For unparsed audio, the FLV header's rate/size/channel fields. Otherwisenil.:nalus— H.264 frames only: the NAL units split out of:data, without their length prefixes.nilotherwise.:stream_id— the RTMP message stream id the frame arrived on.:payload— the complete RTMP message payload, which is exactly an FLV tag body. Write this verbatim when remuxing to FLV.
Binary fields are sub-binaries of the received message, so carrying both
:payload and :data (and :nalus) costs no extra copies.
Summary
Functions
Presentation timestamp in milliseconds: dts + cts.
Types
@type codec() :: :aac | :h264 | :pcm | :pcm_le | :adpcm | :mp3 | :mp3_8khz | :nellymoser | :nellymoser_8khz | :nellymoser_16khz | :g711_alaw | :g711_mulaw | :speex | :device_specific | :jpeg | :sorenson_h263 | :screen_video | :screen_video_v2 | :vp6 | :vp6_alpha | {:unknown, non_neg_integer()}