Hi all.
Sorry, if some of you have seen already my similar message. I've posted it
to the other mailing list, but haven't received any feedback.

My program uses libav to read DVB stream (mpeg-ts) and store its parts in
mpeg-ps files according to the user-supplied schedule. 

I was using precompiled binaries but recently pulled the newest git
revision. 
I did this because precompiled binaries had limit of the number of streams
in AVFormatContext. 
Therefore, my program was able to process only 20 elementary streams from
the incoming dvb stream. 

However, I've started to get the problems, sometime my program stops
responding, begins to consume more and more memory, then OS kills it. 

I've found that sometimes incoming MPEG-2 TS stream contains a noise. 
And when the noise distorts the PID value in the incoming MPEG-2 TS packets,
libav sees the new PID value, adds the new entry to the input
AVFormatContext::streams array, stores this distorted packet in the
AVFormatContext::raw_packet_buffer and never gets this packet out of that
buffer. 

Also it falls in the infinite loop inside the av_read_packet() function. It
reads new data, but always gets the packet with the invalid PID from the
raw_packet_buffer and simply accumulates them without processing. 

How can I deal with it? 

Is it possible to make libav MPEG-TS demuxer to drop packets whose PIDs are
not listed in PAT/PMT instead of store it and hope that it will have this
stream in the future?

I also would like to discuss the fixes to the MPEG-TS demuxer. 
I've found a code, parsing the incoming stream and adding new entries to the
AVFormatContext::streams. 
I'm going to add a cycle, scanning other arrays in the MPEGTSContext in
order to find if this new PID is listed in the PAT/PMT  and decide whether
to add new AVFormatContext::streams entry.


--
View this message in context: 
http://libav-api.1054858.n5.nabble.com/Reading-MPEG-TS-from-noisy-data-drop-PIDs-not-in-PAT-PMT-tp4505473p4505473.html
Sent from the libav-api mailing list archive at Nabble.com.
_______________________________________________
libav-api mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-api

Reply via email to