I have been working for some time to understand a problem I am having where
packets being put into a data stream are being buffered up rather than sent
out immediately in an MPEGTS stream. I have gone into the code and found
what is causing the problem, but do not know if my solution to the issue is
a valid one or not and would like feedback. Looking in the mpegtsenc.c file
when a packet gets written to the MPEGTS file, if that packet is from a
CODEC_TYPE_VIDEO or CODEC_TYPE_SUBTITLE then the packet is immediately sent
out, however the subsequent code setup for audio packets handles my
CODEC_TYPE_DATA packet and buffers it until many have been received. I would
like my DATA packets to act like the video packets and be sent out right
away so have added a check to do so as shown in the following code snippet:

    if (st->codec->codec_type == CODEC_TYPE_SUBTITLE ||
        st->codec->codec_type == CODEC_TYPE_VIDEO ||
        st->codec->codec_type == CODEC_TYPE_DATA) {
        // for video and subtitle, write a single pes packet
        mpegts_write_pes(s, st, buf, size, pts, dts);
        av_free(data);
        return 0;
    }

 (the check for the CODEC_TYPE_DATA was added by me)

Is there a better way to do what I am trying here? If not is this something
that could be included into ffmpeg?

Thanks for your input,

Nathan
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to