diff options
-rw-r--r-- | doc/muxers.texi | 3 | ||||
-rw-r--r-- | libavformat/mpegtsenc.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/muxers.texi b/doc/muxers.texi index 90967dd..4f8c3c1 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -638,6 +638,9 @@ Set the first PID for data packets (default 0x0100, max 0x0f00). Enable m2ts mode if set to 1. Default value is -1 which disables m2ts mode. @item -muxrate @var{number} Set a constant muxrate (default VBR). +@item -pcr_period @var{numer} +Override the default PCR retransmission time (default 20ms), ignored +if variable muxrate is selected. @item -pes_payload_size @var{number} Set minimum PES packet payload in bytes. @item -mpegts_flags @var{flags} diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index a8967b2..f0d9cd2 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -81,6 +81,7 @@ typedef struct MpegTSWrite { int reemit_pat_pmt; // backward compatibility + int pcr_period; #define MPEGTS_FLAG_REEMIT_PAT_PMT 0x01 #define MPEGTS_FLAG_AAC_LATM 0x02 int flags; @@ -685,7 +686,7 @@ static int mpegts_write_header(AVFormatContext *s) } if (ts->mux_rate > 1) { - service->pcr_packet_period = (ts->mux_rate * PCR_RETRANS_TIME) / + service->pcr_packet_period = (ts->mux_rate * ts->pcr_period) / (TS_PACKET_SIZE * 8 * 1000); ts->sdt_packet_period = (ts->mux_rate * SDT_RETRANS_TIME) / (TS_PACKET_SIZE * 8 * 1000); @@ -1380,6 +1381,8 @@ static const AVOption options[] = { offsetof(MpegTSWrite, tables_version), AV_OPT_TYPE_INT, {.i64=0}, 0, 31, AV_OPT_FLAG_ENCODING_PARAM}, { "omit_video_pes_length", "Omit the PES packet length for video packets", offsetof(MpegTSWrite, omit_video_pes_length), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, + { "pcr_period", "PCR retransmission time", + offsetof(MpegTSWrite, pcr_period), AV_OPT_TYPE_INT, { .i64 = PCR_RETRANS_TIME }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, { NULL }, }; |