agsh / rtsp-ffmpeg

Node.js FFMpeg wrapper for streaming RTSP into MotionJPEG
MIT License
249 stars 84 forks source link

Volatile messages #14

Closed insomnia-pt closed 7 years ago

insomnia-pt commented 7 years ago

I suggest a small change, case to a certain client is not ready to receive messages (network slowness or other issues)..

Use "volatile" messages: socket.volatile.emit('data', data.toString('base64'));

If the client doesn't receive all "frames", the application will not be affected.

Seikon commented 7 years ago

Hi @insomnia-pt Thank you for the sugestion, but the scope of this library is in TCP based context, so i think is not necesary to deal with volatile messages. Also RTPS provides sessions that controll the whole transmisson of packets. I have tested the examples with ip cams on slow network and it seems all frames are given to all clients perfectly, but if you noticed some anomaly releated with volatile messages, we change to volatile instead emit directly.