[FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Fix bug on start_pts

2021-05-16 Thread Hongcheng Zhong
From: spartazhc This patch fixes Bug #9237 In some bitstream, pts of some video packet can be N/A, which will set start_pts to AV_NOPTS_VALUE. Adding an if condition can fix it. Signed-off-by: spartazhc --- libavformat/hlsenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --gi

Re: [FFmpeg-devel] [PATCH] [GSoC v3 1/7] avformat/abr: Adaptive Bitrate support

2020-08-23 Thread Hongcheng Zhong
algorithms to ffabr. Describe my work in detail I have written some more details about my work on this posted in my blog: https://spartazhc.github.io/2020/08/23/ABR-meets-FFmpeg-in-detail/. You could read it if you are interested. Regards, Hongcheng Zhong

[FFmpeg-devel] [PATCH] [GSoC v3 5/7] ffplay: add an option to enable abr

2020-08-23 Thread Hongcheng Zhong
From: spartazhc Add abr option, ffplay can play hls using abr by: ffplay -i http://xxx/master.m3u8 -abr Structure ABRList is added to save stream type and index, it is used to allow packet_queue_put function to put pkt which from same type(for example: video pkt) but different stream index to qu

[FFmpeg-devel] [PATCH] [GSoC v3 4/7] avformat/hls allow crypto works as ffabr's subprotocol

2020-08-23 Thread Hongcheng Zhong
From: spartazhc For example, ffabr:crypto+http://xxx.m3u8 Signed-off-by: spartazhc --- libavformat/hls.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 4e760f8e8a..37a5a017b1 100644 --- a/libavformat/hls.c +++ b

[FFmpeg-devel] [PATCH] [GSoC v3 7/7] ffplay: fix for unwanted pkts when using abr

2020-08-23 Thread Hongcheng Zhong
From: spartazhc HLS use abr may switch streams, ffplay should allow pkt whic same type (for example: video pkt) but different stream index to queue. But in the begining, avformat_find_stream_info() will add pkts to packet_buffer from all streams to find info. This will cause problem because thes

[FFmpeg-devel] [PATCH] [GSoC v3 6/7] avformat/hls add metadata "abr_initial" for ffplay

2020-08-23 Thread Hongcheng Zhong
From: spartazhc Add an AVDictionary option "abr_initial", which could be used to send message to ffplay. Currently, the first entry "abr_init_duration" is added. Signed-off-by: spartazhc --- doc/demuxers.texi | 3 +++ libavformat/hls.c | 14 ++ 2 files changed, 17 insertions(+) d

[FFmpeg-devel] [PATCH] [GSoC v3 1/7] avformat/abr: Adaptive Bitrate support

2020-08-23 Thread Hongcheng Zhong
From: spartazhc Add abr module for hls/dash. Signed-off-by: spartazhc v1 fixed: 1. add an "ff" prefix to the protocol name to mark it internal. 2. use 1.2f for float constant 1.2. 3. simplify abr_seek for we just need AVSEEK_SIZE only. v2 fixed: 1. fix error return 2. simplify abr_seek v3 fi

[FFmpeg-devel] [PATCH] [GSoC v3 2/7] avformat/http: Add ffabr to whitelist

2020-08-23 Thread Hongcheng Zhong
From: spartazhc add ffabr protocol to the default_whitelist of http and https Signed-off-by: spartazhc --- libavformat/http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/http.c b/libavformat/http.c index 6c39da1a8b..88e69114a2 100644 --- a/libavformat/ht

[FFmpeg-devel] [PATCH] [GSoC v3 3/7] avformat/hls: use abr to switch streams

2020-08-23 Thread Hongcheng Zhong
From: spartazhc When abr is enable, it will take over the task to call http to download segments, and will return a switch-request for hls to switch streams. For reason not to waste segments that have been downloaded, switch will become effective after old segments is used out. Abr cannot work wi

Re: [FFmpeg-devel] [RFC][GSoC][PATCH v1 6/6] ffplay: add av_packet_buffer_filter to filter packet buffer

2020-07-19 Thread Hongcheng Zhong
On Thu, 2020-07-16 at 18:11 +0200, Andreas Rheinhardt wrote: > Hongcheng Zhong: > > From: spartazhc > > > > hls_read_header will add all streams to s->internal->packet_buffer. > > Use av_packet_buffer_filter to remove the AVPackets from other > > streams

[FFmpeg-devel] [RFC][GSoC][PATCH v2 5/6] avformat/utils: add av_packet_buffer_filter to filter packet_buffer

2020-07-16 Thread Hongcheng Zhong
From: spartazhc Add av_packet_buffer_filter to remove AVPackets whose stream_index is not in st_index list. st_index has length of AVMEDIA_TYPE_NB, contains the stream_index of all these media types. Generally s->internal->packet_buffer may have pkts from different stream, and stream_index will

[FFmpeg-devel] [RFC][GSoC][PATCH v2 6/6] ffplay: add av_packet_buffer_filter to filter packet buffer

2020-07-16 Thread Hongcheng Zhong
From: spartazhc hls_read_header will add all streams to s->internal->packet_buffer. Use av_packet_buffer_filter to remove the AVPackets from other streams that are not needed, otherwise abr will allow them to be added to ffplay's packet_queue. Signed-off-by: spartazhc --- fftools/ffplay.c | 4

[FFmpeg-devel] [RFC][GSoC][PATCH v2 4/6] ffplay: add an option to enable abr

2020-07-16 Thread Hongcheng Zhong
From: spartazhc Add abr option, ffplay can play hls using abr by: ffplay -i http://xxx/master.m3u8 -abr Structure ABRList is added to save stream type and index, it is used to allow packet_queue_put function to put pkt which from same type(for example: video pkt) but different stream index to qu

[FFmpeg-devel] [RFC][GSoC][PATCH v2 2/6] avformat/http: Add abr to whitelist

2020-07-16 Thread Hongcheng Zhong
From: spartazhc add abr protocol to http's whitelist Signed-off-by: spartazhc --- libavformat/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/http.c b/libavformat/http.c index 6c39da1a8b..b77517ff51 100644 --- a/libavformat/http.c +++ b/libavformat/http.c

[FFmpeg-devel] [RFC][GSoC][PATCH v2 3/6] avformat/hls: use abr to switch streams

2020-07-16 Thread Hongcheng Zhong
From: spartazhc When abr is enable, it will take over the task to call http to download segments, and will return a switch-request for hls to switch streams. For reason not to waste segments that have been downloaded, switch will become effective after old segments is used out. Abr cannot work wi

[FFmpeg-devel] [RFC][GSoC][PATCH v2 1/6] avformat/abr: Adaptive Bitrate support

2020-07-16 Thread Hongcheng Zhong
7699b9baef --- /dev/null +++ b/libavformat/abr.c @@ -0,0 +1,249 @@ +/* + * Adaptive Bitrate Module for HLS / DASH + * Copyright (c) 2020 Hongcheng Zhong + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Less

[FFmpeg-devel] [RFC][GSoC][PATCH v1 4/6] ffplay: add an option to enable abr

2020-07-15 Thread Hongcheng Zhong
From: spartazhc Add abr option, ffplay can play hls using abr by: ffplay -i http://xxx/master.m3u8 -abr Structure ABRList is added to save stream type and index, it is used to allow packet_queue_put function to put pkt which from same type(for example: video pkt) but different stream index to qu

[FFmpeg-devel] [RFC][GSoC][PATCH v1 6/6] ffplay: add av_packet_buffer_filter to filter packet buffer

2020-07-15 Thread Hongcheng Zhong
From: spartazhc hls_read_header will add all streams to s->internal->packet_buffer. Use av_packet_buffer_filter to remove the AVPackets from other streams that are not needed, otherwise abr will allow them to be added to ffplay's packet_queue. Signed-off-by: spartazhc --- fftools/ffplay.c | 4

[FFmpeg-devel] [RFC][GSoC][PATCH v1 5/6] avformat/utils: add av_packet_buffer_filter to filter packet_buffer

2020-07-15 Thread Hongcheng Zhong
From: spartazhc Add av_packet_buffer_filter to remove AVPackets whose stream_index is not in st_index list. st_index has length of AVMEDIA_TYPE_NB, contains the stream_index of all these media types. Generally s->internal->packet_buffer may have pkts from different stream, and stream_index will

[FFmpeg-devel] [RFC][GSoC][PATCH v1 3/6] avformat/hls: use abr to switch streams

2020-07-15 Thread Hongcheng Zhong
From: spartazhc When abr is enable, it will take over the task to call http to download segments, and will return a switch-request for hls to switch streams. For reason not to waste segments that have been downloaded, switch will become effective after old segments is used out. Abr cannot work wi

[FFmpeg-devel] [RFC][GSoC][PATCH v1 2/6] avformat/http: Add abr to whitelist

2020-07-15 Thread Hongcheng Zhong
From: spartazhc add abr protocol to http's whitelist Signed-off-by: spartazhc --- libavformat/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/http.c b/libavformat/http.c index 6c39da1a8b..b77517ff51 100644 --- a/libavformat/http.c +++ b/libavformat/http.c

[FFmpeg-devel] [RFC][GSoC][PATCH v1 1/6] avformat/abr: Adaptive Bitrate support

2020-07-15 Thread Hongcheng Zhong
to.o OBJS-$(CONFIG_BLURAY_PROTOCOL) += bluray.o diff --git a/libavformat/abr.c b/libavformat/abr.c new file mode 100644 index 00..e201d3edda --- /dev/null +++ b/libavformat/abr.c @@ -0,0 +1,250 @@ +/* + * Adaptive Bitrate Module for HLS / DASH + * Copyright (c) 2020 Hongcheng Zhong +

Re: [FFmpeg-devel] patch submission questions

2020-07-05 Thread Hongcheng Zhong
On Sun, 2020-07-05 at 15:42 +0200, Manolis Stamatogiannakis wrote: > Hello, > > I'm trying to submit a patch for adding a "shift" option to > subtitles/ass > filters. Initial submission was ok, but resubmitting after addressing > some > emails didn't go as expected. > > I have the following two q

Re: [FFmpeg-devel] [PATCH] [GSoC 5/6] avformat/utils: add av_packet_clean to remove AVPackets not needed in pktl

2020-07-05 Thread Hongcheng Zhong
- On Jul 5, 2020, at 9:14 PM, Andreas Rheinhardt andreas.rheinha...@gmail.com wrote: > Hongcheng Zhong: >> From: spartazhc >> >> Add av_packet_clean to remove AVPackets whose stream_index is not >> in st_index list. >> >> Generally s->internal-&

[FFmpeg-devel] [PATCH] [GSoC 6/6] ffplay: add av_packet_clean to remove AVPackets not needed

2020-07-05 Thread Hongcheng Zhong
From: spartazhc hls_read_header will add all streams to s->internal->packet_buffer. Use av_packet_clean to remove the AVPackets from other streams that are not needed, otherwise abr will allow them to be added to ffplay's packet_queue. Signed-off-by: spartazhc --- fftools/ffplay.c | 4 1

[FFmpeg-devel] [PATCH] [GSoC 1/6] avformat/abr: Adaptive Bitrate support

2020-07-05 Thread Hongcheng Zhong
/libavformat/abr.c @@ -0,0 +1,282 @@ +/* + * Adaptive Bitrate Module for HLS / DASH + * Copyright (c) 2020 Hongcheng Zhong + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as

[FFmpeg-devel] [PATCH] [GSoC 5/6] avformat/utils: add av_packet_clean to remove AVPackets not needed in pktl

2020-07-05 Thread Hongcheng Zhong
From: spartazhc Add av_packet_clean to remove AVPackets whose stream_index is not in st_index list. Generally s->internal->packet_buffer may have pkts from different stream, and stream_index will be used to discard pkt that is not needed. But in case of abr, several streams may pass the stream_i

[FFmpeg-devel] [PATCH] [GSoC 4/6] ffplay: add an option to enable abr

2020-07-05 Thread Hongcheng Zhong
From: spartazhc Add abr option, ffplay can play hls using abr by: ffplay -i http://xxx/master.m3u8 -abr Structure ABRList is added to save stream type and index, it is used to allow packet_queue_put function to put pkt which from same type(for example: video pkt) but different stream index to qu

[FFmpeg-devel] [PATCH] [GSoC 3/6] avformat/hls: use abr to switch streams

2020-07-05 Thread Hongcheng Zhong
From: spartazhc When abr is enable, it will take over the task to call http to download segments, and will return a switch-request for hls to switch streams. For reason not to waste segments that have been downloaded, switch will become effective after old segments is used out. Abr cannot work wi

[FFmpeg-devel] [PATCH] [GSoC 2/6] avformat/http: Add abr to whitelist

2020-07-05 Thread Hongcheng Zhong
From: spartazhc add abr protocol to http's whitelist Signed-off-by: spartazhc --- libavformat/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/http.c b/libavformat/http.c index 6c39da1a8b..6a58c9afef 100644 --- a/libavformat/http.c +++ b/libavformat/http.c

[FFmpeg-devel] [PATCH v2] avformat/hlsenc: Fix initial setting for start_pts

2020-03-05 Thread Hongcheng Zhong
Signed-off-by: Hongcheng Zhong --- libavformat/hlsenc.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index f6dd894..19aa2b1 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -126,6 +126,7 @@ typedef struct VariantStream {

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: Fix initial setting for start_pts

2020-03-05 Thread Hongcheng Zhong
- On Mar 6, 2020, at 11:08 AM, Andreas Rheinhardt andreas.rheinha...@gmail.com wrote: > Hongcheng Zhong: >> - On Mar 6, 2020, at 12:55 AM, Andreas Rheinhardt >> andreas.rheinha...@gmail.com wrote: >> >>> Hongcheng Zhong: >>>> - On Mar 5,

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: Fix initial setting for start_pts

2020-03-05 Thread Hongcheng Zhong
- On Mar 6, 2020, at 12:55 AM, Andreas Rheinhardt andreas.rheinha...@gmail.com wrote: > Hongcheng Zhong: >> - On Mar 5, 2020, at 11:38 PM, lq l...@chinaffmpeg.org wrote: >> >>>> 2020年3月5日 下午9:41,Hongcheng Zhong 写道: >>>> >>>> This pat

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: Fix initial setting for start_pts

2020-03-05 Thread Hongcheng Zhong
- On Mar 5, 2020, at 11:38 PM, lq l...@chinaffmpeg.org wrote: >> 2020年3月5日 下午9:41,Hongcheng Zhong 写道: >> >> This patch fixes Bug #8469 >> If x264 baseline profile is used with other profiles, >> start_pts will be initialized to audio stream's first pts,

[FFmpeg-devel] [PATCH] avformat/hlsenc: Fix initial setting for start_pts

2020-03-05 Thread Hongcheng Zhong
Signed-off-by: Hongcheng Zhong --- libavformat/hlsenc.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index f6dd894..3b2434f 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -126,6 +126,7 @@ typedef struc