FEC and retransmissions for video

Lauri Ehrenpreis lauri.ehrenpreis at starship.xyz
Fri May 18 17:44:33 UTC 2018


On Fri, May 18, 2018 at 4:57 PM, Mathieu Duponchelle <
mathieu at centricular.com> wrote:

>
> That's interesting, for context I was the one that upstreamed the ulpfec
> elements,
> but I didn't do the implementation, how can the fec decoder determine that?
>

I hope I am not mistaken since it's now only 2nd time I look at rfc5109:

8.1 <https://tools.ietf.org/html/rfc5109#section-8.1>.  Generation of
the FEC Header

...

      o Unsigned network-ordered 16-bit representation of the media
        packet length in bytes minus 12 (for the fixed RTP header),
        i.e., the sum of the lengths of all the following if present:
        the CSRC list, extension header, RTP payload, and RTP padding
        (16 bits)


So the length of original RTP packet is actually encoded into FEC packet
header. Now when we run recovery on
all the available FEC levels and the resulting packet has same length as
stated in FEC header, we know the full packet got recovered.


> I assume that this concern only exists when using faststart-min-packets,
> correct?
>

My concern is following: I want to decode all frames as soon as possible
since every millisecond of latency counts. Jitter doesn't
matter to me. I set jitterbuffer latency parameter to fairly large value
since in bad network case I don't want jitterbuffer to time
out easily when waiting for missing packet (and I also have RTX). Now if
the FEC recovery is only done after jitterbuffer times out then
I get the whole jitterbuffer latency worth of additional delay added in
cases where I actually had all the needed data available
inside FEC packet. However if I run FEC and recover packet before
jitterbuffer then jitterbuffer will not delay the frame at all.

--
LauriE


>
> --
> Mathieu Duponchelle · https://www.centricular.com
>
>
> --
> LauriE
>
> On Wed, May 16, 2018 at 3:43 PM, Mathieu Duponchelle <
> mathieu at centricular.com> wrote:
>
>> Hi Lauri,
>>
>>
>>
>> On 05/14/2018 02:53 PM, Lauri Ehrenpreis wrote:
>> > Hi!
>> >
>> > I tried to set up a pipeline which does both retransmissions and FEC
>> for video. My hope was that first pipeline will try to recover packet with
>> FEC and if that fails it will request retransmission. As there was no
>> working example for such setup I used gst-plugins-good/tests/examples/rtp/client-rtpaux.c
>> and gst-plugins-good/tests/examples/rtp/server-rtpaux.c as basis and
>> added request-fec-decoder & request-fec-encoder signal handlers there.
>> >
>> > After adding FEC handlers gstrtpbin came up with following pipeline on
>> client side (attached image). So retransmission component is before
>> jitterbuffer and FEC is after. Do I understand correctly the pipeline will
>> first try to request retransmission if packet is lost and only after the
>> retransmission did not deliver the packet in time for jitterbuffer, it will
>> try use FEC to recover packet? Why it is done this way - wouldn't it be
>> better to try FEC first?
>>
>> Yes, you are correct, FEC recovery will only be attempted once a packet
>> is actually
>> considered lost.
>>
>> While we could indeed reconstruct packets as soon as they are late, there
>> is no
>> guarantee that the reconstructed packet would be "complete", at least
>> with ULPFEC.
>>
>> As you might already know, ULP stands for "uneven level protection", and
>> works based
>> on the assumption that with most video codecs / payloaders, the most
>> important part
>> of a packet is at the start, which means that a percentage of protection
>> can be applied
>> at the packet level by only protecting the initial portion, possibly
>> making exceptions
>> for keyframe packets for example, which could be fully protected.
>>
>> This means that while we could reconstruct a packet, if retransmission
>> has been
>> enabled it makes sense to ask for that packet to be retransmitted anyway.
>>
>> I hope that made sense :)
>>
>> --
>> Mathieu Duponchelle · https://www.centricular.com
>>
>
>
>
> _______________________________________________
> gstreamer-devel mailing listgstreamer-devel at lists.freedesktop.orghttps://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180518/d8f0d83f/attachment.html>


More information about the gstreamer-devel mailing list