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 89CC04697F for ; Mon, 31 Jul 2023 13:38:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C6F6168C0B8; Mon, 31 Jul 2023 16:38:20 +0300 (EEST) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3DEBC68BEE5 for ; Mon, 31 Jul 2023 16:38:13 +0300 (EEST) Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-76754b9eac0so377047185a.0 for ; Mon, 31 Jul 2023 06:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ltnglobal-com.20221208.gappssmtp.com; s=20221208; t=1690810691; x=1691415491; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=NIa8U61D4HjMO2dR5ME9+bwUAki8APBvAR/q5qBzgps=; b=ck/aQfM40XhoGib1/Ye662bna0mHRjQ57ixjd1ekcgJQRUBcdA9Uht80ipQik2bc41 TK3+jAXvaCz96Q/LyKVjq5wqHhnphlSyX0C9tyl784ird5zW0ZxujdE0mbt3zcdfzNLV Tr49CQTGQQvhiHPqYNkURIaRWDlmp4D+Y4/7LHsKzpMajdUO5tQdJEmPGRGtvW8E0viw nCOHBTIAzIbLAw/SHQIm7HXL1NovjGF7xfjcOOWskiv3WwVHyJjS2xL57YCejlWuT/Sf qvkrrYfbkdQIoQFw04NbNuAl/7OErQKH3dUpqtWqaB1huIDI0mLvMbuuSniZP816JRE5 30KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690810691; x=1691415491; 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=NIa8U61D4HjMO2dR5ME9+bwUAki8APBvAR/q5qBzgps=; b=Ol1ANP+mWnHTIvDzAOsDSJf2/IYBamyJzmKeeDL1zzREoap503lSi7NJHGnV3KnFws wTRunsuUV7OlM1Ob4w9Ik42WDwXASg09UQjoA51w+bIHBUSzBdt52OATpmokbQG9Z8uR FjJ0nx/Fu6o+Ldbc9sYgKWyn3v1ijujZAKxNAawUJ451FKnxCfsjjBb5ewghjwCf1e4y sKYQ8+pcqu2XmatFoyot/wXIY+50VjU66JC3upDGaYU7yS0X5kJM86oz+VKLTt3Yvyit L1NQpA/qR3xF/snNBmrl/smIazMbuoCXEGpbZrIcc09sEuEphB5xIuTIcGQdDjkcXjHB Ja7g== X-Gm-Message-State: ABy/qLazVHkzr581qSZGo+SPqfWAYjGzjR1UO0REHFJvhuFT0oe4LdMh Pval/4OjCdtolYaWPfDPHE8kzprmQXxLQt87WIU= X-Google-Smtp-Source: APBJJlESOsSMhCTp1qrgEcaLCqDqA8d6S15Pnzmn/v82dEX2BuPP01CLcePiTEklL1xNxY6iqTGrTA== X-Received: by 2002:a05:620a:1914:b0:76c:add6:f84a with SMTP id bj20-20020a05620a191400b0076cadd6f84amr4196052qkb.35.1690810691322; Mon, 31 Jul 2023 06:38:11 -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 o9-20020a05620a110900b0076c84240467sm2504235qkk.52.2023.07.31.06.38.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2023 06:38:10 -0700 (PDT) From: Devin Heitmueller X-Google-Original-From: Devin Heitmueller To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 Jul 2023 09:38:03 -0400 Message-Id: <1690810686-4723-2-git-send-email-dheitmueller@ltnglobal.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1690810686-4723-1-git-send-email-dheitmueller@ltnglobal.com> References: <1690810686-4723-1-git-send-email-dheitmueller@ltnglobal.com> Subject: [FFmpeg-devel] [PATCH v4 1/4] 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 fbe3254..ff50d25 100644 --- a/libavcodec/defs.h +++ b/libavcodec/defs.h @@ -28,6 +28,7 @@ #include #include +#include "libavutil/rational.h" /** * @ingroup lavc_decoding @@ -119,6 +120,17 @@ typedef struct AVPanScan { } AVPanScan; /** + * 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 f28e7e7..8b650a8 100644 --- a/libavcodec/packet.h +++ b/libavcodec/packet.h @@ -300,6 +300,17 @@ enum AVPacketSideDataType { AV_PKT_DATA_DYNAMIC_HDR10_PLUS, /** + * 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".