From: Devin Heitmueller <devin.heitmueller@ltnglobal.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Devin Heitmueller <dheitmueller@ltnglobal.com>
Subject: [FFmpeg-devel] [PATCH v3 1/4] avcodec: Add new side data type to contain original PTS value
Date: Fri, 21 Jul 2023 16:37:55 -0400
Message-ID: <1689971878-26226-2-git-send-email-dheitmueller@ltnglobal.com> (raw)
In-Reply-To: <1689971878-26226-1-git-send-email-dheitmueller@ltnglobal.com>
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 <dheitmueller@ltnglobal.com>
---
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 <stdint.h>
#include <stdlib.h>
+#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".
next prev parent reply other threads:[~2023-07-21 20:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-21 20:37 [FFmpeg-devel] [PATCH v3 0/4] Add passthrough support for SCTE-35 Devin Heitmueller
2023-07-21 20:37 ` Devin Heitmueller [this message]
2023-07-21 20:37 ` [FFmpeg-devel] [PATCH v3 2/4] mpegts: Stash original PTS for SCTE-35 sections for processing later Devin Heitmueller
2023-07-21 20:37 ` [FFmpeg-devel] [PATCH v3 3/4] mpegtsenc: Add support for output of SCTE-35 streams over TS Devin Heitmueller
2023-07-21 20:37 ` [FFmpeg-devel] [PATCH v3 4/4] bsf: Add new bitstream filter to set SCTE-35 pts_adjustment when reclocking Devin Heitmueller
2023-07-27 15:33 ` James Almer
2023-07-27 15:08 ` [FFmpeg-devel] [PATCH v3 0/4] Add passthrough support for SCTE-35 Devin Heitmueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1689971878-26226-2-git-send-email-dheitmueller@ltnglobal.com \
--to=devin.heitmueller@ltnglobal.com \
--cc=dheitmueller@ltnglobal.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git