[Live-devel] Demux live MPEGTS multicast stream and feed it to RTSP server
Ross Finlayson
finlayson at live555.com
Thu Mar 18 11:01:27 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.
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.
> > If that doesn’t work (i.e., you end up with an empty output file), then the problem might be that the UDP source is generating chunks of Transport Stream data that’s too small for “MPEG2TransportStreamDemux” to properly handle. Try the following instead:
> > MPEGTS Multicast Stream -----> BasicUDPSource ----> MPEG2TransportStreamAccumulator ----> MPEG2TransportStreamDemux
> > (You may need to add
> > #include “MPEG2TransportStreamAccumulator.hh”
> > to the start of your code to get the definition of the “MPEG2TransportStreamAccumulator” class.)
>
> 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.
> 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...
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list