From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 8A65744F8E for ; Sat, 11 Feb 2023 16:39:04 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8F11868BC63; Sat, 11 Feb 2023 18:39:03 +0200 (EET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BFD5A68B5DA for ; Sat, 11 Feb 2023 18:38:56 +0200 (EET) Received: by mail-pl1-f173.google.com with SMTP id k13so9701408plg.0 for ; Sat, 11 Feb 2023 08:38:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=K1am2YRrAezKJbFu+mcwcuJEcemTK5grW6NTonEy8oQ=; b=M7FtLKofUDjLKV4+eU0OJuBLbri+rBjCZy9NGIqKAfSOE6vfYO5jH8Nz6fgmO3gQWD B7L7oSuryyAlRlO2HPWeWb2iOCifPWAZaKmLcRs5uuHAyvJp1XXyNuDCReva9WH/qaGT urmoaFO9UyuPWUD5WmoX+N4NCkcn5MJLh645FaYBy6CiIS28d9oaxFDrduXM0htBQpV3 i1lsiQCRLHMoc1nPnthGF6st8BdJCjZyfP1qg3Wsyp9yZ/LrVHmLaQEqFSoemv8yFwvF lTkl2pBLsmteZfbu634eMkLTz/cggXgF9k41gfAw+ldmLki+yPvwLiA6cgUglXZ9Zgs3 rC/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=K1am2YRrAezKJbFu+mcwcuJEcemTK5grW6NTonEy8oQ=; b=ZmoCgJmgva2rQsokIgKo1Kbjl0PXv1igqW0OiVwfbRZw8VsdAjwaBvj9EPtuWKqSJe SSFwBAo5r4zkgAQwLLRgSxfuSs8A0IeJ600hA9Xj437kj5s7tiqV7cYDbVCWifBiWnwh ozIClg/YS23YDS4Rg+D/Co5kpLymvq3kI8FQbBxL7Jr2FY6CF12UGvPzEVhv0GZ/RBEg BZqZx8glMDmZ+PbhfGRytO9VudBs7qx407f5VltiZ/Rff/XAxWVA8lMmwT82ahMLMqaV J9DNkSYvKMth6B0EbmWfdjgQ1dVu1mauAPy7tTMIq0eaA5qWCemCZUNS/0SHLc7HGcY1 uCXA== X-Gm-Message-State: AO0yUKUpf29J/tQYno3OzPFl5Oa/aBEDHAmr6431ys7txs1roKrzu573 44qhKbZqAKoJK2VTEYYT7blZ9lFRvN1kmA2YOdkVpZ6DqFY= X-Google-Smtp-Source: AK7set/djFwg0Sx0TYhndxJfpUyZdvoudq74dYr9B8FLOncGiG5xbgVC+saVa/+8MTWgvS2R9J15wufjk4u+HvZoG9g= X-Received: by 2002:a17:90a:f990:b0:22c:3a1b:631c with SMTP id cq16-20020a17090af99000b0022c3a1b631cmr2801754pjb.54.1676133533916; Sat, 11 Feb 2023 08:38:53 -0800 (PST) MIME-Version: 1.0 References: <20230131124512.281726-1-jpcoiner@gmail.com> In-Reply-To: From: John Coiner Date: Sat, 11 Feb 2023 11:38:42 -0500 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] libavformat/mpegtsenc.c -- correctly re-emit extradata ahead of IDR pictures X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: cus@passwd.hu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, Feb 5, 2023 at 6:33 PM Marton Balint wrote: > Your code duplicates AUD-s if they are already present and sps is also > added: > > if original packet had > [AUD][IDR] > it will become > [AUD][SPS][PPS][AUD][IDR]. > > Regards, > Marton Hi Marton, You're right, this is not compliant. The H.264 spec (section 7.4.1.2.3) is clear about this, it says: - There should be at most one AUD per access unit - Each access unit should include a picture. (We can't produce a fake "access unit" to carry the SPS and PPS alone; that's not allowed.) - When AUD is present, it should be the first NAL in the access unit. (We can't just prepend SPS and PPS ahead of the AUD.) Perhaps you knew all this; I am just learning. :-) So if the original packet has [AUD][IDR], then we should produce [AUD][SPS][PPS][IDR]. And if the original packet has [SEI][AUD][IDR], then we should produce [AUD][SPS][PPS][SEI][IDR] -- chopping out the original AUD, and then inserting the prefix with the new AUD. Tests show x264 producing the [SEI][AUD][IDR] sequence, despite it being contrary to the spec's recommendation that AUD should be first. Does that seem like the correct handling? If so I'll post a v2 patch for it. Thanks again. John _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".