H. BY
H. BY

Reputation: 21

NAL Type STAP-A and retrieve the sps and pps

I wrote a RTP server to receive the RTP packets which are sent by command ffmpeg -i test.mp4 rtp rtp://ip:port (client) and the server could get the nal type 24 (STAP-A). And I want to use the server to retrieve the spa and pps from the first nal(type 24) instead of info from ffmpeg command. Is it possible SPS and PPS would be aggregated in one nal ?

for example

[RTP header][nal header(type 24)][nal1 header][nal1 size][nal1 payload][nal2 header][nal2 size][nal2 payload]...

thanks

Upvotes: 2

Views: 1291

Answers (1)

Ralf
Ralf

Reputation: 9573

It's highly likely that the STAP-A consists of the SPS and PPS: these NAL units are usually at the beginning of the stream, small and can be aggregated into a STAP A. If the IDR is small enough, it might also be part of the STAP, but usually this is to big and will be sent separately.

The best thing to verify this is to split the STAP-A into the original NAL units (See RFC6184) and check for types 7 (SPS) and 8 (PPS).

Upvotes: 2

Related Questions