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 8D02244A21 for ; Sun, 2 Oct 2022 19:16:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3F0E868BBF4; Sun, 2 Oct 2022 22:16:19 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1983868BB72 for ; Sun, 2 Oct 2022 22:16:13 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id F417DE7B48 for ; Sun, 2 Oct 2022 21:16:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7c-wa52LPqQR for ; Sun, 2 Oct 2022 21:16:08 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 69DCEE7AE1 for ; Sun, 2 Oct 2022 21:16:08 +0200 (CEST) Date: Sun, 2 Oct 2022 21:16:08 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: Message-ID: <7af99755-7ba6-c485-ac2c-d5265624dfc4@passwd.hu> References: <85f9faa1-8ae4-5292-3973-3f679de91dd1@passwd.hu> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2] avformat/mpegtsenc: add omit_rai flag 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, 30 Sep 2022, Zhao Zhili wrote: > From: Zhao Zhili > > Add PCR at keyframe can be undesirable when -pcr_period is > specified. Add an flag to disable this behavior. > > Signed-off-by: Zhao Zhili > --- > v2: change pcr_at_keyframe to omit_rai LGTM with libavformat micro version bump, thanks. Marton > > doc/muxers.texi | 2 ++ > libavformat/mpegtsenc.c | 6 +++++- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/doc/muxers.texi b/doc/muxers.texi > index b2f4326aae..4edbb22b00 100644 > --- a/doc/muxers.texi > +++ b/doc/muxers.texi > @@ -1915,6 +1915,8 @@ Conform to System B (DVB) instead of System A (ATSC). > Mark the initial packet of each stream as discontinuity. > @item nit > Emit NIT table. > +@item omit_rai > +Disable writing of random access indicator. > @end table > > @item mpegts_copyts @var{boolean} > diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c > index 5148a6aecd..48d39e6a7d 100644 > --- a/libavformat/mpegtsenc.c > +++ b/libavformat/mpegtsenc.c > @@ -112,6 +112,7 @@ typedef struct MpegTSWrite { > #define MPEGTS_FLAG_SYSTEM_B 0x08 > #define MPEGTS_FLAG_DISCONT 0x10 > #define MPEGTS_FLAG_NIT 0x20 > +#define MPEGTS_FLAG_OMIT_RAI 0x40 > int flags; > int copyts; > int tables_version; > @@ -1566,7 +1567,8 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, > q = get_ts_payload_start(buf); > ts_st->discontinuity = 0; > } > - if (key && is_start && pts != AV_NOPTS_VALUE && > + if (!(ts->flags & MPEGTS_FLAG_OMIT_RAI) && > + key && is_start && pts != AV_NOPTS_VALUE && > !is_dvb_teletext /* adaptation+payload forbidden for teletext (ETSI EN 300 472 V1.3.1 4.1) */) { > // set Random Access for key frames > if (ts_st->pcr_period) > @@ -2282,6 +2284,8 @@ static const AVOption options[] = { > 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_DISCONT }, 0, INT_MAX, ENC, "mpegts_flags" }, > { "nit", "Enable NIT transmission", > 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_NIT}, 0, INT_MAX, ENC, "mpegts_flags" }, > + { "omit_rai", "Disable writing of random access indicator", > + 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_OMIT_RAI }, 0, INT_MAX, ENC, "mpegts_flags" }, > { "mpegts_copyts", "don't offset dts/pts", OFFSET(copyts), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, ENC }, > { "tables_version", "set PAT, PMT, SDT and NIT version", OFFSET(tables_version), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 31, ENC }, > { "omit_video_pes_length", "Omit the PES packet length for video packets", > -- > 2.25.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". > _______________________________________________ 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".