[FFmpeg-cvslog] hlsenc: Only write PAT/PMT once per segment
Derek Buitenhuis
git at videolan.org
Mon Nov 2 15:36:28 CET 2015
ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Sun Apr 5 14:28:38 2015 -0400| [9ae73d0644cde27d3d93d41a5d8bc94de853ea91] | committer: Derek Buitenhuis
hlsenc: Only write PAT/PMT once per segment
This saves a lot of muxing overhead, especially on lower bitrate
segments.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ae73d0644cde27d3d93d41a5d8bc94de853ea91
---
libavformat/hlsenc.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 8daf53f..d7884e5 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -560,8 +560,16 @@ static int hls_start(AVFormatContext *s)
}
av_dict_free(&options);
- if (oc->oformat->priv_class && oc->priv_data)
+ /* We only require one PAT/PMT per segment. */
+ if (oc->oformat->priv_class && oc->priv_data) {
+ char period[21];
+
+ snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1);
+
av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
+ av_opt_set(oc->priv_data, "sdt_period", period, 0);
+ av_opt_set(oc->priv_data, "pat_period", period, 0);
+ }
if (c->vtt_basename)
avformat_write_header(vtt_oc,NULL);
More information about the ffmpeg-cvslog
mailing list