RTMP command messages (connect, createStream, publish, ...) and data
messages (@setDataFrame / onMetaData).
A command message is a sequence of AMF0 values: the command name, a
transaction id, a command object (or null), then command-specific
arguments. parse/2 decodes one into a RTMP.Commands.Command; the
builder functions return AMF0 payloads for the responses a server sends.
Message types 17 (AMF3 command) and 15 (AMF3 data) are accepted when their body is the common "format byte 0x00, then AMF0" layout some clients use. Real AMF3-encoded values are not supported.
The response shapes follow what Flash Media Server, nginx-rtmp and SRS send, since that's what OBS and FFmpeg are tested against.
Summary
Functions
_error rejecting a connect.
_result for a successful connect.
_result for createStream, carrying the new message stream id.
A bare _error for a command the server won't perform.
True for message type ids that carry commands (17, 20).
True for message type ids that carry data messages (15, 18).
onFCPublish, which some clients wait for after FCPublish.
onStatus on a message stream, e.g.
on_status("status", "NetStream.Publish.Start", "Publishing live.").
Decodes a command message payload (message type 17 or 20).
Decodes a data message payload (message type 15 or 18) into its name and
values, unwrapping @setDataFrame
A bare _result (used for releaseStream and FCPublish).
Functions
_error rejecting a connect.
_result for a successful connect.
@spec create_stream_result(number(), non_neg_integer()) :: binary()
_result for createStream, carrying the new message stream id.
A bare _error for a command the server won't perform.
True for message type ids that carry commands (17, 20).
True for message type ids that carry data messages (15, 18).
onFCPublish, which some clients wait for after FCPublish.
onStatus on a message stream, e.g.
on_status("status", "NetStream.Publish.Start", "Publishing live.").
@spec parse(byte(), binary()) :: {:ok, RTMP.Commands.Command.t()} | {:error, term()}
Decodes a command message payload (message type 17 or 20).
@spec parse_data(byte(), binary()) :: {:ok, binary(), [RTMP.AMF0.value()]} | {:error, term()}
Decodes a data message payload (message type 15 or 18) into its name and
values, unwrapping @setDataFrame:
@setDataFrame("onMetaData", {...}) -> {:ok, "onMetaData", [%{...}]}
onMetaData({...}) -> {:ok, "onMetaData", [%{...}]}
A bare _result (used for releaseStream and FCPublish).