From d.gordenin at ngslab.ru Fri Feb 21 04:10:23 2025 From: d.gordenin at ngslab.ru (d.gordenin at ngslab.ru) Date: Fri, 21 Feb 2025 15:10:23 +0300 Subject: [Live-devel] Receiving slice-based frames Message-ID: <56f2f601-7e47-451b-9241-647be4a15b18@ngslab.ru> 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? From finlayson at live555.com Fri Feb 21 09:38:36 2025 From: finlayson at live555.com (Ross Finlayson) Date: Sat, 22 Feb 2025 06:38:36 +1300 Subject: [Live-devel] Receiving slice-based frames In-Reply-To: <56f2f601-7e47-451b-9241-647be4a15b18@ngslab.ru> References: <56f2f601-7e47-451b-9241-647be4a15b18@ngslab.ru> Message-ID: > 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/