RTMP is a tricky one. By Adobe's licensing agreement you can NOT implement RTMP streaming from any application that also supports a Record function.
This is straight from Adobe's user license agreement (RTMP Specification License Copyright © 2003−2009 Adobe Systems Incorporated. All rights reserved. Published April 2009):
https://wwwimages2.adobe.com/content/da ... se_1.0.pdf
Prohibited Uses The rights and licenses granted by Adobe in the RTMP Specification, including those granted in the Patent License, are conditioned upon Your agreement to use the RTMP Specification for only streaming video, audio and/or data content and not to make, have made, use, sell, offer to sell, import or distribute: (i) any technology that intercepts streaming video, audio and/or data content for storage in any device or medium; or (ii) any technology that circumvents technological measures for the protection of audio, video and/or data content, including any of Adobe’s secure RTMP measures. No right or license to any Adobe intellectual property is granted for such prohibited uses.
SRT would probably be a more viable option for what you're looking to achieve at the moment since there are less restrictions on using it.