mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/mpegtsenc: add omit_rai flag
Add PCR at keyframe can be undesirable when -pcr_period is specified. Add an flag to disable this behavior. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
parent
ba30744213
commit
2205ccd216
@ -1915,6 +1915,8 @@ Conform to System B (DVB) instead of System A (ATSC).
|
|||||||
Mark the initial packet of each stream as discontinuity.
|
Mark the initial packet of each stream as discontinuity.
|
||||||
@item nit
|
@item nit
|
||||||
Emit NIT table.
|
Emit NIT table.
|
||||||
|
@item omit_rai
|
||||||
|
Disable writing of random access indicator.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item mpegts_copyts @var{boolean}
|
@item mpegts_copyts @var{boolean}
|
||||||
|
@ -112,6 +112,7 @@ typedef struct MpegTSWrite {
|
|||||||
#define MPEGTS_FLAG_SYSTEM_B 0x08
|
#define MPEGTS_FLAG_SYSTEM_B 0x08
|
||||||
#define MPEGTS_FLAG_DISCONT 0x10
|
#define MPEGTS_FLAG_DISCONT 0x10
|
||||||
#define MPEGTS_FLAG_NIT 0x20
|
#define MPEGTS_FLAG_NIT 0x20
|
||||||
|
#define MPEGTS_FLAG_OMIT_RAI 0x40
|
||||||
int flags;
|
int flags;
|
||||||
int copyts;
|
int copyts;
|
||||||
int tables_version;
|
int tables_version;
|
||||||
@ -1566,7 +1567,8 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
|
|||||||
q = get_ts_payload_start(buf);
|
q = get_ts_payload_start(buf);
|
||||||
ts_st->discontinuity = 0;
|
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) */) {
|
!is_dvb_teletext /* adaptation+payload forbidden for teletext (ETSI EN 300 472 V1.3.1 4.1) */) {
|
||||||
// set Random Access for key frames
|
// set Random Access for key frames
|
||||||
if (ts_st->pcr_period)
|
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" },
|
0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_DISCONT }, 0, INT_MAX, ENC, "mpegts_flags" },
|
||||||
{ "nit", "Enable NIT transmission",
|
{ "nit", "Enable NIT transmission",
|
||||||
0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_NIT}, 0, INT_MAX, ENC, "mpegts_flags" },
|
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 },
|
{ "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 },
|
{ "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",
|
{ "omit_video_pes_length", "Omit the PES packet length for video packets",
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "version_major.h"
|
#include "version_major.h"
|
||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_MINOR 34
|
#define LIBAVFORMAT_VERSION_MINOR 34
|
||||||
#define LIBAVFORMAT_VERSION_MICRO 100
|
#define LIBAVFORMAT_VERSION_MICRO 101
|
||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||||
LIBAVFORMAT_VERSION_MINOR, \
|
LIBAVFORMAT_VERSION_MINOR, \
|
||||||
|
Loading…
Reference in New Issue
Block a user