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 E42FF46B2A for ; Mon, 3 Jul 2023 17:17:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D572568C580; Mon, 3 Jul 2023 20:17:30 +0300 (EEST) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 02A0168C56F for ; Mon, 3 Jul 2023 20:17:21 +0300 (EEST) Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-4031dacaacaso42570931cf.0 for ; Mon, 03 Jul 2023 10:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ltnglobal-com.20221208.gappssmtp.com; s=20221208; t=1688404639; x=1690996639; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=Gk/20FRwoSqA2OcckKHMaqlssBDt1v/pcD/K7zhDzQk=; b=5jNo2qg7xzKlEeZhNoGF8C0p2WSmHwokvc5JqR+zESzdMOd4I5ZRpCSCn9xMek7+2k KPkcGPtUKs+L06/LNZBdGAvbmz29vpBbD+tplWZqPcmhQDh2fbitHQ6IF+UQ6rZ9Zafd YSLdPihdPPS1ZSdWCbxl4vYJl09UvhTqrZlYfMNPbUyiswPkczolT05NGtsrGb8bgzVT lTAx4+CjQj862u2J4TT4gN7j9p3t6Apxx8v/KQvuFC/Oj59skYQ3jb4KYPaumschSDzW L4pD/2EFY9mqMK+mquBWT5fpn16dwrh2dKcwCxeqzONr0mxc88Xft9ojiVOV/IFMJrs/ OjpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688404639; x=1690996639; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Gk/20FRwoSqA2OcckKHMaqlssBDt1v/pcD/K7zhDzQk=; b=k538DrQP5bujo5BbU8IDCru+x5Xfc76NzebMgOePX7/tCOFHUJ6J4jAdegpp+lcvSk pvlZUqOsgmeaypDDBn54/OsCGTkTjflIizIVbhnTpV85sT9XsLRmYw/mtS7oxhfRFHYy zTyWL+tO827bVUk55vd+L7HPP4BhQk2DcxrKFzXV2diVKZPoEXuPP58n+9Fg5yxDf+pb ZR8bb+j3y3QsG+xmxOjpZ+Eht0DkpQNfXyNXUg0Ew/1N8rKgajwx2cknt6HmIe8MRz6+ 50itDkIIXiw477voN+Z5mPqQUjCnxubRxBKb77lWgw65zStEbbt6ARZSJHSorjVHfTy5 PJDQ== X-Gm-Message-State: AC+VfDyYktC/AQdOdjyzD/cpJEeHqKA3z8iAJNkNJhpbHaUWhvbSCL0s QDdZagK03eobgZHo8MKOM3QCEitAw6dmzxFY/9w= X-Google-Smtp-Source: ACHHUZ4b7v3TGFV/DYhp9hMvkRwkg/xytlrp99AJ9LSIUgWQq31wHkQKoF+VlCW47oGGRIKLQc8qKw== X-Received: by 2002:ac8:5a95:0:b0:402:cc2c:d980 with SMTP id c21-20020ac85a95000000b00402cc2cd980mr14404085qtc.41.1688404639658; Mon, 03 Jul 2023 10:17:19 -0700 (PDT) Received: from ltnt-nyc-580testdevin.livetimenet.com (pool-71-105-132-214.nycmny.fios.verizon.net. [71.105.132.214]) by smtp.gmail.com with ESMTPSA id m20-20020ac85b14000000b003f6c9f8f0a8sm8730193qtw.68.2023.07.03.10.17.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2023 10:17:19 -0700 (PDT) From: Devin Heitmueller X-Google-Original-From: Devin Heitmueller To: ffmpeg-devel@ffmpeg.org Date: Mon, 3 Jul 2023 14:15:05 -0400 Message-Id: <1688408109-14381-2-git-send-email-dheitmueller@ltnglobal.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1688408109-14381-1-git-send-email-dheitmueller@ltnglobal.com> References: <1688408109-14381-1-git-send-email-dheitmueller@ltnglobal.com> Subject: [FFmpeg-devel] [PATCH v2 1/5] avcodec: Add new side data type to contain original PTS value 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: Devin Heitmueller MIME-Version: 1.0 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: In order to properly process SCTE-35 packets, we need the original PTS value from the demux (i.e. not mangled by the application or reclocked for the output). This allows us to set the pts_adjustment field in an BSF on the output side. Introduce a new side data type to store the original PTS. Signed-off-by: Devin Heitmueller --- libavcodec/defs.h | 12 ++++++++++++ libavcodec/packet.h | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/libavcodec/defs.h b/libavcodec/defs.h index deadfe7..173020f 100644 --- a/libavcodec/defs.h +++ b/libavcodec/defs.h @@ -28,6 +28,7 @@ #include #include +#include "libavutil/rational.h" /** * @ingroup lavc_decoding @@ -131,6 +132,17 @@ typedef struct AVBarData { } AVBarData; /** + * Original Transport Timestamp. Provides the original timestamp + * of the packet as specified by the libavformat source This allows that + * data to be used in calculations even if the clocks have been + * rebased or otherwise modified. + */ +typedef struct AVTransportTimestamp { + int64_t pts; + AVRational time_base; +} AVTransportTimestamp; + +/** * This structure describes the bitrate properties of an encoded bitstream. It * roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD * parameters for H.264/HEVC. diff --git a/libavcodec/packet.h b/libavcodec/packet.h index bdad21e..6c39a45 100644 --- a/libavcodec/packet.h +++ b/libavcodec/packet.h @@ -306,6 +306,17 @@ enum AVPacketSideDataType { AV_PKT_DATA_BARDATA, /** + * Provides the original PTS when passed through the demux. This can + * be used to offset any subsequent changes made by the caller to + * adjust PTS values (such as pts_offset). We need this for SCTE-35, + * since by the time the packets reach the output the PTS values have + * already been re-written, and we cannot calculate pre-roll values + * using the PTS values embedded in the packet content + * Format for this data can be found in AVTransportTimestamp struct + */ + AV_PKT_DATA_TRANSPORT_TIMESTAMP, + + /** * The number of side data types. * This is not part of the public API/ABI in the sense that it may * change when new side data types are added. -- 1.8.3.1 _______________________________________________ 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".