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

Chris Paucar chris.paucar at roc-connect.com
Thu May 30 14:30:38 PDT 2019


Hi Eric,

Regarding #3, those are the SPS and PPS NAL units, size 22 and 4
respectively. You can confirm by looking at the 5 lower bits of the first
byte and matching the NAL unit type with values 7 and 8 for SPS and PPS.

Some RTSP sources provide them in a separate stream while others embed them
together with the video stream, as it appears in your case. You can read
more about it in ISO 14496-10.

Thanks,
Chris

On Thu, May 30, 2019 at 5:16 PM <Eric.Brandt at nikon.com> wrote:

> 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.
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20190530/565fda75/attachment.htm>


More information about the live-devel mailing list