Search code examples
videostreamh.264rtmpflv

Why SPS and PPS sents in different chunk stream id?


I'm working with RTMP. I need to write a program that captures RTMP packets, parse it and save RTMP video in flv container. For this purpose i need SPS and PPS which sent in the stream begin. But this data may sent in different streams. For examle:

  1. SPS and PPS sent in stream 6 and video data sent in stream 7.
  2. SPS,PPS and video data comes in stream 7.

How do I know which stream belongs to SPS and PPS if i have 3 video streams and only 1 stream which contain SPS and PPS?


Solution

  • "How do I know which stream belongs to SPS and PPS if i have 3 video streams and only 1 stream which contain SPS and PPS?"

    SPS and PPS are for the setting up the MPEG decoder only. Once it's setup to handle one stream, you can change to decoding other streams in file without a need for any new SPS & PPS.

    Unless the 3 streams are drastically different (ie: each with different picture size & own different frame rates, etc). In such a case then you would need new SPS & PPS.