[Live-devel] rtspTestClient consumes the first bytes of each packet? How to prevent?

Eric.Brandt at nikon.com Eric.Brandt at nikon.com
Thu May 30 14:08:57 PDT 2019


Hello,

I am streaming the test.264 file from live555 using the testOnDemandRTSPServer.
I am receiving it using testRTSPClient. This part works fine.

I have modified testRTSPClient with a custom Sink such that the 'afterGettingFrame' virtual function passes the contents of each fReceiveBuffer to libav/ffmpeg's av_parser_parse2() to parse the incoming data into packets, later to be submitted to avcodec_send_packet() and avcodec_receive_frame() pair to decode it. I can use this same av_parser_parse2()/avcodec_send_packet()/avcodec_receive_frame() to properly decode frames by supplying bytes to the parser directly from the test.264 file (using fopen()/fread()), so I know that part of the pipeline works if the incoming data is correct.

However, when supplying the fReceiveBuffer data from 'afterGettingFrame()', the av_parser_parse2() never finds a packet, because the testRTSPClient has consumed the 0x0001 header at the start of the h.264 packet. I have several questions, all of which center around how to properly decode data arriving through afterGettingFrame().


1.       Is there a way to prevent the testRTSPClient infrastructure from consuming that header byte so that I can supply it to the parser?

2.       If I should not use the av_parser_parse2() function to find packets, then how do I properly segment the data coming in via afterGettingFrame() into packets that I can supply to the avcodec_send_packet()/avcodec_receive_frame()?

3.       The sizes of the data received in fReceiveBuffer are clearly not entire frames...in fact the first few times the function is called the data sizes are 22, 4, 3017, 3081...   Why the small size callbacks every so often?

Any help you can provide generally on how to supply data being received by testRTSPClient to libav/ffmpeg decoder would be very much appreciated.

Thanks,
-Eric.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20190530/7d911f3e/attachment.htm>


More information about the live-devel mailing list