Many times, downloading and saving a stream locally is not an option. For example if the stream is a live stream. If you need to extract frames from a stream like this, you need to do it on-the-fly.
A good tool for dumping media content streamed over rtmp is rtmpdump and a good tool for extracting frames from a video is ffmpeg. Luckily for us those two can be piped together, since rtmpdump by default dumps the streamed media content to standard output and ffmpeg provides the option to read the input from a pipe.
To extract one frame per second from a stream try something like this:
rtmpdump -r <rtmp_video_url> | ffmpeg -i pipe:0 -r 1 frame%05d.jpg