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:
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?
"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.