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 ESMTPS id 2ADEB4BEC8 for ; Tue, 4 Feb 2025 12:32:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8C4A168B6D2; Tue, 4 Feb 2025 14:32:09 +0200 (EET) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7826568ABCA for ; Tue, 4 Feb 2025 14:32:03 +0200 (EET) Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6dd43aa1558so47834556d6.0 for ; Tue, 04 Feb 2025 04:32:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738672321; x=1739277121; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ByaP9IKphblpMejuVfQMTCcPKInyJBJiguJheXzTbyg=; b=Jk0TeX60NJoKc4kaCIWIqDehggsKLR3aq4JcEsMfNdcHUT0pkuuyoZpPXMBryG37wf 0QYl08PG+XBK8g5dsK0maUVdrEH8tci/asKxnPhBhwRBjMR+4W8Rtw/4vrl5P+yrwkEt 59qAK9Uq1u5YN6ZP0XNzBH0cct91G8DR7c06Fl6rqC+HsS67wFK5l7ZqbvB5ahmHgPot RZnQsHSrkAMPsrJqBFGIvKdLIN9nwPUpctpZORPfe7PvI/iUWoBteeQzNfofC447mVzM Z1h8TJ8bb0Uep6FgTFVbOU0rO2ZUZkb5TXGcWh/vGWg4qf5TlZQuUmGKXP/Sv7e1cCq4 pwpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738672321; x=1739277121; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ByaP9IKphblpMejuVfQMTCcPKInyJBJiguJheXzTbyg=; b=QMSOgMKnOA+wzn/TecPENw9K4c+pzEXTTdVxb38VsOdqHMTyZ1xXy7z/qv0jchF5IX p8T1jwLXaOGB6bGPnhPg9hVBQ5Wm886IGuU6dcV0vBq/97UI8HFWtbWgUZTFcLUMKg1z UngZUnCUIP558LiHtbmSYH0peCCqHPhW6mu6ACytyLeIw/q8ctZn7Q0ADoWTs22UkhVx P31HEYACKJOtRly04iPTlhisc8Z8sOmj1sjOiBTtfsLiPMi0jVU5WLC3byIySLQJccZt i8miDWyzoj2rSO6U+lLIvbJHCzWDrEN5BC7sV6kznkhs0CeW0z3pc/VbeHwd2irtH/tR Zh0Q== X-Gm-Message-State: AOJu0Yx8z0NidnuSCCVOTlSTvRgUbdgndaKBwyxZtoUqhoOpvR6+pUgT C6waem+GdPWkHjnf/9K0sUbAv8eFTakfYpzLC8QXsEvlOqIR6LSz+DxAmzyfCRaYoQ== X-Gm-Gg: ASbGncsbls6obksKI9+KOe5g10PeeBa5o5281AdmNlEuYBemyKvqBySa9firYkiBLvz 12JRIpl9DF+ld3e/aRTn+4CPXmOU+AM8eMbx5dCcWlnT9D1rBwBgH2TfcNs1nPiWr8iR6E/M1sO adjvSAlOchN67Nf+MR7H5OkVDpPC9ZVirv+C59/WxcGpi01ZP3MsFG5defeDDiBQhjN5QPkUV5m /lQDX4VUbbDFzZTUvEseWPaGeJV3+hrgQoezjDZCIHZkFQIvJNrdKq27pgDFiUTFoaXKyKE2ZMV AKcXRQUPCW31cBEiFaLHSf8GT0WgPzYYyX8Ng/eT6abKYtiJg8Fk6vKhB8ZglreNYMRZ1j0= X-Google-Smtp-Source: AGHT+IF7Ig6OQKx5FeXZDOxfdy4RLlZohET+T6u00nzVLIKZL8YxXYiHYZ8wqMpxgYu+A3BXT/6/cA== X-Received: by 2002:ad4:41c9:0:b0:6e4:2cfa:307d with SMTP id 6a1803df08f44-6e42cfa30acmr2570536d6.32.1738672321029; Tue, 04 Feb 2025 04:32:01 -0800 (PST) Received: from localhost.localdomain ([148.59.171.204]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e2547f2c78sm61366766d6.6.2025.02.04.04.31.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Feb 2025 04:32:00 -0800 (PST) From: Romain Beauxis To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Feb 2025 07:31:43 -0500 Message-Id: <20250204123145.53059-1-romain.beauxis@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 0/2] Properly decode ogg metadata in ogg/flac chained bitstreams 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: epirat07@gmail.com, Romain Beauxis 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: This is a series of 2 patches to allow proper decoding of ogg metadata in chained ogg/flac streams. ogg/flac streams are pretty important because there are perhaps the only combination of lossless audio codec and open-source container that allows for proper transmittion of lossless audio data accross systems such as Icecast, browser media tags and more. In the context of long-running audio streams, the ogg bitstream specs[1] have historically been very badly implemented. For each new track and/or each new metadata, the specs require the logical bitstream to come to a full EOS and then start with a full new logical stream. These specs have often been confused with a gobal EOS by most implementations. Furtunately, FFmpeg is a little better at that in that it is able to parsed subsequent chained logical ogg bitstreams and properly output either encoded ogg packets or decoded audio. Current limitations with chained ogg streams in FFmpeg include: * No adjustment underlying PTS or DTS * Chained bitstreams with more than one underlying type of content (audio+video, etc) is not yet supported though this is a much less needed feature. The purpose of the changes in this patch series is to also allow proper decoding of metadata associated with subsequent streams in chained ogg/flac bitstream. This is done by intercepting ogg packets with comments in the ogg flac demuxer, parsing the comment block and attaching it as packed AV_PKT_DATA_METADATA_UPDATE side-data. The new metadata can then be unpacked in the flac decoder and properly added to the first decoded audio frame after the comment packet. Along with the changes is a new FATE test validating the implementation. This solution keeps a proper separation of concerns: ogg packets are sill output by the demuxer (as shown in the test) but consumer of decoded data see decoded metadata in the decoded frames. It is worth noting that is using a mechanism specific to ogg stream that seemed to only have been used for vorbis streams so far. Follow-up work not addressed in this series of patch: * Ensure valid PTS in decoded frames of subsequent streams? * Generalize this approach to other chained ogg codec. Thanks, -- Romain [1]: https://xiph.org/ogg/doc/framing.html Romain Beauxis (2): libavformat/oggparseflac: Parse ogg/flac comments in new ogg packets, add them to ogg stream new_metadata. Add stream dump test with test for ogg/flac. libavcodec/flacdec.c | 20 ++- libavformat/oggparseflac.c | 28 +++++ tests/Makefile | 2 + tests/api/Makefile | 2 +- tests/api/api-dump-stream-meta-test.c | 169 ++++++++++++++++++++++++++ tests/fate/api.mak | 5 + tests/fate/ogg-flac.mak | 11 ++ 7 files changed, 235 insertions(+), 2 deletions(-) create mode 100644 tests/api/api-dump-stream-meta-test.c create mode 100644 tests/fate/ogg-flac.mak -- 2.39.5 (Apple Git-154) _______________________________________________ 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".