From: Devin Heitmueller <devin.heitmueller@ltnglobal.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Devin Heitmueller <dheitmueller@ltnglobal.com>
Subject: [FFmpeg-devel] [PATCH 2/5] mpegts: Stash original PTS for SCTE-35 sections for processing later
Date: Fri, 16 Jun 2023 18:12:55 -0400
Message-ID: <1686953578-18843-3-git-send-email-dheitmueller@ltnglobal.com> (raw)
In-Reply-To: <1686953578-18843-1-git-send-email-dheitmueller@ltnglobal.com>
We need the original PTS value in order to do subsequent processing,
so set it as packet side data.
Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
---
libavformat/mpegts.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 385d78b..b8f1d7d 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1782,8 +1782,15 @@ static void scte_data_cb(MpegTSFilter *filter, const uint8_t *section,
prg = av_find_program_from_stream(ts->stream, NULL, idx);
if (prg && prg->pcr_pid != -1 && prg->discard != AVDISCARD_ALL) {
MpegTSFilter *f = ts->pids[prg->pcr_pid];
- if (f && f->last_pcr != -1)
+ if (f && f->last_pcr != -1) {
+ int64_t *orig_pts;
ts->pkt->pts = ts->pkt->dts = f->last_pcr/300;
+ orig_pts = (int64_t *) av_packet_new_side_data(ts->pkt,
+ AV_PKT_DATA_ORIG_PTS,
+ sizeof(int64_t));
+ if (orig_pts)
+ *orig_pts = ts->pkt->pts;
+ }
}
ts->stop_parse = 1;
--
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-06-16 21:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 22:12 [FFmpeg-devel] [PATCH 0/5] Add passthrough support for SCTE-35 Devin Heitmueller
2023-06-16 22:12 ` [FFmpeg-devel] [PATCH 1/5] avcodec: Add new side data type to contain original PTS value Devin Heitmueller
2023-06-16 22:01 ` Andreas Rheinhardt
2023-06-19 13:14 ` Devin Heitmueller
2023-06-19 14:32 ` Anton Khirnov
2023-06-19 14:54 ` Devin Heitmueller
2023-06-16 22:12 ` Devin Heitmueller [this message]
2023-06-16 22:12 ` [FFmpeg-devel] [PATCH 3/5] mpegtsenc: Add support for output of SCTE-35 streams over TS Devin Heitmueller
2023-06-16 22:12 ` [FFmpeg-devel] [PATCH 4/5] bsf: Add new bitstream filter to set pts_adjustment when reclocking Devin Heitmueller
2023-06-16 21:59 ` Andreas Rheinhardt
2023-06-19 13:15 ` Devin Heitmueller
2023-06-16 22:12 ` [FFmpeg-devel] [PATCH 5/5] mpegtsenc: Don't periodically announce PCR on SCTE-35 streams 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=1686953578-18843-3-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