[PATCH][RFC] mpegtsenc: add option tables_version
--- libavformat/mpegtsenc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index e7c522c..1d51b97 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -85,6 +85,7 @@ typedef struct MpegTSWrite { #define MPEGTS_FLAG_AAC_LATM 0x02 int flags; int copyts; + int tables_version; } MpegTSWrite; /* a PES packet header is generated every DEFAULT_PES_HEADER_FREQ packets */ @@ -121,6 +122,8 @@ static const AVOption options[] = { offsetof(MpegTSWrite, reemit_pat_pmt), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, { "mpegts_copyts", "don't offset dts/pts", offsetof(MpegTSWrite, copyts), AV_OPT_TYPE_INT, {.i64=-1}, -1, 1, AV_OPT_FLAG_ENCODING_PARAM}, + { "tables_version", "set PAT, PMT and SDT version", + offsetof(MpegTSWrite, tables_version), AV_OPT_TYPE_INT, {.i64=0}, 0, 31, AV_OPT_FLAG_ENCODING_PARAM}, { NULL }, }; @@ -252,7 +255,7 @@ static void mpegts_write_pat(AVFormatContext *s) put16(&q, service->sid); put16(&q, 0xe000 | service->pmt.pid); } - mpegts_write_section1(&ts->pat, PAT_TID, ts->tsid, 0, 0, 0, + mpegts_write_section1(&ts->pat, PAT_TID, ts->tsid, ts->tables_version, 0, 0, data, q - data); } @@ -413,7 +416,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) desc_length_ptr[0] = val >> 8; desc_length_ptr[1] = val; } - mpegts_write_section1(&service->pmt, PMT_TID, service->sid, 0, 0, 0, + mpegts_write_section1(&service->pmt, PMT_TID, service->sid, ts->tables_version, 0, 0, data, q - data); } @@ -468,7 +471,7 @@ static void mpegts_write_sdt(AVFormatContext *s) desc_list_len_ptr[0] = val >> 8; desc_list_len_ptr[1] = val; } - mpegts_write_section1(&ts->sdt, SDT_TID, ts->tsid, 0, 0, 0, + mpegts_write_section1(&ts->sdt, SDT_TID, ts->tsid, ts->tables_version, 0, 0, data, q - data); } -- 1.8.1.5
On Aug 2, 2013 12:08 PM, "Andrey Utkin" <andrey.krieger.utkin@gmail.com> wrote:
--- libavformat/mpegtsenc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Please update the respective documentation (doc/*). Timothu
Is it even possible to update PAT/PMT? If not then what's the need to update the version?
2013/8/3 Kieran Kunhya <kierank@obe.tv>:
Is it even possible to update PAT/PMT? If not then what's the need to update the version?
To update stream structure by running several ffmpeg processes sequentially. ffmpeg (i/o streams set) -f mpegts udp://blah ffmpeg (another i/o streams set) -f mpegts -tables_version 1 udp://blah ffmpeg (yet another i/o streams set) -f mpegts -tables_version 2 udp://blah -- Andrey Utkin
On Fri, Aug 02, 2013 at 10:08:05PM +0300, Andrey Utkin wrote:
--- libavformat/mpegtsenc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
applied please also add a example of a usecase to the docs thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato
participants (4)
-
Andrey Utkin -
Kieran Kunhya -
Michael Niedermayer -
Timothy Gu