* [FFmpeg-devel] [PATCH] avformat/hlsenc: Add resend_headers option
@ 2022-06-25 15:35 huheng
2022-06-27 2:24 ` Steven Liu
0 siblings, 1 reply; 3+ messages in thread
From: huheng @ 2022-06-25 15:35 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: huheng
Add pat and pmt table at start of each segment in single_file mode enhanced
compatibility of hls stream. Because some hls clients separate parsing segment
of hls stream, the absence of pat/pmt will cause parsing to fail.
Signed-off-by: huheng <heng.hu.1989@gmail.com>
---
libavformat/hlsenc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 3bafddfa61..ee5c5afe56 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2631,6 +2631,11 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
vs->start_pos += vs->size;
if (hls->key_info_file || hls->encrypt)
ret = hls_start(s, vs);
+
+ if (oc->oformat->priv_class && oc->priv_data) {
+ av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
+ }
+
} else if (hls->max_seg_size > 0) {
if (vs->size + vs->start_pos >= hls->max_seg_size) {
vs->sequence++;
--
2.36.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".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: Add resend_headers option
2022-06-25 15:35 [FFmpeg-devel] [PATCH] avformat/hlsenc: Add resend_headers option huheng
@ 2022-06-27 2:24 ` Steven Liu
2022-06-27 13:23 ` hu heng
0 siblings, 1 reply; 3+ messages in thread
From: Steven Liu @ 2022-06-27 2:24 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: huheng
huheng <heng.hu.1989@gmail.com> 于2022年6月25日周六 23:36写道:
>
> Add pat and pmt table at start of each segment in single_file mode enhanced
> compatibility of hls stream. Because some hls clients separate parsing segment
> of hls stream, the absence of pat/pmt will cause parsing to fail.
>
> Signed-off-by: huheng <heng.hu.1989@gmail.com>
> ---
> libavformat/hlsenc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 3bafddfa61..ee5c5afe56 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2631,6 +2631,11 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
> vs->start_pos += vs->size;
> if (hls->key_info_file || hls->encrypt)
> ret = hls_start(s, vs);
> +
Is it need check hls->segment_type == SEGMENT_TYPE_MPEGTS here?
> + if (oc->oformat->priv_class && oc->priv_data) {
> + av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
> + }
> +
> } else if (hls->max_seg_size > 0) {
> if (vs->size + vs->start_pos >= hls->max_seg_size) {
> vs->sequence++;
> --
> 2.36.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".
Thanks
Steven
_______________________________________________
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".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: Add resend_headers option
2022-06-27 2:24 ` Steven Liu
@ 2022-06-27 13:23 ` hu heng
0 siblings, 0 replies; 3+ messages in thread
From: hu heng @ 2022-06-27 13:23 UTC (permalink / raw)
To: Steven Liu; +Cc: FFmpeg development discussions and patches
Your are right, I will send a new version of this patch.
Thanks.
Steven Liu <lingjiujianke@gmail.com> 于2022年6月27日周一 10:25写道:
> huheng <heng.hu.1989@gmail.com> 于2022年6月25日周六 23:36写道:
> >
> > Add pat and pmt table at start of each segment in single_file mode
> enhanced
> > compatibility of hls stream. Because some hls clients separate parsing
> segment
> > of hls stream, the absence of pat/pmt will cause parsing to fail.
> >
> > Signed-off-by: huheng <heng.hu.1989@gmail.com>
> > ---
> > libavformat/hlsenc.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> > index 3bafddfa61..ee5c5afe56 100644
> > --- a/libavformat/hlsenc.c
> > +++ b/libavformat/hlsenc.c
> > @@ -2631,6 +2631,11 @@ static int hls_write_packet(AVFormatContext *s,
> AVPacket *pkt)
> > vs->start_pos += vs->size;
> > if (hls->key_info_file || hls->encrypt)
> > ret = hls_start(s, vs);
> > +
> Is it need check hls->segment_type == SEGMENT_TYPE_MPEGTS here?
> > + if (oc->oformat->priv_class && oc->priv_data) {
> > + av_opt_set(oc->priv_data, "mpegts_flags",
> "resend_headers", 0);
> > + }
> > +
> > } else if (hls->max_seg_size > 0) {
> > if (vs->size + vs->start_pos >= hls->max_seg_size) {
> > vs->sequence++;
> > --
> > 2.36.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".
>
> Thanks
> Steven
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-27 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-25 15:35 [FFmpeg-devel] [PATCH] avformat/hlsenc: Add resend_headers option huheng
2022-06-27 2:24 ` Steven Liu
2022-06-27 13:23 ` hu heng
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git