What is RTP stream?
The Real-time Transport Protocol (RTP) is a network protocol for delivering audio and video over IP networks. RTP is used in communication and entertainment systems that involve streaming media, such as telephony, video teleconference applications including WebRTC, television services and web-based push-to-talk features.
RTP typically runs over User Datagram Protocol (UDP). RTP is used in conjunction with the RTP Control Protocol (RTCP). While RTP carries the media streams (e.g., audio and video), RTCP is used to monitor transmission statistics and quality of service (QoS) and aids synchronization of multiple streams. RTP is one of the technical foundations of Voice over IP and in this context is often used in conjunction with a signaling protocol such as the Session Initiation Protocol (SIP) which establishes connections across the network.
Out SDKs have two types of RTP streaming:
- "Clear" RTP - format = 'rtp' (requires an SDP file which will be created automatically when MFWriter instance starts. To define the file location, just add it into the MFWriter config string. Example: sdp='D:\Config.sdp'). Note, that "Clear" RTP is able to stream only video or audio simultaneously. So, you can't stream both the video and audio.
- MPEG2-TS over RTP - format = 'rtp_mpegts'.
"Clear" RTP via MFormats
An example of initializing RTP stream trough code:
m_objWriter.WriterSet("rtp://localhost:4000", 0, "format='rtp' video::codec='mpeg2video' video::b='5M' audio::codec='null'");
An example of initializing RTP stream via Sample File Writing -> "C:\Program Files (x86)\Medialooks\MFormats SDK\Samples\C#\Sample File Writing\bin\x64\Debug\Sample File Writing.exe"
MFWriter string configuration example:
format='rtp' video::codec='mpeg2video' video::b='5M' audio::codec='null'
URL textBox string example:
rtp://localhost:4000
MPEG2-TS over RTP via MFormats
MPEG2-TS over RTP is more flexible variant of a usual RTP stream. It supports more audio codecs in comparison with the regular RTP. An example of initializing MPEG2-TS over RTP stream trough code:
m_objWriter.WriterSet("rtp://localhost:4000", 0, " format='rtp_mpegts' video::codec='mpeg2video' video::b='5M' audio::codec='aac'");
An example of initializing MPEG2-TS over RTP stream via Sample File Writing -> "C:\Program Files (x86)\Medialooks\MFormats SDK\Samples\C#\Sample File Writing\bin\x64\Debug\Sample File Writing.exe"
MFWriter string configuration example:
format='rtp_mpegts' video::codec='mpeg2video' video::b='5M' audio::codec='aac'
URL textBox string example:
rtp://localhost:4000
Now, when a video source is being streamed, both of the streams can be easily received via third-side applications or the SDK-based applications. For instance, it can be received via VLC media player:
"Clear" RTP via MPlatforms
The principle of RTP stream initialization in MPlatform is exactly the same as in MFormats. An example of initializing RTP stream trough code:
m_objWriter.WriterNameSet("rtp://localhost:4000", "format='rtp' video::codec='mpeg2video' video::b='5M' audio::codec='null'");
m_objWriter.ObjectStart(pSource);
An example of initializing RTP stream via Writer Sample -> "C:\Program Files (x86)\Medialooks\MPlatform SDK\Samples Basic\C#\Writer Sample\bin\x64\Debug\Writer Sample.exe"
MWriter string configuration example:
format='rtp' video::codec='mpeg2video' video::b='5M' audio::codec='null'
URL textBox string example:
rtp://localhost:4000
MPEG2-TS over RTP via MPlatform
MPEG2-TS over RTP is more flexible variant of a usual RTP stream. It supports more audio codecs in comparison with the regular RTP. An example of initializing MPEG2-TS over RTP stream trough code:
m_objWriter.WriterNameSet("rtp://localhost:4000", " format='rtp_mpegts' video::codec='mpeg2video' video::b='5M' audio::codec='aac'");
m_objWriter.ObjectStart(pSource);
An example of initializing MPEG2-TS over RTP stream via Writer Sample -> ":\Program Files (x86)\Medialooks\MPlatform SDK\Samples Basic\C#\Writer Sample\bin\x64\Debug\Writer Sample.exe"
MWriter string configuration example:
format='rtp_mpegts' video::codec='mpeg2video' video::b='5M' audio::codec='aac'
URL textBox string example:
rtp://localhost:4000