video-streamingrtplive-video

Can RTP be used for streaming few video streams concurrently?


I have few video sources (2 cameras) and i need to send both live video streams to the client (over RTP or any other suitable protocol). The main requirement is that both streams should be synchronized (that's why i can't use 2 RTP sessions). Is it possible with RTP? Any other considerations?


Solution

  • As far as I know, there is no standard for sending multiple streams over RTP ("multiple participants" in RTP lingo) as of today, but there is ongoing standardization work on that. Note that various extensions were proposed for as long as RTP had been around. It seems, however, that this draft has real chances to reach the standard status. The draft has reached version 6, and was updated less than a month ago.

    The 12th revision of the Internet draft mentioned above has been adopted in January 2021 by the IESG as the Standard Track document RFC8108, “Sending Multiple RTP Streams in a Single RTP Session.” Thus, now there is an Internet Standard defining multiple RTP streams within a session. This does not invalidate the rest of the answer; MPEG-TS is still an option compatible with RTP, to the best of my understanding.


    There are also multiple transport (or container) formats that can be wrapped into RTP and carry multiple streams inside them. This is how simultaneous audio and video are commonly sent over RTP. A widely-used transport protocol, commonly referred to as MPEG-TS and often (but incorrectly) simply as as MPEG-2, is defined in MPEG-2 part I.

    But speaking practically, "can" or "cannot" RTP be used for multiple streams depends on what you are really trying to achieve. If you control both communicating devices, then use any packaging of multiple streams into RTP payload you can only think of (although adhering to a standard, even if a draft one, is not a bad thing). But if you are thinking about interoperability with other system, then you are likely out in the cold, sorry.