Re: [Sframe] Partial decodability and IDUs

Bernard Aboba <> Thu, 19 November 2020 23:23 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 3B7403A0E10 for <>; Thu, 19 Nov 2020 15:23:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id gUuwUYludwIZ for <>; Thu, 19 Nov 2020 15:22:59 -0800 (PST)
Received: from ( [IPv6:2a00:1450:4864:20::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id A9ADA3A0E0B for <>; Thu, 19 Nov 2020 15:22:58 -0800 (PST)
Received: by with SMTP id x9so8096991ljc.7 for <>; Thu, 19 Nov 2020 15:22:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GRf2Iz21NxVY5Iv5Y6MiKsaozcvRmPOPu3AutcbEJXA=; b=mk7JL/UkGxd3xbZesob+X4NZMjdHlInhk3/muYsRkWI6aRjhkLTSeoMqPuR+pEkO2t JVhqGQQAjgLcHNZyQHB2YUcbWEGs/ntaaEGaTutbeKLpAQSLC/SJUwAIyxaKTHp8zM7W CFve+GE2G77foeXKQy5/uo71klAj7gu68IlUm8hEkcMZCVdu+jg+BFx/eU5PYGcsr3Fj PGmsh0rlI0kJg16EhAdEPa8kSvkqeVlJKir21xOKZvlMCSSCaFc+N+GHyvL9DXJwRnXJ mvQLvpbjHQdiDsd3cLVCHrMeo3JiDmOL03zrM65GW/6LOh3uVShZI51qCMXEJ65w5pwK z5Wg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GRf2Iz21NxVY5Iv5Y6MiKsaozcvRmPOPu3AutcbEJXA=; b=OfSei+s1ndpckeeHGf8xBi1Wb69jm/hS54lHP7jXHUn3ET6ncTqlO+xld3MNmD03zx 7vTwc1J5/39+nGZX9PsaITNpD201NjEmsWTEuZtJ0qdPFoW3lZbwiovT+b+fBVcarzH5 980WS4Y/+YmeqANc6VR6CUFuwqcZumtst1H3iPNPrFWIUc1DROMIIQ4476lv+nnw3Zr/ BZRkoS6Wm59T9t7aQSUACfd4UbsSwIhl58ZnpJCjeIMKBKsXl0MKwkBjQplE7hObHzVn tTfusUhIjJ1VXpwPmKvTEQuYoe+4zvsX2zNfIN0DphvgAhFk+GhfEmd0REN6oEABzc7M FBEg==
X-Gm-Message-State: AOAM532j1VZSG0cwRzRe+h8Lzhnab9cG8nDsJ25ynp8nmnBhMt69P/Hv aHvEXbntb0t3eNkAYXXEAUjmTWvjPOB6uOS4QAs=
X-Google-Smtp-Source: ABdhPJwJEHdIfc3mu3C0xITIwdf2KwblMJ0Vgm6ycEjwkqdIyYdaZ2os+2TALlTn2TgOt9pCKdEI0n2nFFw6o2IK+ww=
X-Received: by 2002:a05:651c:1246:: with SMTP id h6mr7168949ljh.187.1605828176430; Thu, 19 Nov 2020 15:22:56 -0800 (PST)
MIME-Version: 1.0
References: <> <> <> <> <>
In-Reply-To: <>
From: Bernard Aboba <>
Date: Thu, 19 Nov 2020 15:22:46 -0800
Message-ID: <>
To: Sergio Garcia Murillo <>
Cc: Richard Barnes <>,
Content-Type: multipart/alternative; boundary="00000000000006cc2e05b47e0270"
Archived-At: <>
Subject: Re: [Sframe] Partial decodability and IDUs
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 19 Nov 2020 23:23:01 -0000

Sergio said:

"I am afraid that we end up another doing a per-codec packetizer, which
would be almost the same as just using current packetization formats and
explain how to use encrypted data with them. And all for a feature that we
are not current using in webrtc."

[BA] Some per-codec logic is required.  How else can the metadata be
obtained from the bitstream? But the question is whether it is *required*
to packetize IDUs separately, so they don't share fate.  I'd say this would
depend on the use case. If WebRTC didn't care enough about this to
implement it previously, why should SFrame make a difference?

On Thu, Nov 19, 2020 at 3:15 PM Sergio Garcia Murillo <> wrote:

> How to actually packetize the IDUs is not a big deal, you only need to
> have a start and end of IDU bits on the header and rely on increasing rtp
> cseq nums (i.e. no IDU interleaving), but at the end of the day someone
> will have to specify what an IDU in h264 means and what is its format (a
> group of nal units?).
> I am afraid that we end up another doing a per-codec packetizer, which
> would be almost the same as just using current packetization formats and
> explain how to use encrypted data with them. And all for a feature that we
> are not current using in webrtc.
> Best regards
> Sergio
> On 19/11/2020 23:54, Richard Barnes wrote:
> This may be too simplistic, but there's also a non-codec-specific approach
> here that occurs to me: Just have the SFrame header have a length field.
> I'm imagining a setup where we have the SFrame layer between the encode
> and packetization layers, and:
> - The encoding/decoding layer produces consumes each frame as a sequence
> of IDUs
> - The SFrame layer translates between IDUs and SFrame encrypted enits
> (SEUs? in any case, each SEU is an encrypted IDU)
> - The packetization / depacketization layer packs SEUs into packets
> The only thing you need to make that work is (1) a mechanism for the
> receiver to understand what chunks of the SEU sequence he has (e.g., fixing
> reordering), and (2) a way to unpack SEUs if there can be multiple in a
> packet.  It seems like (1) could mostly be a transport assumption.  For
> (2), you would just need something like a length field.
> As Sergio points out, there is a need for someone to know where the IDU
> boundaries are, either at the SFrame layer (if the input is a whole frame),
> or at the encode layer (if the encode-SFrame API can talk in terms of
> IDUs).  But especially in the latter case, this framework keeps the
> codec-specific stuff local to the encode layer, which is codec-specific in
> any case.
> There is some trade-off here, in that this framework doesn't expose any
> encoded information to the SFU.  But ISTM that if you want that
> functionality, then (a) you're going to have to have codec awareness
> sprinkled all through the stack and (b) you're going to have to be really
> careful designing the which-parts-to-encrypt scheme to avoid undermining
> your security guarantees.  So I'm generally inclined toward the cleaner
> abstraction here.
> --Richard
> On Thu, Nov 19, 2020 at 5:11 PM Sergio Garcia Murillo <
>> wrote:
>> You are right regarding that the SFrame layer does not need to know what
>> is feed in for encryption, but in order to be able to have a working end to
>> end solution for webrtc, someone will need to define what and how this IDUs
>> are generated and reassembled for each codec if we want to have
>> interoperable implementations in different devices.
>> That process is codec-dependant and I would require quite a lot of effort
>> (and also supporting it on the agnostic packetization), so I would prefer
>> to have strong arguments in favor of doing it.
>> On 19/11/2020 22:53, Justin Uberti wrote:
>> The encoder needs to be aware of any mechanism to generate IDUs (e.g.,
>> slices), and typically each of these IDUs will be handed up to the consumer
>> individually. So the SFRAME layer doesn't need to do any splitting, it just
>> knows that it should treat each IDU as something it needs to individually
>> SFRAME and packetize.
>> On Thu, Nov 19, 2020 at 1:40 PM Sergio Garcia Murillo <
>>> wrote:
>>> Hi all,
>>> As most of you already know, this morning I made a presentation in
>>> AVTCORE introducing the topic about the need to specify an agnostic video
>>> codec packetization format.
>>> I got an AP for creating an initial draft so it could be reviewed and
>>> accepted.
>>> However, there were two main concerns that we should address in this
>>> this group:
>>>    - Historically, avtcore has explicitly designed not to be payload
>>>    agnostic and  declined to standardized codec agnostic payload formats in
>>>    number of cases.  If that is to be changed, needs to be done deliberately.
>>>    - Need to define the "minimum decoding unit" or "independently
>>>    decodable unit", that SFrame will work with.
>>> Regarding the second one
>>>    - Full video frames (just use whatever is the encoder output)
>>>    - Spatial layer frames
>>>    - "independend decodable subframes" like h264 slices, vp8 partitions
>>>    or av1 tiles which allows partial decodability which is mainly aimed for
>>>    enhancing packet loss resilience.
>>> Spatial layer frames is the minimum we should target as if not it will
>>> just prevent SFUs for using SVC codecs. So the question is if we should go
>>> deeper and implement lower partitions of the frames or not.
>>> AFAIK, currently, libwertc does not support partial decodability and I
>>> personally haven't seen any practical usage of this in the RTC world (while
>>> it makes a lot of sense in streaming/broadcasting world), but would like to
>>> hear what is the view and experience of the other members of this group.
>>> Also note that if we are going to support them on SFrame this will require
>>> a greater effort because we will need to explicitly define how the frames
>>> must be split before being encrypted y SFrame for *each* possible video
>>> codec (h264,h265,vp8,vp9,av1,...).
>>> There was also the question about how/if we should support other codec
>>> features like DON/interleaved mode for h264, which I also think we should
>>> not support mainly because we are not currently using it on webrtc
>>> implementations.
>>> What do you think?
>>> Best regards
>>> Sergio
>>> --
>>> Sframe mailing list
>> --
>> Sframe mailing list
> --
> Sframe mailing list