watson / rtsp-stream

A transport agnostic RTSP serial multiplexer module for Node
MIT License
91 stars 28 forks source link

Update decoder.js to filter out any RTP packets #7

Open slyoldfox opened 2 weeks ago

slyoldfox commented 2 weeks ago

All credit to @savageautomate which created this commit

While using this library with the Live555Proxy server (http://www.live555.com/proxyServer/) I was getting a few random TCP interleaved RTP packets in the data stream when more than one RTCP client was attached to a RTSP streaming endpoint which would cause decoder exceptions to get thrown due to invalid response lines.

This change attempts to filter out all RTP packets from the header buffer prior to creating the IncomingMessage object inside the Decoder.prototype._writeHead() method.

slyoldfox commented 2 weeks ago

Published this change as https://www.npmjs.com/package/@slyoldfox/rtsp-stream version 1.0.1 and added it to https://github.com/chriswiggins/rtsp-streaming-server where I was adding interleaved support.

This seems to fix exceptions during TEARDOWN when interleaved tcp is used.

Hoping you consider bumping rtsp-stream and rtsp-server for this?