Here is a simple list of comparison for WebRTC vs. RTMP
RTMP is old technology. WebRTC is the newer technology.
Browser does not support RTMP which requires flash plugin to playback(so that it does not work on mobile at all). WebRTC is supported natively by browsers. No need to have any plugin.
RTMP latency is about 2–3 secs. WebRTC latency is less than 1 secs.
WebRTC is more complex than RTMP
There is a migration from RTMP solutions to WebRTC solutions.
There are solutions in the internet that supports RTMP, WebRTC as well. Here is a list of the items like Red5Pro, Wowza, Ant Media Server, Jitsi, etc.
The main value offered by RTMP is that throughout the streaming process a connection is maintained between the streaming server and the video player. This ensures smooth video streaming in spite of any fluctuations in bandwidth.
RTMP uses port 1935. The key differentiator between RTMP and Progressive Streaming services using HTTP is:
In RTMP there is a direct pointer from media server to flash player, and only data corresponding to that pointer is held by the flash player. There is no buffering/ storage of data on the computer
In progressive streaming a steady buffer is created, starting from point of playback
RTMP peaked in its popularity around 2012. Since then with the emergence of adaptive bitrate streaming, HTTP based streaming protocols have become much more popular. In adaptive bitrate streaming, each video stream comprises of multiple files at different resolutions which require different bitrates. A video player is sent the streaming file corresponding to its screen size and internet connection speed. This process ensures that if a viewer is initially viewing a high quality stream initially at high bandwidth, if the internet speed drops the video player would immediately switch to a lower resolution stream. One of the HTTP based protocols that does this efficiently is Apple’s video streaming protocol HLS.
Where RTMP server maintains a constant connection between media server and video player, progressive video players on HTTP rely on a buffer. This means that the video is initially downloaded, and it is this locally cached file that is played back. HTTP relies on this buffer to ensure smooth playback. However if the buffer load rate is slower than the playback rate then your stream will lag.
From point of view of security, RTMP Encrypted is somewhat flawed, as it is prone to Man-in-the-Middle Attacks. RTMP toolkit – RTMPDump can be used easily to download RTMP streams.
Hope this helps. For more info do check out this article that I’ve written on RTMP in relation to other streaming protocols.