From a quick search through RFC 6185, it seems like the sprop-parameter-sets
parameter probably has the SPS frames.
Update:
iex(3)> String.split(str, ",")
["Z2QAKaw0yAeAIn5cBbgICAoAAAfSAAHUwdDAAB8/6AAAfP+Fd5caGAAD5/0AAA+f8K7y4b6g",
"aO48MA=="]
iex(4)> String.split(str, ",") |> Enum.map(&Base.decode64!/1)
[
<<103, 100, 0, 41, 172, 52, 200, 7, 128, 34, 126, 92, 5, 184, 8, 8, 10, 0, 0,
7, 210, 0, 1, 212, 193, 208, 192, 0, 31, 63, 232, 0, 0, 124, 255, 133, 119,
151, 26, 24, 0, 3, 231, 253, 0, 0, 15, 159, 240, ...>>,
<<104, 238, 60, 48>>
]
iex(5)> [a, b] = String.split(str, ",") |> Enum.map(&Base.decode64!/1)
[
<<103, 100, 0, 41, 172, 52, 200, 7, 128, 34, 126, 92, 5, 184, 8, 8, 10, 0, 0,
7, 210, 0, 1, 212, 193, 208, 192, 0, 31, 63, 232, 0, 0, 124, 255, 133, 119,
151, 26, 24, 0, 3, 231, 253, 0, 0, 15, 159, 240, ...>>,
<<104, 238, 60, 48>>
]
iex(6)> NAL.Header.parse_unit_header(a)
{:ok,
{%Membrane.Element.RTP.H264.NAL.Header{nal_ref_idc: 3, type: 7},
<<100, 0, 41, 172, 52, 200, 7, 128, 34, 126, 92, 5, 184, 8, 8, 10, 0, 0, 7,
210, 0, 1, 212, 193, 208, 192, 0, 31, 63, 232, 0, 0, 124, 255, 133, 119,
151, 26, 24, 0, 3, 231, 253, 0, 0, 15, ...>>}}
iex(7)> NAL.Header.parse_unit_header(b)
{:ok,
{%Membrane.Element.RTP.H264.NAL.Header{nal_ref_idc: 3, type: 8},
<<238, 60, 48>>}}
iex(8)> {:ok, {header, _}} = NAL.Header.parse_unit_header(a)
{:ok,
{%Membrane.Element.RTP.H264.NAL.Header{nal_ref_idc: 3, type: 7},
<<100, 0, 41, 172, 52, 200, 7, 128, 34, 126, 92, 5, 184, 8, 8, 10, 0, 0, 7,
210, 0, 1, 212, 193, 208, 192, 0, 31, 63, 232, 0, 0, 124, 255, 133, 119,
151, 26, 24, 0, 3, 231, 253, 0, 0, 15, ...>>}}
iex(9)> NAL.Header.decode_type(header)
:single_nalu
iex(10)>
i decoded the data in this parameter and it seems to contain h264 data. I think if this data is sent to ffmpeg before the other data, the stream would work.
@mat-hek is there a way that a source can “skip” stages? This data needs to skip the rtp decoding and jump straight to the h264 depayloader before the stream is started