[Live-devel] Receiving slice-based frames

Ross Finlayson finlayson at live555.com
Fri Feb 21 09:38:36 PST 2025



> On Feb 22, 2025, at 1:10 AM, d.gordenin at ngslab.ru wrote:
> 
> Hello
> 
> I need to receive slice-based frames from a video server. These frames, as you know come by slices. The last slice (packet) comes with Mark=True in the RTP header.
> 
>  I have a class which receives the frames:
> 
> class VideoSink final : public MediaSink {}
> 
> It has afterGettingFrame() method which gets the frames and works well for usual frames. After getting frames I save them in archive and later send them to a receiver. So, when I send them, I need to set the Mark flag to say the receiver what is it - a intermediate slice or a last slice or a usual frame. But I don't know nothing about the Mark, because I receive only video payload.
> 
> So, how to get this flag, or is there other method to know about which slice comes?

In general, it's the job of the decoder to figure out how to render the incoming NAL units - which includes deciding when a received slice is the last slice in a video frame.

However, as a hint, you can use the value of the RTP packet's 'M' (i.e., 'marker') bit, which is (supposed to be) set for the last RTP packet of an 'access unit' (i.e., video frame).  I.e., you can call "RTPSource::curPacketMarkerBit()" to test this.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list