[Live-devel] Demux live MPEGTS multicast stream and feed it to RTSP server

Thorson, Joshua C joshua.thorson at gatech.edu
Mon Mar 22 10:05:13 PDT 2021


> > I removed the MPEG2TransportStreamFramer and was getting the same results as with the MPEG2TransportStreamFramer; a .h264 file with about 100kb of data.
>
> I assume that this is bad - i.e., you expected to see more data than this.

Correct, its a live feed so I epxect the video data to be consistently written to the file.

> If you haven’t done so already, then - as a sanity check - try doing
>          MPEGTS Multicast Stream -----> BasicUDPSource ----> FileSink
> i.e., without any demultiplexing of the Transport Stream, to see if you then get all of the data that you expect.

I tried this and everything worked as expected - I was able to play the resulting TS file.

> > I added in the MPEG2TransportStreamAccumulator with the default max packet size of 1456, however that seemed to produce the same as above; a .h264 file with about 100kb of data.
>
> Try again with a larger “maxPacketSize” parameter in the call to "MPEG2TransportStreamAccumulator::createNew()” - e.g., 10000.

Tried it with a larger packet size but it was still producing the same output.


> > I built liveMedia with the DEBUG_CONTENTS flag to see if anything stood out while parsing the Transport Stream and it looks like it eventually just stops parsing and the BasicUDPSource receive buffer gets filled up causing the socket read to throw an error. Maybe the buffer filled up first causing the BasicUDPSource to not notify its downstream client?
>
> LIVE555 data chains work using the ‘pull’ model: The downstream object that requests data from the upstream object.  So, in this case, the “MPEG2TransportStreamDemux” is (when it needs data) requesting data from the “MPEG2TransportStreamAccumulator”, which in turn is requesting data from the “BasicUDPSource”.
>
> The reason why I suggested adding in a “MPEG2TransportStreamAccumulator” is that I suspected that the problem might be that - in this case - the “MPEG2TransportStreamDemux” is not being fed by a byte stream.  But if that’s not working for you, then I’m not sure what to suggest, unfortunately...


I've done some more testing and have seen some promising results:

I used the suggested pipline:
    MPEGTS Multicast Stream -----> BasicUDPSource ----> FileSink
but I have it write to stdout instead of a file. I then pipe this into testMPEG2TransportSplitter like:

   basicUDPtostdout | testMPEG2TransportSplitter

This works just as I would expect it to, dumping out the live h264 video stream into its own file. So now the question is why doesn't using the BasicUDPSource as a FramedSource work with the MPEG2TransportStreamDemux. The only thing I can think of is that it has to do with the buffer of the UDP source getting filled up.

Any ideas?


Thank you,

Josh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20210322/696d39a5/attachment.htm>


More information about the live-devel mailing list