[FFmpeg-devel] [PATCH 1/2] lavc/libx264: minor format fix

2024-06-28 Thread Jun Zhao
From: Jun Zhao 

Remove redundant semicolons

Signed-off-by: Jun Zhao 
---
 libavcodec/libx264.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 8186f68aec..d07a65a103 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -725,7 +725,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, 
const AVFrame *frame,
 
 /* SSE = MSE * width * height / scale -> because of possible 
chroma downsampling */
 sse[i] = (int64_t)floor(mse * plane_size + .5);
-};
+}
 
 errors = sse;
 }
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 2/2] lavf/scdet: minor fix

2024-06-28 Thread Jun Zhao
From: Jun Zhao 

Change dbl to i64 for bool type

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_scdet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_scdet.c b/libavfilter/vf_scdet.c
index 15399cfebf..705bdf9777 100644
--- a/libavfilter/vf_scdet.c
+++ b/libavfilter/vf_scdet.c
@@ -53,8 +53,8 @@ typedef struct SCDetContext {
 static const AVOption scdet_options[] = {
 { "threshold",   "set scene change detect threshold",
OFFSET(threshold),  AV_OPT_TYPE_DOUBLE,   {.dbl = 10.}, 0,  100., V|F },
 { "t",   "set scene change detect threshold",
OFFSET(threshold),  AV_OPT_TYPE_DOUBLE,   {.dbl = 10.}, 0,  100., V|F },
-{ "sc_pass", "Set the flag to pass scene change frames", 
OFFSET(sc_pass),AV_OPT_TYPE_BOOL, {.dbl =  0  },0,1,  V|F },
-{ "s",   "Set the flag to pass scene change frames", 
OFFSET(sc_pass),AV_OPT_TYPE_BOOL, {.dbl =  0  },0,1,  V|F },
+{ "sc_pass", "Set the flag to pass scene change frames", 
OFFSET(sc_pass),AV_OPT_TYPE_BOOL, {.i64 = 0  }, 0,1,  V|F },
+{ "s",   "Set the flag to pass scene change frames", 
OFFSET(sc_pass),AV_OPT_TYPE_BOOL, {.i64 = 0  }, 0,1,  V|F },
 {NULL}
 };
 
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] vulkan_decode: fix the print format of VkDeviceSize

2023-11-17 Thread Jun Zhao
VkDeviceSize represents device memory size and offset
values as uint64_t in Spec.

Signed-off-by: Jun Zhao 
---
 libavcodec/vulkan_video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c
index 236aa124bb..5fa8292b28 100644
--- a/libavcodec/vulkan_video.c
+++ b/libavcodec/vulkan_video.c
@@ -384,7 +384,7 @@ av_cold int ff_vk_video_common_init(void *log, 
FFVulkanContext *s,
 .memorySize = mem[i].memoryRequirements.size,
 };
 
-av_log(log, AV_LOG_VERBOSE, "Allocating %"SIZE_SPECIFIER" bytes in 
bind index %i for video session\n",
+av_log(log, AV_LOG_VERBOSE, "Allocating %"PRIu64" bytes in bind index 
%i for video session\n",
bind_mem[i].memorySize, bind_mem[i].memoryBindIndex);
 }
 
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support

2023-11-17 Thread Jun Zhao
Add sps_multilayer_extensio support.

Signed-off-by: Jun Zhao 
---
 libavcodec/cbs_h265.h |  3 +++
 libavcodec/cbs_h265_syntax_template.c | 12 +++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h
index 1b1195f198..15951269fd 100644
--- a/libavcodec/cbs_h265.h
+++ b/libavcodec/cbs_h265.h
@@ -330,6 +330,9 @@ typedef struct H265RawSPS {
 uint8_t persistent_rice_adaptation_enabled_flag;
 uint8_t cabac_bypass_alignment_enabled_flag;
 
+// Multilayer extension.
+uint8_t inter_view_mv_vert_constraint_flag;
+
 // Screen content coding extension.
 uint8_t sps_curr_pic_ref_enabled_flag;
 uint8_t palette_mode_enabled_flag;
diff --git a/libavcodec/cbs_h265_syntax_template.c 
b/libavcodec/cbs_h265_syntax_template.c
index 2d4b954718..1e3bc1acd8 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -717,6 +717,16 @@ static int FUNC(sps_range_extension)(CodedBitstreamContext 
*ctx, RWContext *rw,
 return 0;
 }
 
+static int FUNC(sps_multilayer_extension)(CodedBitstreamContext *ctx, 
RWContext *rw,
+  H265RawSPS *current)
+{
+int err;
+
+flag(inter_view_mv_vert_constraint_flag);
+
+return 0;
+}
+
 static int FUNC(sps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
H265RawSPS *current)
 {
@@ -952,7 +962,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext 
*rw,
 if (current->sps_range_extension_flag)
 CHECK(FUNC(sps_range_extension)(ctx, rw, current));
 if (current->sps_multilayer_extension_flag)
-return AVERROR_PATCHWELCOME;
+CHECK(FUNC(sps_multilayer_extension)(ctx, rw, current));
 if (current->sps_3d_extension_flag)
 return AVERROR_PATCHWELCOME;
 if (current->sps_scc_extension_flag)
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 2/2] lavc/cbs_h265: Add pps_multilayer_extension support

2023-11-17 Thread Jun Zhao
Add pps_multilayer_extensio support.

Signed-off-by: Jun Zhao 
---
 libavcodec/cbs_h265.h | 28 
 libavcodec/cbs_h265_syntax_template.c | 48 ++-
 2 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h
index 15951269fd..d83dc97072 100644
--- a/libavcodec/cbs_h265.h
+++ b/libavcodec/cbs_h265.h
@@ -421,6 +421,34 @@ typedef struct H265RawPPS {
 uint8_t log2_sao_offset_scale_luma;
 uint8_t log2_sao_offset_scale_chroma;
 
+// Multilayer extension
+uint8_t poc_reset_info_present_flag;
+uint8_t pps_infer_scaling_list_flag;
+uint8_t pps_scaling_list_ref_layer_id;
+uint8_t num_ref_loc_offsets;
+uint8_t ref_loc_offset_layer_id[HEVC_MAX_LAYERS];
+
+uint8_t scaled_ref_layer_offset_present_flag[HEVC_MAX_LAYERS];
+int16_t scaled_ref_layer_left_offset[HEVC_MAX_LAYERS];
+int16_t scaled_ref_layer_top_offset[HEVC_MAX_LAYERS];
+int16_t scaled_ref_layer_right_offset[HEVC_MAX_LAYERS];
+int16_t scaled_ref_layer_bottom_offset[HEVC_MAX_LAYERS];
+
+uint8_t ref_region_offset_present_flag[HEVC_MAX_LAYERS];
+int16_t ref_region_left_offset[HEVC_MAX_LAYERS];
+int16_t ref_region_top_offset[HEVC_MAX_LAYERS];
+int16_t ref_region_right_offset[HEVC_MAX_LAYERS];
+int16_t ref_region_bottom_offset[HEVC_MAX_LAYERS];
+
+uint8_t resample_phase_set_present_flag[HEVC_MAX_LAYERS];
+uint8_t phase_hor_luma[HEVC_MAX_LAYERS];
+uint8_t phase_ver_luma[HEVC_MAX_LAYERS];
+uint8_t phase_hor_chroma_plus8[HEVC_MAX_LAYERS];
+uint8_t phase_ver_chroma_plus8[HEVC_MAX_LAYERS];
+
+uint8_t colour_mapping_enabled_flag;
+// TODO: colour_mapping_table
+
 // Screen content coding extension.
 uint8_t pps_curr_pic_ref_enabled_flag;
 uint8_t residual_adaptive_colour_transform_enabled_flag;
diff --git a/libavcodec/cbs_h265_syntax_template.c 
b/libavcodec/cbs_h265_syntax_template.c
index 1e3bc1acd8..de8b838209 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -1003,6 +1003,52 @@ static int 
FUNC(pps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw,
 return 0;
 }
 
+static int FUNC(pps_multilayer_extension)(CodedBitstreamContext *ctx, 
RWContext *rw,
+  H265RawPPS *current)
+{
+int err, i, index;
+
+flag(poc_reset_info_present_flag);
+flag(pps_infer_scaling_list_flag);
+if (current->pps_infer_scaling_list_flag)
+ub(6, pps_scaling_list_ref_layer_id);
+ue(num_ref_loc_offsets, 0, HEVC_MAX_LAYERS);
+
+for (i=0; inum_ref_loc_offsets; i++) {
+ub(6, ref_loc_offset_layer_id[i]);
+index = current->ref_loc_offset_layer_id[i];
+
+flag(scaled_ref_layer_offset_present_flag[i]);
+if (current->scaled_ref_layer_offset_present_flag[i]) {
+se(scaled_ref_layer_left_offset[index],-16383, +16384);
+se(scaled_ref_layer_top_offset[index], -16383, +16384);
+se(scaled_ref_layer_right_offset[index],   -16383, +16384);
+se(scaled_ref_layer_bottom_offset[index],  -16383, +16384);
+}
+
+flag(ref_region_offset_present_flag[i]);
+if (current->ref_region_offset_present_flag[i]) {
+se(ref_region_left_offset[index],-16383, +16384);
+se(ref_region_top_offset[index], -16383, +16384);
+se(ref_region_right_offset[index],   -16383, +16384);
+se(ref_region_bottom_offset[index],  -16383, +16384);
+}
+
+flag(resample_phase_set_present_flag[i]);
+if (current->resample_phase_set_present_flag[i]) {
+ue(phase_hor_luma[index],   0, 31);
+ue(phase_ver_luma[index],   0, 31);
+ue(phase_hor_chroma_plus8[index],   0, 63);
+ue(phase_ver_chroma_plus8[index],   0, 63);
+}
+}
+
+flag(colour_mapping_enabled_flag);
+if (current->colour_mapping_enabled_flag)
+return AVERROR_PATCHWELCOME;
+return 0;
+}
+
 static int FUNC(pps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
H265RawPPS *current)
 {
@@ -1153,7 +1199,7 @@ static int FUNC(pps)(CodedBitstreamContext *ctx, 
RWContext *rw,
 if (current->pps_range_extension_flag)
 CHECK(FUNC(pps_range_extension)(ctx, rw, current));
 if (current->pps_multilayer_extension_flag)
-return AVERROR_PATCHWELCOME;
+CHECK(FUNC(pps_multilayer_extension)(ctx, rw, current));
 if (current->pps_3d_extension_flag)
 return AVERROR_PATCHWELCOME;
 if (current->pps_scc_extension_flag)
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] lavfi/Makefile: fix vf_cropdetect missed edge_common

2023-11-17 Thread Jun Zhao
fix #10664

vf_cropdetect depends on edge_common, it's missing in Makefile

Signed-off-by: Jun Zhao 
---
 libavfilter/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 603b532ad0..de51c2a403 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -255,7 +255,7 @@ OBJS-$(CONFIG_COREIMAGE_FILTER)  += 
vf_coreimage.o
 OBJS-$(CONFIG_CORR_FILTER)   += vf_corr.o framesync.o
 OBJS-$(CONFIG_COVER_RECT_FILTER) += vf_cover_rect.o lavfutils.o
 OBJS-$(CONFIG_CROP_FILTER)   += vf_crop.o
-OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o
+OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o edge_common.o
 OBJS-$(CONFIG_CUE_FILTER)+= f_cue.o
 OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o
 OBJS-$(CONFIG_DATASCOPE_FILTER)  += vf_datascope.o
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH V1 2/2] lavf/flvdec: Cosmetics: Fix indentation for flv_read_packet

2019-03-26 Thread Jun Zhao
From: Jun Zhao 

Commit e34ba5ec53b missed the indent

Signed-off-by: Jun Zhao 
---
 libavformat/flvdec.c |  244 +-
 1 files changed, 122 insertions(+), 122 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index b1e13da..445d58d 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -986,144 +986,144 @@ static int flv_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 
 retry:
 /* pkt size is repeated at end. skip it */
-pos  = avio_tell(s->pb);
-type = (avio_r8(s->pb) & 0x1F);
-orig_size =
-size = avio_rb24(s->pb);
-flv->sum_flv_tag_size += size + 11;
-dts  = avio_rb24(s->pb);
-dts |= (unsigned)avio_r8(s->pb) << 24;
-av_log(s, AV_LOG_TRACE, "type:%d, size:%d, last:%d, dts:%"PRId64" 
pos:%"PRId64"\n", type, size, last, dts, avio_tell(s->pb));
-if (avio_feof(s->pb))
-return AVERROR_EOF;
-avio_skip(s->pb, 3); /* stream id, always 0 */
-flags = 0;
-
-if (flv->validate_next < flv->validate_count) {
-int64_t validate_pos = flv->validate_index[flv->validate_next].pos;
-if (pos == validate_pos) {
-if (FFABS(dts - flv->validate_index[flv->validate_next].dts) <=
-VALIDATE_INDEX_TS_THRESH) {
-flv->validate_next++;
-} else {
-clear_index_entries(s, validate_pos);
-flv->validate_count = 0;
-}
-} else if (pos > validate_pos) {
+pos  = avio_tell(s->pb);
+type = (avio_r8(s->pb) & 0x1F);
+orig_size =
+size = avio_rb24(s->pb);
+flv->sum_flv_tag_size += size + 11;
+dts  = avio_rb24(s->pb);
+dts |= (unsigned)avio_r8(s->pb) << 24;
+av_log(s, AV_LOG_TRACE, "type:%d, size:%d, last:%d, dts:%"PRId64" 
pos:%"PRId64"\n", type, size, last, dts, avio_tell(s->pb));
+if (avio_feof(s->pb))
+return AVERROR_EOF;
+avio_skip(s->pb, 3); /* stream id, always 0 */
+flags = 0;
+
+if (flv->validate_next < flv->validate_count) {
+int64_t validate_pos = flv->validate_index[flv->validate_next].pos;
+if (pos == validate_pos) {
+if (FFABS(dts - flv->validate_index[flv->validate_next].dts) <=
+VALIDATE_INDEX_TS_THRESH) {
+flv->validate_next++;
+} else {
 clear_index_entries(s, validate_pos);
 flv->validate_count = 0;
 }
+} else if (pos > validate_pos) {
+clear_index_entries(s, validate_pos);
+flv->validate_count = 0;
 }
+}
 
-if (size == 0) {
-ret = FFERROR_REDO;
-goto leave;
-}
+if (size == 0) {
+ret = FFERROR_REDO;
+goto leave;
+}
 
-next = size + avio_tell(s->pb);
-
-if (type == FLV_TAG_TYPE_AUDIO) {
-stream_type = FLV_STREAM_TYPE_AUDIO;
-flags= avio_r8(s->pb);
-size--;
-} else if (type == FLV_TAG_TYPE_VIDEO) {
-stream_type = FLV_STREAM_TYPE_VIDEO;
-flags= avio_r8(s->pb);
-size--;
-if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_VIDEO_INFO_CMD)
-goto skip;
-} else if (type == FLV_TAG_TYPE_META) {
-stream_type=FLV_STREAM_TYPE_SUBTITLE;
-if (size > 13 + 1 + 4) { // Header-type metadata stuff
-int type;
-meta_pos = avio_tell(s->pb);
-type = flv_read_metabody(s, next);
-if (type == 0 && dts == 0 || type < 0) {
-if (type < 0 && flv->validate_count &&
-flv->validate_index[0].pos > next &&
-flv->validate_index[0].pos - 4 < next
-) {
-av_log(s, AV_LOG_WARNING, "Adjusting next position due 
to index mismatch\n");
-next = flv->validate_index[0].pos - 4;
-}
-goto skip;
-} else if (type == TYPE_ONTEXTDATA) {
-avpriv_request_sample(s, "OnTextData packet");
-return flv_data_packet(s, pkt, dts, next);
-} else if (type == TYPE_ONCAPTION) {
-return flv_data_packet(s, pkt, dts, next);
-} else if (type == TYPE_UNKNOWN) {
-stream_type = FLV_STREAM_TYPE_DATA;
+next = size + avio_tell(s->pb);
+
+if (type == FLV_TAG_TYPE_AUDIO) {
+stream_type = FLV_STREAM_TYPE_AUDIO;
+flags= avio_r8(s->pb);

[FFmpeg-devel] [PATCH V1 1/2] lavf/flvdec: add AMF date type support

2019-03-26 Thread Jun Zhao
From: Jun Zhao 

Support AMF date type when parse the FLV metadata.

Signed-off-by: Jun Zhao 
---
 libavformat/flvdec.c |   24 ++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index c4d5278..b1e13da 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -30,6 +30,7 @@
 #include "libavutil/opt.h"
 #include "libavutil/intfloat.h"
 #include "libavutil/mathematics.h"
+#include "libavutil/time_internal.h"
 #include "libavcodec/bytestream.h"
 #include "libavcodec/mpeg4audio.h"
 #include "avformat.h"
@@ -77,6 +78,12 @@ typedef struct FLVContext {
 int64_t time_pos;
 } FLVContext;
 
+/* AMF date type */
+typedef struct amf_date {
+double   milliseconds;
+int16_t  timezone;
+} amf_date;
+
 static int probe(const AVProbeData *p, int live)
 {
 const uint8_t *d = p->buf;
@@ -471,6 +478,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
 AMFDataType amf_type;
 char str_val[1024];
 double num_val;
+amf_date date;
 
 num_val  = 0;
 ioc  = s->pb;
@@ -542,7 +550,9 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
 }
 break;
 case AMF_DATA_TYPE_DATE:
-avio_skip(ioc, 8 + 2);  // timestamp (double) and UTC offset (int16)
+// timestamp (double) and UTC offset (int16)
+date.milliseconds = av_int2double(avio_rb64(ioc));
+date.timezone = avio_rb16(ioc);
 break;
 default:// unsupported type, we couldn't skip
 av_log(s, AV_LOG_ERROR, "unsupported amf type %d\n", amf_type);
@@ -641,8 +651,18 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
 } else if (amf_type == AMF_DATA_TYPE_NUMBER) {
 snprintf(str_val, sizeof(str_val), "%.f", num_val);
 av_dict_set(&s->metadata, key, str_val, 0);
-} else if (amf_type == AMF_DATA_TYPE_STRING)
+} else if (amf_type == AMF_DATA_TYPE_STRING) {
 av_dict_set(&s->metadata, key, str_val, 0);
+} else if (amf_type == AMF_DATA_TYPE_DATE) {
+time_t time;
+struct tm t;
+char datestr[128];
+time =  date.milliseconds / 1000; // to seconds
+localtime_r(&time, &t);
+strftime(datestr, sizeof(datestr), "%a, %d %b %Y %H:%M:%S %z", &t);
+
+av_dict_set(&s->metadata, key, datestr, 0);
+}
 }
 
 return 0;
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] lavf/flvdec: Fix AMF NUMBER type to metadata lost precision

2019-03-28 Thread Jun Zhao
From: Jun Zhao 

use %.12g replace %.f when save AMF NUMBER(double) type to
metadata.

before this fix, we get FLV metadata like:

 Metadata:
lasttimestamp   : 113
lastkeyframetimestamp: 112

after this fix:

 Metadata:
lasttimestamp   : 113.005
lastkeyframetimestamp: 111.678

Signed-off-by: Jun Zhao 
---
 libavformat/flvdec.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 445d58d..12bfd4b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -649,7 +649,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
sizeof(str_val));
 av_dict_set(&s->metadata, key, str_val, 0);
 } else if (amf_type == AMF_DATA_TYPE_NUMBER) {
-snprintf(str_val, sizeof(str_val), "%.f", num_val);
+snprintf(str_val, sizeof(str_val), "%.12g", num_val);
 av_dict_set(&s->metadata, key, str_val, 0);
 } else if (amf_type == AMF_DATA_TYPE_STRING) {
 av_dict_set(&s->metadata, key, str_val, 0);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] fate/flv-add_keyframe_index: Update fate after last commit

2019-03-28 Thread Jun Zhao
From: Jun Zhao 

Update fate ref after last commit

Signed-off-by: Jun Zhao 
---
 tests/ref/fate/flv-add_keyframe_index |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/ref/fate/flv-add_keyframe_index 
b/tests/ref/fate/flv-add_keyframe_index
index 1c4da65..ce3809e 100644
--- a/tests/ref/fate/flv-add_keyframe_index
+++ b/tests/ref/fate/flv-add_keyframe_index
@@ -7,6 +7,6 @@ canSeekToEnd=true
 datasize=629776
 videosize=629381
 audiosize=0
-lasttimestamp=20
+lasttimestamp=19.8571428571
 lastkeyframetimestamp=19
 lastkeyframelocation=597963
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2] lavf/flvdec: Fix AMF NUMBER type to metadata lost precision

2019-03-28 Thread Jun Zhao
From: Jun Zhao 

Use %.12g replace %.f when save AMF NUMBER(double) type to
metadata. And update fate ref.

before this fix, we get FLV metadata like:

 Metadata:
lasttimestamp   : 113
lastkeyframetimestamp: 112

after this fix:

 Metadata:
lasttimestamp   : 113.005
lastkeyframetimestamp: 111.678

Signed-off-by: Jun Zhao 
---
 libavformat/flvdec.c  |2 +-
 tests/ref/fate/flv-add_keyframe_index |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 445d58d..12bfd4b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -649,7 +649,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
sizeof(str_val));
 av_dict_set(&s->metadata, key, str_val, 0);
 } else if (amf_type == AMF_DATA_TYPE_NUMBER) {
-snprintf(str_val, sizeof(str_val), "%.f", num_val);
+snprintf(str_val, sizeof(str_val), "%.12g", num_val);
 av_dict_set(&s->metadata, key, str_val, 0);
 } else if (amf_type == AMF_DATA_TYPE_STRING) {
 av_dict_set(&s->metadata, key, str_val, 0);
diff --git a/tests/ref/fate/flv-add_keyframe_index 
b/tests/ref/fate/flv-add_keyframe_index
index 1c4da65..ce3809e 100644
--- a/tests/ref/fate/flv-add_keyframe_index
+++ b/tests/ref/fate/flv-add_keyframe_index
@@ -7,6 +7,6 @@ canSeekToEnd=true
 datasize=629776
 videosize=629381
 audiosize=0
-lasttimestamp=20
+lasttimestamp=19.8571428571
 lastkeyframetimestamp=19
 lastkeyframelocation=597963
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1] lavf/hashenc: Correct the hash/MD5 muxer class name

2019-03-29 Thread Jun Zhao
From: Jun Zhao 

Follow the name style to correct the hash/md5 muxer class name

Signed-off-by: Jun Zhao 
---
 libavformat/hashenc.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c
index a66db4a..06fc085 100644
--- a/libavformat/hashenc.c
+++ b/libavformat/hashenc.c
@@ -88,7 +88,7 @@ static int hash_write_trailer(struct AVFormatContext *s)
 
 #if CONFIG_HASH_MUXER
 static const AVClass hashenc_class = {
-.class_name = "hash encoder class",
+.class_name = "hash muxer",
 .item_name  = av_default_item_name,
 .option = hash_options,
 .version= LIBAVUTIL_VERSION_INT,
@@ -111,7 +111,7 @@ AVOutputFormat ff_hash_muxer = {
 
 #if CONFIG_MD5_MUXER
 static const AVClass md5enc_class = {
-.class_name = "MD5 encoder class",
+.class_name = "MD5 muxer",
 .item_name  = av_default_item_name,
 .option = md5_options,
 .version= LIBAVUTIL_VERSION_INT,
@@ -217,7 +217,7 @@ static int framehash_write_trailer(struct AVFormatContext 
*s)
 
 #if CONFIG_FRAMEHASH_MUXER
 static const AVClass framehash_class = {
-.class_name = "frame hash encoder class",
+.class_name = "frame hash muxer",
 .item_name  = av_default_item_name,
 .option = hash_options,
 .version= LIBAVUTIL_VERSION_INT,
@@ -240,7 +240,7 @@ AVOutputFormat ff_framehash_muxer = {
 
 #if CONFIG_FRAMEMD5_MUXER
 static const AVClass framemd5_class = {
-.class_name = "frame hash encoder class",
+.class_name = "frame MD5 muxer",
 .item_name  = av_default_item_name,
 .option = md5_options,
 .version= LIBAVUTIL_VERSION_INT,
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1] doc/examples/metadata: fix the example can't dump FLV metadata

2019-04-03 Thread Jun Zhao
From: Jun Zhao 

fix the example can't dump FLV metadata.

Signed-off-by: Jun Zhao 
---
 doc/examples/metadata.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/doc/examples/metadata.c b/doc/examples/metadata.c
index e330d07..b6cfa6b 100644
--- a/doc/examples/metadata.c
+++ b/doc/examples/metadata.c
@@ -47,6 +47,11 @@ int main (int argc, char **argv)
 if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL)))
 return ret;
 
+if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) {
+av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
+return ret;
+}
+
 while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, 
AV_DICT_IGNORE_SUFFIX)))
 printf("%s=%s\n", tag->key, tag->value);
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1] lavf/matroskaenc: Fix memory leak after write trailer

2019-04-04 Thread Jun Zhao
From: Jun Zhao 

Fix memory leak after write trailer for #7827

Signed-off-by: Jun Zhao 
---
 libavformat/matroskaenc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index b9f99c4..22ba93a 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -2571,13 +2571,13 @@ static int mkv_write_trailer(AVFormatContext *s)
 // check if we have an audio packet cached
 if (mkv->cur_audio_pkt.size > 0) {
 ret = mkv_write_packet_internal(s, &mkv->cur_audio_pkt, 0);
-av_packet_unref(&mkv->cur_audio_pkt);
 if (ret < 0) {
 av_log(s, AV_LOG_ERROR,
"Could not write cached audio packet ret:%d\n", ret);
 return ret;
 }
 }
+av_packet_unref(&mkv->cur_audio_pkt);
 
 if (mkv->dyn_bc) {
 end_ebml_master_crc32(pb, &mkv->dyn_bc, mkv, mkv->cluster);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2] lavf/matroskaenc: Fix memory leak after write trailer

2019-04-04 Thread Jun Zhao
From: Jun Zhao 

Fix memory leak after write trailer for #7827, only store a audio
packet whose buffer has size greater than zero in cur_audio_pkt.

Thanks to Andreas Rheinhardt for the suggestions.

Signed-off-by: Jun Zhao 
---
 libavformat/matroskaenc.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index b9f99c4..06f3aeb 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -2534,7 +2534,8 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 // buffer an audio packet to ensure the packet containing the video
 // keyframe's timecode is contained in the same cluster for WebM
 if (codec_type == AVMEDIA_TYPE_AUDIO) {
-ret = av_packet_ref(&mkv->cur_audio_pkt, pkt);
+if (pkt->size > 0)
+ret = av_packet_ref(&mkv->cur_audio_pkt, pkt);
 } else
 ret = mkv_write_packet_internal(s, pkt, 0);
 return ret;
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] lavf/hls: Cleanup the applehttp

2019-04-12 Thread Jun Zhao
From: Jun Zhao 

Cleanup the applehttp as demuxer name, when use the command :

ffmpeg -formats, get the confused information like:
"
 E hls Apple HTTP Live Streaming
D  hls,applehttp   Apple HTTP Live Streaming
"
we don't use applehttp as the demuxer/muxer name usually, so
cleanup the applehttp and update the documents.

After the change, get the information from "ffmpeg -formats":
"
DE hls Apple HTTP Live Streaming
"

Signed-off-by: Jun Zhao 
---
 doc/demuxers.texi |   20 +---
 libavformat/hls.c |4 ++--
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 2b0b37b..57d1532 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -25,17 +25,6 @@ Audible Format 2, 3, and 4 demuxer.
 
 This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
 
-@section applehttp
-
-Apple HTTP Live Streaming demuxer.
-
-This demuxer presents all AVStreams from all variant streams.
-The id field is set to the bitrate variant index number. By setting
-the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
-the caller can decide which variant streams to actually receive.
-The total bitrate of the variant that the stream belongs to is
-available in a metadata key named "variant_bitrate".
-
 @section apng
 
 Animated Portable Network Graphics demuxer.
@@ -320,6 +309,15 @@ infinitely.
 
 HLS demuxer
 
+Apple HTTP Live Streaming demuxer.
+
+This demuxer presents all AVStreams from all variant streams.
+The id field is set to the bitrate variant index number. By setting
+the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
+the caller can decide which variant streams to actually receive.
+The total bitrate of the variant that the stream belongs to is
+available in a metadata key named "variant_bitrate".
+
 It accepts the following options:
 
 @table @option
diff --git a/libavformat/hls.c b/libavformat/hls.c
index f4e4498..1b61b4b 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -2318,14 +2318,14 @@ static const AVOption hls_options[] = {
 };
 
 static const AVClass hls_class = {
-.class_name = "hls,applehttp",
+.class_name = "hls demuxer",
 .item_name  = av_default_item_name,
 .option = hls_options,
 .version= LIBAVUTIL_VERSION_INT,
 };
 
 AVInputFormat ff_hls_demuxer = {
-.name   = "hls,applehttp",
+.name   = "hls",
 .long_name  = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
 .priv_class = &hls_class,
 .priv_data_size = sizeof(HLSContext),
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] lavf/vc1test: Remove the extensions field.

2019-04-12 Thread Jun Zhao
From: Jun Zhao 

Now if extensions are defined, then no probe is done, so remove the
extensions in vc1test demuxer.

Signed-off-by: Jun Zhao 
---
 libavformat/vc1test.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/libavformat/vc1test.c b/libavformat/vc1test.c
index 3c67793..b350232 100644
--- a/libavformat/vc1test.c
+++ b/libavformat/vc1test.c
@@ -122,6 +122,5 @@ AVInputFormat ff_vc1t_demuxer = {
 .read_probe = vc1t_probe,
 .read_header= vc1t_read_header,
 .read_packet= vc1t_read_packet,
-.extensions = "rcv",
 .flags  = AVFMT_GENERIC_INDEX,
 };
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1] avformat/avformat.h: correct the comment for AVInputFormat.extensions

2019-04-12 Thread Jun Zhao
From: Jun Zhao 

Now the probe logic is: Only read_probe is NULL and extensions are defined,
then no probe is done. Correct the comment to follow the coding logic.

Signed-off-by: Jun Zhao 
---
 libavformat/avformat.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 734ae54..bbfa61d 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -659,8 +659,8 @@ typedef struct AVInputFormat {
 int flags;
 
 /**
- * If extensions are defined, then no probe is done. You should
- * usually not use extension format guessing because it is not
+ * If read_probe is NULL and extensions are defined, then no probe is done.
+ * You should usually not use extension format guessing because it is not
  * reliable enough
  */
 const char *extensions;
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1] lavf/oggparsevorbis: Fix change the case of metadata keys issue

2019-04-14 Thread Jun Zhao
From: Jun Zhao 

The spec in https://xiph.org/vorbis/doc/v-comment.html states that
the metadata keys are case-insensitive, so don't change the case
and update the fate test case.

Fix #7784

Signed-off-by: Jun Zhao 
---
 libavformat/oggparsevorbis.c |9 -
 tests/ref/fate/limited_input_seek|2 +-
 tests/ref/fate/limited_input_seek-copyts |2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index bcfd246..c3c8d38 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -44,7 +44,7 @@ static int ogm_chapter(AVFormatContext *as, uint8_t *key, 
uint8_t *val)
 int i, cnum, h, m, s, ms, keylen = strlen(key);
 AVChapter *chapter = NULL;
 
-if (keylen < 9 || sscanf(key, "CHAPTER%03d", &cnum) != 1)
+if (keylen < 9 || (av_strcasecmp(key, "CHAPTER")!=0 && sscanf(key+7, 
"%03d", &cnum) != 1))
 return 0;
 
 if (keylen <= 10) {
@@ -55,7 +55,7 @@ static int ogm_chapter(AVFormatContext *as, uint8_t *key, 
uint8_t *val)
ms + 1000 * (s + 60 * (m + 60 * h)),
AV_NOPTS_VALUE, NULL);
 av_free(val);
-} else if (!strcmp(key + keylen - 4, "NAME")) {
+} else if (!av_strcasecmp(key + keylen - 4, "NAME")) {
 for (i = 0; i < as->nb_chapters; i++)
 if (as->chapters[i]->id == cnum) {
 chapter = as->chapters[i];
@@ -91,7 +91,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
 const uint8_t *p   = buf;
 const uint8_t *end = buf + size;
 int updates= 0;
-unsigned n, j;
+unsigned n;
 int s;
 
 /* must have vendor_length and user_comment_list_length */
@@ -139,8 +139,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
 return AVERROR(ENOMEM);
 }
 
-for (j = 0; j < tl; j++)
-tt[j] = av_toupper(t[j]);
+memcpy(tt, t, tl);
 tt[tl] = 0;
 
 memcpy(ct, v, vl);
diff --git a/tests/ref/fate/limited_input_seek 
b/tests/ref/fate/limited_input_seek
index e0c4bf1..3269dce 100644
--- a/tests/ref/fate/limited_input_seek
+++ b/tests/ref/fate/limited_input_seek
@@ -1 +1 @@
-20a1bb9a1cfb23c1fe86f14e6065cd95
+ae878bdaec23f36a63d142165fe57f49
diff --git a/tests/ref/fate/limited_input_seek-copyts 
b/tests/ref/fate/limited_input_seek-copyts
index 92790a8..6eeaef8 100644
--- a/tests/ref/fate/limited_input_seek-copyts
+++ b/tests/ref/fate/limited_input_seek-copyts
@@ -1 +1 @@
-ec3604b1954ed80de364b8ef491771ce
+ffe8a674bdf38e4f650f91963debc654
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] lavf: bump version/add Changelog entry when cleanup applehttp

2019-04-15 Thread Jun Zhao
From: Jun Zhao 

commit abfeba9 "lavf/hls: Cleanup the applehttp" missed
the version bump and Changelog entry.

Signed-off-by: Jun Zhao 
---
 Changelog |1 +
 libavformat/version.h |2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Changelog b/Changelog
index 5b2b1e5..2930471 100644
--- a/Changelog
+++ b/Changelog
@@ -24,6 +24,7 @@ version :
 - KUX demuxer
 - AV1 frame split bitstream filter
 - lscr decoder
+- cleanup applehttp in hls demuxer
 
 
 version 4.1:
diff --git a/libavformat/version.h b/libavformat/version.h
index d57c151..150a72e 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -33,7 +33,7 @@
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  58
 #define LIBAVFORMAT_VERSION_MINOR  27
-#define LIBAVFORMAT_VERSION_MICRO 102
+#define LIBAVFORMAT_VERSION_MICRO 103
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] lavf/hls: Remove HLSContext.strict_std_compliance field

2019-04-15 Thread Jun Zhao
From: Jun Zhao 

After the commit 9f61abc8111, we can use AVFormatContext.strict_std_compliance
instead of HLSContext.strict_std_compliance to avoid the code redundancy.

Signed-off-by: Jun Zhao 
---
 libavformat/hls.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 1b61b4b..19ea88e 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -203,7 +203,6 @@ typedef struct HLSContext {
 int64_t cur_timestamp;
 AVIOInterruptCB *interrupt_callback;
 AVDictionary *avio_opts;
-int strict_std_compliance;
 char *allowed_extensions;
 int max_reload;
 int http_persistent;
@@ -485,7 +484,7 @@ static struct rendition *new_rendition(HLSContext *c, 
struct rendition_info *inf
 return NULL;
 
 /* TODO: handle subtitles (each segment has to parsed separately) */
-if (c->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL)
+if (c->ctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL)
 if (type == AVMEDIA_TYPE_SUBTITLE)
 return NULL;
 
@@ -1786,7 +1785,6 @@ static int hls_read_header(AVFormatContext *s)
 
 c->ctx= s;
 c->interrupt_callback = &s->interrupt_callback;
-c->strict_std_compliance = s->strict_std_compliance;
 
 c->first_packet = 1;
 c->first_timestamp = AV_NOPTS_VALUE;
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2] *** SUBJECT HERE ***

2019-04-16 Thread Jun Zhao
V2: -Fix logic error and use av_strncasecmp, Tks Michael's comments

Jun Zhao (1):
  lavf/oggparsevorbis: Fix change the case of metadata keys issue

 libavformat/oggparsevorbis.c |9 -
 tests/ref/fate/limited_input_seek|2 +-
 tests/ref/fate/limited_input_seek-copyts |2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2] lavf/oggparsevorbis: Fix change the case of metadata keys issue

2019-04-16 Thread Jun Zhao
From: Jun Zhao 

The spec in https://xiph.org/vorbis/doc/v-comment.html states that
the metadata keys are case-insensitive, so don't change the case
and update the fate test case.

Fix #7784

Signed-off-by: Jun Zhao 
---
 libavformat/oggparsevorbis.c |9 -
 tests/ref/fate/limited_input_seek|2 +-
 tests/ref/fate/limited_input_seek-copyts |2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index bcfd246..43f05f9 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -44,7 +44,7 @@ static int ogm_chapter(AVFormatContext *as, uint8_t *key, 
uint8_t *val)
 int i, cnum, h, m, s, ms, keylen = strlen(key);
 AVChapter *chapter = NULL;
 
-if (keylen < 9 || sscanf(key, "CHAPTER%03d", &cnum) != 1)
+if (keylen < 9 || av_strncasecmp(key, "CHAPTER", 7) || sscanf(key+7, 
"%03d", &cnum) != 1)
 return 0;
 
 if (keylen <= 10) {
@@ -55,7 +55,7 @@ static int ogm_chapter(AVFormatContext *as, uint8_t *key, 
uint8_t *val)
ms + 1000 * (s + 60 * (m + 60 * h)),
AV_NOPTS_VALUE, NULL);
 av_free(val);
-} else if (!strcmp(key + keylen - 4, "NAME")) {
+} else if (!av_strcasecmp(key + keylen - 4, "NAME")) {
 for (i = 0; i < as->nb_chapters; i++)
 if (as->chapters[i]->id == cnum) {
 chapter = as->chapters[i];
@@ -91,7 +91,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
 const uint8_t *p   = buf;
 const uint8_t *end = buf + size;
 int updates= 0;
-unsigned n, j;
+unsigned n;
 int s;
 
 /* must have vendor_length and user_comment_list_length */
@@ -139,8 +139,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
 return AVERROR(ENOMEM);
 }
 
-for (j = 0; j < tl; j++)
-tt[j] = av_toupper(t[j]);
+memcpy(tt, t, tl);
 tt[tl] = 0;
 
 memcpy(ct, v, vl);
diff --git a/tests/ref/fate/limited_input_seek 
b/tests/ref/fate/limited_input_seek
index e0c4bf1..3269dce 100644
--- a/tests/ref/fate/limited_input_seek
+++ b/tests/ref/fate/limited_input_seek
@@ -1 +1 @@
-20a1bb9a1cfb23c1fe86f14e6065cd95
+ae878bdaec23f36a63d142165fe57f49
diff --git a/tests/ref/fate/limited_input_seek-copyts 
b/tests/ref/fate/limited_input_seek-copyts
index 92790a8..6eeaef8 100644
--- a/tests/ref/fate/limited_input_seek-copyts
+++ b/tests/ref/fate/limited_input_seek-copyts
@@ -1 +1 @@
-ec3604b1954ed80de364b8ef491771ce
+ffe8a674bdf38e4f650f91963debc654
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2] lavf: bump version/add APIchanges entry when cleanup applehttp

2019-04-16 Thread Jun Zhao
From: Jun Zhao 

commit abfeba9 "lavf/hls: Cleanup the applehttp" missed
the version bump and APIchanges entry.

Signed-off-by: Jun Zhao 
---
 doc/APIchanges|3 +++
 libavformat/version.h |2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 784a5e5..7ed433f 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
+2019-04-12 - abfeba9724 - lavf 58.27.102
+  Rename hls,applehttp demuxer to hls
+
 2019-01-27 - XX - lavc 58.46.100 - avcodec.h
   Add discard_damaged_percentage
 
diff --git a/libavformat/version.h b/libavformat/version.h
index d57c151..150a72e 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -33,7 +33,7 @@
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  58
 #define LIBAVFORMAT_VERSION_MINOR  27
-#define LIBAVFORMAT_VERSION_MICRO 102
+#define LIBAVFORMAT_VERSION_MICRO 103
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] lavf/frei0r: Fixes the compilation warnings

2019-04-21 Thread Jun Zhao
From: Jun Zhao 

Fixes the compilation warnings

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_frei0r.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index c775ed1..165fbd7 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -127,7 +127,7 @@ static int set_param(AVFilterContext *ctx, f0r_param_info_t 
info, int index, cha
 break;
 
 case F0R_PARAM_STRING:
-val.str = param;
+val.str = (f0r_param_string *)param;
 break;
 }
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] examples/avio_reading: Use avio_context_free() to free AVIOContext

2019-04-21 Thread Jun Zhao
From: Jun Zhao 

Signed-off-by: Jun Zhao 
---
 doc/examples/avio_reading.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/examples/avio_reading.c b/doc/examples/avio_reading.c
index cbfeb17..36ee02a 100644
--- a/doc/examples/avio_reading.c
+++ b/doc/examples/avio_reading.c
@@ -117,11 +117,12 @@ int main(int argc, char *argv[])
 
 end:
 avformat_close_input(&fmt_ctx);
+
 /* note: the internal buffer could have changed, and be != avio_ctx_buffer 
*/
-if (avio_ctx) {
+if (avio_ctx)
 av_freep(&avio_ctx->buffer);
-av_freep(&avio_ctx);
-}
+avio_context_free(&avio_ctx);
+
 av_file_unmap(buffer, buffer_size);
 
 if (ret < 0) {
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2] lavfi/frei0r: Fixes the compilation warnings

2019-04-21 Thread Jun Zhao
From: Jun Zhao 

Fixes the compilation warnings

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_frei0r.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index c775ed1..165fbd7 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -127,7 +127,7 @@ static int set_param(AVFilterContext *ctx, f0r_param_info_t 
info, int index, cha
 break;
 
 case F0R_PARAM_STRING:
-val.str = param;
+val.str = (f0r_param_string *)param;
 break;
 }
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 0/2] Use avctx->framerate first for frame rate setting

2019-04-27 Thread Jun Zhao
perfer avctx->framerate first than use avctx->time_base when setting
the frame rate to encoder. 1/time_base is not the average frame rate
if the frame rate is not constant. So perfer avctx->framerate than
1/avctx->time_base if the avctx->framerate is not zero.

Jun Zhao (2):
  lavc/libx264: Use avctx->framerate first for frame rate setting
  lavc/libx265: Use avctx->framerate first for frame rate setting

 libavcodec/libx264.c |9 +++--
 libavcodec/libx265.c |9 +++--
 2 files changed, 14 insertions(+), 4 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] lavc/libx264: Use avctx->framerate first for frame rate setting

2019-04-27 Thread Jun Zhao
From: Jun Zhao 

perfer avctx->framerate first than use avctx->time_base when setting
the frame rate to encoder. 1/time_base is not the average frame rate
if the frame rate is not constant. In this case, we need to setting
avctx->framerate and avctx->time_base both, but avctx->framerate not
equal to 1/(avctx->time_base).

Signed-off-by: Jun Zhao 
---
 libavcodec/libx264.c |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index a3493f3..45d07a9 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -821,8 +821,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
 x4->params.vui.i_sar_height = sh;
 x4->params.i_timebase_den = avctx->time_base.den;
 x4->params.i_timebase_num = avctx->time_base.num;
-x4->params.i_fps_num = avctx->time_base.den;
-x4->params.i_fps_den = avctx->time_base.num * avctx->ticks_per_frame;
+if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
+x4->params.i_fps_num = avctx->framerate.num;
+x4->params.i_fps_den = avctx->framerate.den;
+} else {
+x4->params.i_fps_num = avctx->time_base.den;
+x4->params.i_fps_den = avctx->time_base.num * avctx->ticks_per_frame;
+}
 
 x4->params.analyse.b_psnr = avctx->flags & AV_CODEC_FLAG_PSNR;
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] lavc/libx265: Use avctx->framerate first for frame rate setting

2019-04-27 Thread Jun Zhao
From: Jun Zhao 

perfer avctx->framerate first than use avctx->time_base when setting
the frame rate to encoder. 1/time_base is not the average frame rate
if the frame rate is not constant, so use avctx->framerate if the
value is not zero.

Signed-off-by: Jun Zhao 
---
 libavcodec/libx265.c |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index fe39f45..07bca81 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -110,8 +110,13 @@ static av_cold int libx265_encode_init(AVCodecContext 
*avctx)
 }
 
 ctx->params->frameNumThreads = avctx->thread_count;
-ctx->params->fpsNum  = avctx->time_base.den;
-ctx->params->fpsDenom= avctx->time_base.num * 
avctx->ticks_per_frame;
+if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
+ctx->params->fpsNum  = avctx->framerate.num;
+ctx->params->fpsDenom= avctx->framerate.den;
+} else {
+ctx->params->fpsNum  = avctx->time_base.den;
+ctx->params->fpsDenom= avctx->time_base.num * 
avctx->ticks_per_frame;
+}
 ctx->params->sourceWidth = avctx->width;
 ctx->params->sourceHeight= avctx->height;
 ctx->params->bEnablePsnr = !!(avctx->flags & AV_CODEC_FLAG_PSNR);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 1/3] lavf/cover_rect: Fix logic check issue

2019-05-08 Thread Jun Zhao
From: Jun Zhao 

Fix logic check issue #6741

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_cover_rect.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/vf_cover_rect.c b/libavfilter/vf_cover_rect.c
index f7f6103..41cd1a1 100644
--- a/libavfilter/vf_cover_rect.c
+++ b/libavfilter/vf_cover_rect.c
@@ -152,7 +152,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 }
 
 if (!xendptr || *xendptr || !yendptr || *yendptr ||
-!wendptr || *wendptr || !hendptr || !hendptr
+!wendptr || *wendptr || !hendptr || *hendptr
 ) {
 return ff_filter_frame(ctx->outputs[0], in);
 }
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 3/3] tools/crypto_bench: update the comment about build command

2019-05-08 Thread Jun Zhao
From: Jun Zhao 

commit cd62f9d557f missing the comment about build

Signed-off-by: Jun Zhao 
---
 tools/crypto_bench.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c
index ac9fcc4..0aff4ea 100644
--- a/tools/crypto_bench.c
+++ b/tools/crypto_bench.c
@@ -19,7 +19,7 @@
  */
 
 /* Optional external libraries; can be enabled using:
- * make VERSUS=crypto+gcrypt+tomcrypt tools/crypto_bench */
+ * make VERSUS=crypto+gcrypt+tomcrypt+mbedcrypto tools/crypto_bench */
 #define USE_crypto   0x01/* OpenSSL's libcrypto */
 #define USE_gcrypt   0x02/* GnuTLS's libgcrypt */
 #define USE_tomcrypt 0x04/* LibTomCrypt */
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 2/3] tools/crypto_bench: check malloc fail before using it

2019-05-08 Thread Jun Zhao
From: Jun Zhao 

Need to check malloc fail before using it, so adjust the location
in the code.

Signed-off-by: Jun Zhao 
---
 tools/crypto_bench.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/crypto_bench.c b/tools/crypto_bench.c
index aca8bbb..ac9fcc4 100644
--- a/tools/crypto_bench.c
+++ b/tools/crypto_bench.c
@@ -665,8 +665,8 @@ struct hash_impl implementations[] = {
 
 int main(int argc, char **argv)
 {
-uint8_t *input = av_malloc(MAX_INPUT_SIZE * 2);
-uint8_t *output = input + MAX_INPUT_SIZE;
+uint8_t *input;
+uint8_t *output;
 unsigned i, impl, size;
 int opt;
 
@@ -702,12 +702,14 @@ int main(int argc, char **argv)
 exit(opt != 'h');
 }
 }
-
+input = av_malloc(MAX_INPUT_SIZE * 2);
 if (!input)
 fatal_error("out of memory");
 for (i = 0; i < MAX_INPUT_SIZE; i += 4)
 AV_WB32(input + i, i);
 
+output = input + MAX_INPUT_SIZE;
+
 size = MAX_INPUT_SIZE;
 for (impl = 0; impl < FF_ARRAY_ELEMS(implementations); impl++)
 run_implementation(input, output, &implementations[impl], size);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 4/6] lavc/libvpxenc: remove redundant condition check

2019-05-10 Thread Jun Zhao
From: Jun Zhao 

Redundant condition: '!A || B' is equivalent to '!A || (A && B)' but
more clearly.

Signed-off-by: Jun Zhao 
---
 libavcodec/libvpxenc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index c823b8a..feb52ea 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -978,7 +978,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket 
*pkt_out)
are only good through the next vpx_codec call */
 while ((pkt = vpx_codec_get_cx_data(&ctx->encoder, &iter)) &&
(!ctx->is_alpha ||
-(ctx->is_alpha && (pkt_alpha = 
vpx_codec_get_cx_data(&ctx->encoder_alpha, &iter_alpha) {
+(pkt_alpha = vpx_codec_get_cx_data(&ctx->encoder_alpha, 
&iter_alpha {
 switch (pkt->kind) {
 case VPX_CODEC_CX_FRAME_PKT:
 if (!size) {
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 5/6] lavc/mlpenc: remove the redundant condition check

2019-05-10 Thread Jun Zhao
From: Jun Zhao 

remove the redundant condition check for 'frame'

Signed-off-by: Jun Zhao 
---
 libavcodec/mlpenc.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index 7536d3b..deb1716 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -2232,10 +2232,8 @@ static int mlp_encode_frame(AVCodecContext *avctx, 
AVPacket *avpkt,
 return 1;
 
 /* add current frame to queue */
-if (frame) {
-if ((ret = ff_af_queue_add(&ctx->afq, frame)) < 0)
-return ret;
-}
+if ((ret = ff_af_queue_add(&ctx->afq, frame)) < 0)
+return ret;
 
 data = frame->data[0];
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 1/6] lavc/aacenc_ltp: remove unnecessary condition check.

2019-05-10 Thread Jun Zhao
From: Jun Zhao 

Condition 'sum==2' is always true, so remove the check logic to
make the code clean.

Signed-off-by: Jun Zhao 
---
 libavcodec/aacenc_ltp.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/aacenc_ltp.c b/libavcodec/aacenc_ltp.c
index 674a2a0..f77f0b6 100644
--- a/libavcodec/aacenc_ltp.c
+++ b/libavcodec/aacenc_ltp.c
@@ -144,7 +144,7 @@ void ff_aac_adjust_common_ltp(AACEncContext *s, 
ChannelElement *cpe)
 int sum = sce0->ics.ltp.used[sfb] + sce1->ics.ltp.used[sfb];
 if (sum != 2) {
 sce0->ics.ltp.used[sfb] = 0;
-} else if (sum == 2) {
+} else {
 count++;
 }
 }
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 6/6] lavc/pngenc: check malloc fail before using the pointer

2019-05-10 Thread Jun Zhao
From: Jun Zhao 

Need to check malloc fail before using the pointer

Signed-off-by: Jun Zhao 
---
 libavcodec/pngenc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 69b4495..d4d8dc8 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -748,11 +748,11 @@ static int apng_encode_frame(AVCodecContext *avctx, const 
AVFrame *pict,
 original_bytestream_end = s->bytestream_end;
 
 temp_bytestream = av_malloc(original_bytestream_end - original_bytestream);
-temp_bytestream_end = temp_bytestream + (original_bytestream_end - 
original_bytestream);
 if (!temp_bytestream) {
 ret = AVERROR(ENOMEM);
 goto fail;
 }
+temp_bytestream_end = temp_bytestream + (original_bytestream_end - 
original_bytestream);
 
 for (last_fctl_chunk.dispose_op = 0; last_fctl_chunk.dispose_op < 3; 
++last_fctl_chunk.dispose_op) {
 // 0: APNG_DISPOSE_OP_NONE
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 3/6] lavc/bink: Remove the dead code block

2019-05-10 Thread Jun Zhao
From: Jun Zhao 

Remove the dead code block

Signed-off-by: Jun Zhao 
---
 libavcodec/bink.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 6673afa..d0f1b39 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -1046,8 +1046,6 @@ static int bink_decode_plane(BinkContext *c, AVFrame 
*frame, GetBitContext *gb,
 if ((ret = read_runs(c->avctx, gb, &c->bundle[BINK_SRC_RUN])) < 0)
 return ret;
 
-if (by == bh)
-break;
 dst  = frame->data[plane_idx]  + 8*by*stride;
 prev = (c->last->data[plane_idx] ? c->last->data[plane_idx]
  : frame->data[plane_idx]) + 
8*by*stride;
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 2/6] lavc/avpacket: check NULL before using the pointer

2019-05-10 Thread Jun Zhao
From: Jun Zhao 

Need to check NULL before using the pointer

Signed-off-by: Jun Zhao 
---
 libavcodec/avpacket.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 8f0603d..2b20067 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -522,11 +522,12 @@ fail:
 
 int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary 
**dict)
 {
-const uint8_t *end = data + size;
+const uint8_t *end;
 int ret = 0;
 
 if (!dict || !data || !size)
 return ret;
+end = data + size;
 if (size && end[-1])
 return AVERROR_INVALIDDATA;
 while (data < end) {
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 2/2] lavf/dashdec: refactoring error handle logic for open_input

2019-05-11 Thread Jun Zhao
From: Jun Zhao 

refactoring error handle logic for open_input.

Signed-off-by: Jun Zhao 
---
 libavformat/dashdec.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index ce8bd4a..2c50f23 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1687,6 +1687,7 @@ static int open_input(DASHContext *c, struct 
representation *pls, struct fragmen
 
 url = av_mallocz(c->max_url_size);
 if (!url) {
+ret = AVERROR(ENOMEM);
 goto cleanup;
 }
 
@@ -1701,9 +1702,6 @@ static int open_input(DASHContext *c, struct 
representation *pls, struct fragmen
 av_log(pls->parent, AV_LOG_VERBOSE, "DASH request for url '%s', offset 
%"PRId64", playlist %d\n",
url, seg->url_offset, pls->rep_idx);
 ret = open_url(pls->parent, &pls->input, url, c->avio_opts, opts, NULL);
-if (ret < 0) {
-goto cleanup;
-}
 
 cleanup:
 av_free(url);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 1/2] lavf/dashdec: fix the coding logic after open_input fail

2019-05-11 Thread Jun Zhao
From: Jun Zhao 

setting return status following goto will never be executed, so
adjust the location in the code.

Signed-off-by: Jun Zhao 
---
 libavformat/dashdec.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 6e3e7e4..ce8bd4a 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1793,8 +1793,8 @@ restart:
 ret = open_input(c, v, v->cur_seg);
 if (ret < 0) {
 if (ff_check_interrupt(c->interrupt_callback)) {
-goto end;
 ret = AVERROR_EXIT;
+goto end;
 }
 av_log(v->parent, AV_LOG_WARNING, "Failed to open fragment of 
playlist %d\n", v->rep_idx);
 v->cur_seq_no++;
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] libavdevice/gdigrab: fix ffmpeg -devices doesn't show gdigrab

2019-05-17 Thread Jun Zhao
From: Jun Zhao 

missed the category AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT lead to
ffmpeg -devices doesn't show gdigrab as a input device

FIx #7848

Found-by: dangibson
Signed-off-by: Jun Zhao 
---
 libavdevice/gdigrab.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c
index b226bd0..f40 100644
--- a/libavdevice/gdigrab.c
+++ b/libavdevice/gdigrab.c
@@ -647,6 +647,7 @@ static const AVClass gdigrab_class = {
 .item_name  = av_default_item_name,
 .option = options,
 .version= LIBAVUTIL_VERSION_INT,
+.category   = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
 };
 
 /** gdi grabber device demuxer declaration */
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] lavfi/colorlevels: Add slice threading support

2019-05-20 Thread Jun Zhao
From: Jun Zhao 

Add slice threading support, use the command like:

./ffmpeg -i input -vf colorlevel with 1080p h264 clip, the fps
from 39 fps to 79 fps in the local

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_colorlevels.c |  125 +++--
 1 files changed, 106 insertions(+), 19 deletions(-)

diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index 5385a5e..68668e7 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -105,6 +105,83 @@ static int config_input(AVFilterLink *inlink)
 return 0;
 }
 
+struct thread_data {
+const uint8_t *srcrow;
+uint8_t *dstrow;
+int dst_linesize;
+int src_linesize;
+
+double coeff;
+uint8_t offset;
+
+int h;
+
+int imin;
+int omin;
+};
+
+static int colorlevel_slice_8(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+ColorLevelsContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+int process_h = td->h;
+const int slice_start = (process_h *  jobnr   ) / nb_jobs;
+const int slice_end   = (process_h * (jobnr+1)) / nb_jobs;
+int x, y;
+const uint8_t *srcrow = td->srcrow;
+uint8_t *dstrow = td->dstrow;
+const int step = s->step;
+const uint8_t offset = td->offset;
+
+int imin = td->imin;
+int omin = td->omin;
+double coeff = td->coeff;
+
+for (y = slice_start; y < slice_end; y++) {
+const uint8_t *src = srcrow;
+uint8_t *dst = dstrow;
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + 
omin);
+dstrow += td->dst_linesize;
+srcrow += td->src_linesize;
+}
+
+return 0;
+}
+
+static int colorlevel_slice_16(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+ColorLevelsContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+int process_h = td->h;
+const int slice_start = (process_h *  jobnr   ) / nb_jobs;
+const int slice_end   = (process_h * (jobnr+1)) / nb_jobs;
+int x, y;
+const uint8_t *srcrow = td->srcrow;
+uint8_t *dstrow = td->dstrow;
+const int step = s->step;
+const uint8_t offset = td->offset;
+
+int imin = td->imin;
+int omin = td->omin;
+double coeff = td->coeff;
+
+for (y = slice_start; y < slice_end; y++) {
+const uint16_t *src = (const uint16_t *)srcrow;
+uint16_t *dst = (uint16_t *)dstrow;
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + 
omin);
+dstrow += td->dst_linesize;
+srcrow += td->src_linesize;
+}
+
+return 0;
+}
+
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -137,6 +214,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT8_MAX);
 int omax = lrint(r->out_max * UINT8_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT8_MAX;
@@ -162,15 +240,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h; y++) {
-const uint8_t *src = srcrow;
-uint8_t *dst = dstrow;
-
-for (x = 0; x < s->linesize; x += step)
-dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * 
coeff + omin);
-dstrow += out->linesize[0];
-srcrow += in->linesize[0];
-}
+
+td.srcrow= srcrow;
+td.dstrow= dstrow;
+td.dst_linesize  = out->linesize[0];
+td.src_linesize  = in->linesize[0];
+td.coeff = coeff;
+td.offset= offset;
+td.h = inlink->h;
+td.imin  = imin;
+td.omin  = omin;
+
+ctx->internal->execute(ctx, colorlevel_slice_8, &td, NULL,
+   FFMIN(inlink->h, 
ff_filter_get_nb_threads(ctx)));
 }
 break;
 case 2:
@@ -184,6 +266,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT16_MAX);
 int omax = lrint(r->out_max * UINT16_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT16_MAX;
@@ -209,15 +292,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h; y++) {
- 

[FFmpeg-devel] [PATCH V3] lavfi/colorlevels: Add slice threading support

2019-05-21 Thread Jun Zhao
From: Jun Zhao 

Add slice threading support, use the command like:

./ffmpeg -i input -vf colorlevels -f null /dev/null

with 1080p h264 clip, the fps from 39 fps to 79 fps
in the local(Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz)

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_colorlevels.c |  121 +++---
 1 files changed, 102 insertions(+), 19 deletions(-)

diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index 5385a5e..c3b7137 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -105,6 +105,79 @@ static int config_input(AVFilterLink *inlink)
 return 0;
 }
 
+struct thread_data {
+const uint8_t *srcrow;
+uint8_t *dstrow;
+int dst_linesize;
+int src_linesize;
+
+double coeff;
+uint8_t offset;
+
+int h;
+
+int imin;
+int omin;
+};
+
+static int colorlevel_slice_8(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+ColorLevelsContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+int process_h = td->h;
+const int slice_start = (process_h *  jobnr   ) / nb_jobs;
+const int slice_end   = (process_h * (jobnr+1)) / nb_jobs;
+int x, y;
+const uint8_t *srcrow = td->srcrow;
+uint8_t *dstrow = td->dstrow;
+const int step = s->step;
+const uint8_t offset = td->offset;
+
+int imin = td->imin;
+int omin = td->omin;
+double coeff = td->coeff;
+
+for (y = slice_start; y < slice_end; y++) {
+const uint8_t *src = srcrow + y * td->src_linesize;
+uint8_t *dst = dstrow + y * td->dst_linesize;
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + 
omin);
+}
+
+return 0;
+}
+
+static int colorlevel_slice_16(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+ColorLevelsContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+int process_h = td->h;
+const int slice_start = (process_h *  jobnr   ) / nb_jobs;
+const int slice_end   = (process_h * (jobnr+1)) / nb_jobs;
+int x, y;
+const uint8_t *srcrow = td->srcrow;
+uint8_t *dstrow = td->dstrow;
+const int step = s->step;
+const uint8_t offset = td->offset;
+
+int imin = td->imin;
+int omin = td->omin;
+double coeff = td->coeff;
+
+for (y = slice_start; y < slice_end; y++) {
+const uint16_t *src = (const uint16_t *)(srcrow + y * 
td->src_linesize);
+uint16_t *dst = (uint16_t *)(dstrow + y * td->dst_linesize);
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + 
omin);
+}
+
+return 0;
+}
+
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -137,6 +210,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT8_MAX);
 int omax = lrint(r->out_max * UINT8_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT8_MAX;
@@ -162,15 +236,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h; y++) {
-const uint8_t *src = srcrow;
-uint8_t *dst = dstrow;
-
-for (x = 0; x < s->linesize; x += step)
-dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * 
coeff + omin);
-dstrow += out->linesize[0];
-srcrow += in->linesize[0];
-}
+
+td.srcrow= srcrow;
+td.dstrow= dstrow;
+td.dst_linesize  = out->linesize[0];
+td.src_linesize  = in->linesize[0];
+td.coeff = coeff;
+td.offset= offset;
+td.h = inlink->h;
+td.imin  = imin;
+td.omin  = omin;
+
+ctx->internal->execute(ctx, colorlevel_slice_8, &td, NULL,
+   FFMIN(inlink->h, 
ff_filter_get_nb_threads(ctx)));
 }
 break;
 case 2:
@@ -184,6 +262,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT16_MAX);
 int omax = lrint(r->out_max * UINT16_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT16_MAX;
@@ -209,15 +288,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h;

[FFmpeg-devel] [PATCH V2] lavfi/colorlevels: Add slice threading support

2019-05-21 Thread Jun Zhao
From: Jun Zhao 

Add slice threading support, use the command like:

./ffmpeg -i input -vf colorlevel with 1080p h264 clip, the fps
from 39 fps to 79 fps in the local

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_colorlevels.c |  125 +++--
 1 files changed, 106 insertions(+), 19 deletions(-)

diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index 5385a5e..68668e7 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -105,6 +105,83 @@ static int config_input(AVFilterLink *inlink)
 return 0;
 }
 
+struct thread_data {
+const uint8_t *srcrow;
+uint8_t *dstrow;
+int dst_linesize;
+int src_linesize;
+
+double coeff;
+uint8_t offset;
+
+int h;
+
+int imin;
+int omin;
+};
+
+static int colorlevel_slice_8(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+ColorLevelsContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+int process_h = td->h;
+const int slice_start = (process_h *  jobnr   ) / nb_jobs;
+const int slice_end   = (process_h * (jobnr+1)) / nb_jobs;
+int x, y;
+const uint8_t *srcrow = td->srcrow;
+uint8_t *dstrow = td->dstrow;
+const int step = s->step;
+const uint8_t offset = td->offset;
+
+int imin = td->imin;
+int omin = td->omin;
+double coeff = td->coeff;
+
+for (y = slice_start; y < slice_end; y++) {
+const uint8_t *src = srcrow;
+uint8_t *dst = dstrow;
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + 
omin);
+dstrow += td->dst_linesize;
+srcrow += td->src_linesize;
+}
+
+return 0;
+}
+
+static int colorlevel_slice_16(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+ColorLevelsContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+int process_h = td->h;
+const int slice_start = (process_h *  jobnr   ) / nb_jobs;
+const int slice_end   = (process_h * (jobnr+1)) / nb_jobs;
+int x, y;
+const uint8_t *srcrow = td->srcrow;
+uint8_t *dstrow = td->dstrow;
+const int step = s->step;
+const uint8_t offset = td->offset;
+
+int imin = td->imin;
+int omin = td->omin;
+double coeff = td->coeff;
+
+for (y = slice_start; y < slice_end; y++) {
+const uint16_t *src = (const uint16_t *)srcrow;
+uint16_t *dst = (uint16_t *)dstrow;
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + 
omin);
+dstrow += td->dst_linesize;
+srcrow += td->src_linesize;
+}
+
+return 0;
+}
+
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -137,6 +214,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT8_MAX);
 int omax = lrint(r->out_max * UINT8_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT8_MAX;
@@ -162,15 +240,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h; y++) {
-const uint8_t *src = srcrow;
-uint8_t *dst = dstrow;
-
-for (x = 0; x < s->linesize; x += step)
-dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * 
coeff + omin);
-dstrow += out->linesize[0];
-srcrow += in->linesize[0];
-}
+
+td.srcrow= srcrow;
+td.dstrow= dstrow;
+td.dst_linesize  = out->linesize[0];
+td.src_linesize  = in->linesize[0];
+td.coeff = coeff;
+td.offset= offset;
+td.h = inlink->h;
+td.imin  = imin;
+td.omin  = omin;
+
+ctx->internal->execute(ctx, colorlevel_slice_8, &td, NULL,
+   FFMIN(inlink->h, 
ff_filter_get_nb_threads(ctx)));
 }
 break;
 case 2:
@@ -184,6 +266,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT16_MAX);
 int omax = lrint(r->out_max * UINT16_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT16_MAX;
@@ -209,15 +292,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h; y++) {
- 

[FFmpeg-devel] [PATCH V1] lavfi/lut: Add slice threading support

2019-05-21 Thread Jun Zhao
From: Jun Zhao 

Used the command for 1080p h264 clip as follow:

a). ffmpeg -i input -vf lutyuv="u=128:v=128" -f null /dev/null
b). ffmpeg -i input -vf lutrgb="g=0:b=0" -f null /dev/null

after enabled the slice threading, the fps change from:

a). 144fps to 258fps (lutyuv)
b). 94fps  to 153fps (lutrgb)

in Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_lut.c |  328 +-
 1 files changed, 216 insertions(+), 112 deletions(-)

diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index c815ddc..61550ee 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -337,13 +337,194 @@ static int config_props(AVFilterLink *inlink)
 return 0;
 }
 
+struct thread_data {
+AVFrame *in;
+AVFrame *out;
+
+int w;
+int h;
+};
+
+/* packed, 16-bit */
+static int lut_packed_16bits(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LutContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+uint16_t *inrow, *outrow, *inrow0, *outrow0;
+int i, j;
+const int w = td->w;
+const int h = td->h;
+AVFrame *in = td->in;
+AVFrame *out = td->out;
+const uint16_t (*tab)[256*256] = (const uint16_t (*)[256*256])s->lut;
+const int in_linesize  =  in->linesize[0] / 2;
+const int out_linesize = out->linesize[0] / 2;
+const int step = s->step;
+
+const int slice_start = (h *  jobnr   ) / nb_jobs;
+const int slice_end   = (h * (jobnr+1)) / nb_jobs;
+
+inrow0  = (uint16_t *)in ->data[0];
+outrow0 = (uint16_t *)out->data[0];
+
+for (i = slice_start; i < slice_end; i++) {
+inrow  = inrow0 + i * in_linesize;
+outrow = outrow0 + i * out_linesize;
+for (j = 0; j < w; j++) {
+
+switch (step) {
+#if HAVE_BIGENDIAN
+case 4:  outrow[3] = av_bswap16(tab[3][av_bswap16(inrow[3])]); // 
Fall-through
+case 3:  outrow[2] = av_bswap16(tab[2][av_bswap16(inrow[2])]); // 
Fall-through
+case 2:  outrow[1] = av_bswap16(tab[1][av_bswap16(inrow[1])]); // 
Fall-through
+default: outrow[0] = av_bswap16(tab[0][av_bswap16(inrow[0])]);
+#else
+case 4:  outrow[3] = tab[3][inrow[3]]; // Fall-through
+case 3:  outrow[2] = tab[2][inrow[2]]; // Fall-through
+case 2:  outrow[1] = tab[1][inrow[1]]; // Fall-through
+default: outrow[0] = tab[0][inrow[0]];
+#endif
+}
+outrow += step;
+inrow  += step;
+}
+}
+
+return 0;
+}
+
+/* packed, 16-bit */
+static int lut_packed_8bits(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LutContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+uint8_t *inrow, *outrow, *inrow0, *outrow0;
+int i, j;
+const int w = td->w;
+const int h = td->h;
+AVFrame *in = td->in;
+AVFrame *out = td->out;
+const uint16_t (*tab)[256*256] = (const uint16_t (*)[256*256])s->lut;
+const int in_linesize  =  in->linesize[0];
+const int out_linesize = out->linesize[0];
+const int step = s->step;
+
+const int slice_start = (h *  jobnr   ) / nb_jobs;
+const int slice_end   = (h * (jobnr+1)) / nb_jobs;
+
+inrow0  = in ->data[0];
+outrow0 = out->data[0];
+
+for (i = slice_start; i < slice_end; i++) {
+inrow  = inrow0 + i * in_linesize;
+outrow = outrow0 + i * out_linesize;
+for (j = 0; j < w; j++) {
+switch (step) {
+case 4:  outrow[3] = tab[3][inrow[3]]; // Fall-through
+case 3:  outrow[2] = tab[2][inrow[2]]; // Fall-through
+case 2:  outrow[1] = tab[1][inrow[1]]; // Fall-through
+default: outrow[0] = tab[0][inrow[0]];
+}
+outrow += step;
+inrow  += step;
+}
+}
+
+return 0;
+}
+
+
+static int lut_planar_16bits(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+// planar >8 bit depth
+LutContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+uint16_t *inrow, *outrow;
+int i, j, plane;
+
+AVFrame *in = td->in;
+AVFrame *out = td->out;
+
+for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; 
plane++) {
+int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
+int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
+int h = AV_CEIL_RSHIFT(td->h, vsub);
+int w = AV_CEIL_RSHIFT(td->w, hsub);
+const uint16_t *tab = s->lut[plane];
+const int in_linesize  =  in->linesize[plane] / 2;
+const int out_linesize = out->linesize[plane] / 2;
+
+const int slice_start = (h *  jobnr   ) / nb_jobs;
+const int slice_end   = (h * (jobnr+1)) / nb_jobs;
+
+inrow  = (uint16_t *)(in ->data[plane]

[FFmpeg-devel] [PATCH V1 1/2] lavfi/lensfun: Use ff_filter_get_nb_threads() get number of threads

2019-05-21 Thread Jun Zhao
From: Jun Zhao 

ff_filter_get_nb_threads() respect AVFilterContext.nb_threads and
graph->nb_threads both, in most case, we perfer this API than using
ctx->graph->nb_threads directly.

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_lensfun.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_lensfun.c b/libavfilter/vf_lensfun.c
index 3b723dd..089121e 100644
--- a/libavfilter/vf_lensfun.c
+++ b/libavfilter/vf_lensfun.c
@@ -465,7 +465,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
vignetting_filter_slice,
&vignetting_thread_data,
NULL,
-   FFMIN(outlink->h, ctx->graph->nb_threads));
+   FFMIN(outlink->h, 
ff_filter_get_nb_threads(ctx)));
 }
 
 if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) {
@@ -493,7 +493,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
distortion_correction_filter_slice,
&distortion_correction_thread_data,
NULL,
-   FFMIN(outlink->h, ctx->graph->nb_threads));
+   FFMIN(outlink->h, 
ff_filter_get_nb_threads(ctx)));
 
 av_frame_free(&in);
 return ff_filter_frame(outlink, out);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] doc/writing_filters: Use ff_filter_get_nb_threads() get number of threads

2019-05-21 Thread Jun Zhao
From: Jun Zhao 

ff_filter_get_nb_threads() respect AVFilterContext.nb_threads and
graph->nb_threads both, in most case, we perfer this API than using
ctx->graph->nb_threads directly.
---
 doc/writing_filters.txt |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/doc/writing_filters.txt b/doc/writing_filters.txt
index 98b9c6f..2e25cbe 100644
--- a/doc/writing_filters.txt
+++ b/doc/writing_filters.txt
@@ -389,7 +389,7 @@ distributor with something like this:
 
 td.in  = in;
 td.out = out;
-ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, 
ctx->graph->nb_threads));
+ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, 
ff_filter_get_nb_threads(ctx)));
 
 // ...
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1] doc/build_system: Document checkheaders/alltools and consistency fixes

2019-05-21 Thread Jun Zhao
From: Jun Zhao 

Document checkheaders/alltools and consistency fixes

Signed-off-by: Jun Zhao 
---
 doc/build_system.txt |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/build_system.txt b/doc/build_system.txt
index 325a9e8..9a12b3a 100644
--- a/doc/build_system.txt
+++ b/doc/build_system.txt
@@ -36,11 +36,11 @@ install
 examples
 Build all examples located in doc/examples.
 
-libavformat/output-example
-Build the libavformat basic example.
+checkheaders
+Check headers
 
-libswscale/swscale-test
-Build the swscale self-test (useful also as an example).
+alltools
+Build all tools in tools directory.
 
 config
 Reconfigure the project with the current configuration.
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1] doc/encoders: Document eld_v2 option for libfdk_aac encoder.

2019-05-23 Thread Jun Zhao
From: Jun Zhao 

Document eld_v2 option for libfdk_aac encoder.

Signed-off-by: Jun Zhao 
---
 doc/encoders.texi |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index ef12c73..e0e 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -733,6 +733,12 @@ if set to 0.
 
 Default value is 0.
 
+@item eld_v2
+Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
+disabled if set to 0.
+
+Default value is 0.
+
 @item signaling
 Set SBR/PS signaling style.
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 0/2] Update docs

2019-05-24 Thread Jun Zhao
V2: - Add version note for eld_v2 option
- Update checkheaders docs

Jun Zhao (2):
  doc/build_system: Document checkheaders/alltools and consistency
fixes
  doc/encoders: Document eld_v2 option for libfdk_aac encoder.

 doc/build_system.txt |8 
 doc/encoders.texi|8 
 2 files changed, 12 insertions(+), 4 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 2/2] doc/encoders: Document eld_v2 option for libfdk_aac encoder.

2019-05-24 Thread Jun Zhao
From: Jun Zhao 

Document eld_v2 option for libfdk_aac encoder.

Signed-off-by: Jun Zhao 
---
 doc/encoders.texi |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index ef12c73..eefd124 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -733,6 +733,14 @@ if set to 0.
 
 Default value is 0.
 
+@item eld_v2
+Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
+disabled if set to 0.
+
+Note that option is available when fdk-aac version 
(AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) > (4.0.0).
+
+Default value is 0.
+
 @item signaling
 Set SBR/PS signaling style.
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2] lavfi/lut: Add slice threading support

2019-05-24 Thread Jun Zhao
V2: - update comments

Jun Zhao (1):
  lavfi/lut: Add slice threading support

 libavfilter/vf_lut.c |  329 +-
 1 files changed, 216 insertions(+), 113 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2] lavfi/lut: Add slice threading support

2019-05-24 Thread Jun Zhao
From: Jun Zhao 

Used the command for 1080p h264 clip as follow:

a). ffmpeg -i input -vf lutyuv="u=128:v=128" -f null /dev/null
b). ffmpeg -i input -vf lutrgb="g=0:b=0" -f null /dev/null

after enabled the slice threading, the fps change from:

a). 144fps to 258fps (lutyuv)
b). 94fps  to 153fps (lutrgb)

in Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_lut.c |  329 +-
 1 files changed, 216 insertions(+), 113 deletions(-)

diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index c815ddc..7cb3b87 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -337,13 +337,193 @@ static int config_props(AVFilterLink *inlink)
 return 0;
 }
 
+struct thread_data {
+AVFrame *in;
+AVFrame *out;
+
+int w;
+int h;
+};
+
+/* packed, 16-bit */
+static int lut_packed_16bits(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LutContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+uint16_t *inrow, *outrow, *inrow0, *outrow0;
+int i, j;
+const int w = td->w;
+const int h = td->h;
+AVFrame *in = td->in;
+AVFrame *out = td->out;
+const uint16_t (*tab)[256*256] = (const uint16_t (*)[256*256])s->lut;
+const int in_linesize  =  in->linesize[0] / 2;
+const int out_linesize = out->linesize[0] / 2;
+const int step = s->step;
+
+const int slice_start = (h *  jobnr   ) / nb_jobs;
+const int slice_end   = (h * (jobnr+1)) / nb_jobs;
+
+inrow0  = (uint16_t *)in ->data[0];
+outrow0 = (uint16_t *)out->data[0];
+
+for (i = slice_start; i < slice_end; i++) {
+inrow  = inrow0 + i * in_linesize;
+outrow = outrow0 + i * out_linesize;
+for (j = 0; j < w; j++) {
+
+switch (step) {
+#if HAVE_BIGENDIAN
+case 4:  outrow[3] = av_bswap16(tab[3][av_bswap16(inrow[3])]); // 
Fall-through
+case 3:  outrow[2] = av_bswap16(tab[2][av_bswap16(inrow[2])]); // 
Fall-through
+case 2:  outrow[1] = av_bswap16(tab[1][av_bswap16(inrow[1])]); // 
Fall-through
+default: outrow[0] = av_bswap16(tab[0][av_bswap16(inrow[0])]);
+#else
+case 4:  outrow[3] = tab[3][inrow[3]]; // Fall-through
+case 3:  outrow[2] = tab[2][inrow[2]]; // Fall-through
+case 2:  outrow[1] = tab[1][inrow[1]]; // Fall-through
+default: outrow[0] = tab[0][inrow[0]];
+#endif
+}
+outrow += step;
+inrow  += step;
+}
+}
+
+return 0;
+}
+
+/* packed, 8-bit */
+static int lut_packed_8bits(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LutContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+uint8_t *inrow, *outrow, *inrow0, *outrow0;
+int i, j;
+const int w = td->w;
+const int h = td->h;
+AVFrame *in = td->in;
+AVFrame *out = td->out;
+const uint16_t (*tab)[256*256] = (const uint16_t (*)[256*256])s->lut;
+const int in_linesize  =  in->linesize[0];
+const int out_linesize = out->linesize[0];
+const int step = s->step;
+
+const int slice_start = (h *  jobnr   ) / nb_jobs;
+const int slice_end   = (h * (jobnr+1)) / nb_jobs;
+
+inrow0  = in ->data[0];
+outrow0 = out->data[0];
+
+for (i = slice_start; i < slice_end; i++) {
+inrow  = inrow0 + i * in_linesize;
+outrow = outrow0 + i * out_linesize;
+for (j = 0; j < w; j++) {
+switch (step) {
+case 4:  outrow[3] = tab[3][inrow[3]]; // Fall-through
+case 3:  outrow[2] = tab[2][inrow[2]]; // Fall-through
+case 2:  outrow[1] = tab[1][inrow[1]]; // Fall-through
+default: outrow[0] = tab[0][inrow[0]];
+}
+outrow += step;
+inrow  += step;
+}
+}
+
+return 0;
+}
+
+/* planar >8 bit depth */
+static int lut_planar_16bits(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LutContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+uint16_t *inrow, *outrow;
+int i, j, plane;
+
+AVFrame *in = td->in;
+AVFrame *out = td->out;
+
+for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; 
plane++) {
+int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
+int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
+int h = AV_CEIL_RSHIFT(td->h, vsub);
+int w = AV_CEIL_RSHIFT(td->w, hsub);
+const uint16_t *tab = s->lut[plane];
+const int in_linesize  =  in->linesize[plane] / 2;
+const int out_linesize = out->linesize[plane] / 2;
+
+const int slice_start = (h *  jobnr   ) / nb_jobs;
+const int slice_end   = (h * (jobnr+1)) / nb_jobs;
+
+inrow  = (uint16_t *)(in ->data[plane]

[FFmpeg-devel] [PATCH V4] lavfi/colorlevels: Add slice threading support

2019-05-24 Thread Jun Zhao
From: Jun Zhao 

Add slice threading support, use the command like:

./ffmpeg -i input -vf colorlevels -f null /dev/null

with 1080p h264 clip, the fps from 39 fps to 79 fps
in the local(Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz)

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_colorlevels.c |  121 +++---
 1 files changed, 102 insertions(+), 19 deletions(-)

diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index 5385a5e..4e47089 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -105,6 +105,79 @@ static int config_input(AVFilterLink *inlink)
 return 0;
 }
 
+struct thread_data {
+const uint8_t *srcrow;
+uint8_t *dstrow;
+int dst_linesize;
+int src_linesize;
+
+double coeff;
+uint8_t offset;
+
+int h;
+
+int imin;
+int omin;
+};
+
+static int colorlevel_slice_8(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+ColorLevelsContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+int process_h = td->h;
+const int slice_start = (process_h *  jobnr   ) / nb_jobs;
+const int slice_end   = (process_h * (jobnr+1)) / nb_jobs;
+int x, y;
+const uint8_t *srcrow = td->srcrow;
+uint8_t *dstrow = td->dstrow;
+const int step = s->step;
+const uint8_t offset = td->offset;
+
+int imin = td->imin;
+int omin = td->omin;
+double coeff = td->coeff;
+
+for (y = slice_start; y < slice_end; y++) {
+const uint8_t *src = srcrow + y * td->src_linesize;
+uint8_t *dst = dstrow + y * td->dst_linesize;
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + 
omin);
+}
+
+return 0;
+}
+
+static int colorlevel_slice_16(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+ColorLevelsContext *s = ctx->priv;
+const struct thread_data *td = arg;
+
+int process_h = td->h;
+const int slice_start = (process_h *  jobnr   ) / nb_jobs;
+const int slice_end   = (process_h * (jobnr+1)) / nb_jobs;
+int x, y;
+const uint8_t *srcrow = td->srcrow;
+uint8_t *dstrow = td->dstrow;
+const int step = s->step;
+const uint8_t offset = td->offset;
+
+int imin = td->imin;
+int omin = td->omin;
+double coeff = td->coeff;
+
+for (y = slice_start; y < slice_end; y++) {
+const uint16_t *src = (const uint16_t *)(srcrow + y * 
td->src_linesize);
+uint16_t *dst = (uint16_t *)(dstrow + y * td->dst_linesize);
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint16((src[x + offset] - imin) * coeff 
+ omin);
+}
+
+return 0;
+}
+
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -137,6 +210,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT8_MAX);
 int omax = lrint(r->out_max * UINT8_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT8_MAX;
@@ -162,15 +236,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h; y++) {
-const uint8_t *src = srcrow;
-uint8_t *dst = dstrow;
-
-for (x = 0; x < s->linesize; x += step)
-dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * 
coeff + omin);
-dstrow += out->linesize[0];
-srcrow += in->linesize[0];
-}
+
+td.srcrow= srcrow;
+td.dstrow= dstrow;
+td.dst_linesize  = out->linesize[0];
+td.src_linesize  = in->linesize[0];
+td.coeff = coeff;
+td.offset= offset;
+td.h = inlink->h;
+td.imin  = imin;
+td.omin  = omin;
+
+ctx->internal->execute(ctx, colorlevel_slice_8, &td, NULL,
+   FFMIN(inlink->h, 
ff_filter_get_nb_threads(ctx)));
 }
 break;
 case 2:
@@ -184,6 +262,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT16_MAX);
 int omax = lrint(r->out_max * UINT16_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT16_MAX;
@@ -209,15 +288,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h;

[FFmpeg-devel] [PATCH V4] lavfi/colorlevels: Add slice threading support

2019-05-24 Thread Jun Zhao
V4: - fix clip issue for 16bits case

Jun Zhao (1):
  lavfi/colorlevels: Add slice threading support

 libavfilter/vf_colorlevels.c |  121 +++---
 1 files changed, 102 insertions(+), 19 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 1/2] doc/build_system: Document checkheaders/alltools and consistency fixes

2019-05-24 Thread Jun Zhao
From: Jun Zhao 

Document checkheaders/alltools and consistency fixes

Signed-off-by: Jun Zhao 
---
 doc/build_system.txt |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/build_system.txt b/doc/build_system.txt
index 325a9e8..3d6a21a 100644
--- a/doc/build_system.txt
+++ b/doc/build_system.txt
@@ -36,11 +36,11 @@ install
 examples
 Build all examples located in doc/examples.
 
-libavformat/output-example
-Build the libavformat basic example.
+checkheaders
+Check headers dependencies.
 
-libswscale/swscale-test
-Build the swscale self-test (useful also as an example).
+alltools
+Build all tools in tools directory.
 
 config
 Reconfigure the project with the current configuration.
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] lavfi/sr: Remove slice thread flag

2019-05-25 Thread Jun Zhao
From: Jun Zhao 

sr didn't enable the slice threading, so remove the flag

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_sr.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c
index 95bd3b7..86dc551 100644
--- a/libavfilter/vf_sr.c
+++ b/libavfilter/vf_sr.c
@@ -317,6 +317,5 @@ AVFilter ff_vf_sr = {
 .inputs= sr_inputs,
 .outputs   = sr_outputs,
 .priv_class= &sr_class,
-.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | 
AVFILTER_FLAG_SLICE_THREADS,
+.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
 };
-
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] lavfi/sr: Change the backend type from flags to int

2019-05-25 Thread Jun Zhao
From: Jun Zhao 

native and tensorflow is exclusive, so change the type from
flags to int.

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_sr.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c
index 65baf5f..95bd3b7 100644
--- a/libavfilter/vf_sr.c
+++ b/libavfilter/vf_sr.c
@@ -50,7 +50,7 @@ typedef struct SRContext {
 #define OFFSET(x) offsetof(SRContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
 static const AVOption sr_options[] = {
-{ "dnn_backend", "DNN backend used for model execution", 
OFFSET(backend_type), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
+{ "dnn_backend", "DNN backend used for model execution", 
OFFSET(backend_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
 { "native", "native backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 
0, FLAGS, "backend" },
 #if (CONFIG_LIBTENSORFLOW == 1)
 { "tensorflow", "tensorflow backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 
1 }, 0, 0, FLAGS, "backend" },
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 0/3] Refine SR filter

2019-05-31 Thread Jun Zhao
V1: - Dump input pixel format in error message
- Remove NULL check before call sws_freeContext
- Refine the error handling coding logic for init 

Jun Zhao (3):
  lavf/sr: Dump input pixel format in error message
  lavf/sr: Don't need to check NULL before sws_freeContext
  lavf/sr: Refine the coding style for init

 libavfilter/vf_sr.c |   22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/3] lavf/sr: Dump input pixel format in error message

2019-05-31 Thread Jun Zhao
From: Jun Zhao 

Dump input pixel format in error message, it's will help to debugging

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_sr.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c
index 86dc551..a371e44 100644
--- a/libavfilter/vf_sr.c
+++ b/libavfilter/vf_sr.c
@@ -29,6 +29,7 @@
 #include "formats.h"
 #include "internal.h"
 #include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
 #include "libavformat/avio.h"
 #include "libswscale/swscale.h"
 #include "dnn_interface.h"
@@ -205,7 +206,9 @@ static int config_props(AVFilterLink *inlink)
 sws_dst_w = AV_CEIL_RSHIFT(sws_dst_w, 2);
 break;
 default:
-av_log(context, AV_LOG_ERROR, "could not create SwsContext for 
scaling for given input pixel format");
+av_log(context, AV_LOG_ERROR,
+   "could not create SwsContext for scaling for given 
input pixel format: %s\n",
+   av_get_pix_fmt_name(inlink->format));
 return AVERROR(EIO);
 }
 sr_context->sws_contexts[0] = sws_getContext(sws_src_w, sws_src_h, 
AV_PIX_FMT_GRAY8,
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 3/3] lavf/sr: Refine the coding style for init

2019-05-31 Thread Jun Zhao
From: Jun Zhao 

We perfer the coding style like:

/* some stuff */
if (error) {
/* error handling */
return -(errorcode);
}
/* normal actions */
do_something()

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_sr.c |   13 ++---
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c
index 0be572f..0433246 100644
--- a/libavfilter/vf_sr.c
+++ b/libavfilter/vf_sr.c
@@ -72,17 +72,16 @@ static av_cold int init(AVFilterContext *context)
 av_log(context, AV_LOG_ERROR, "could not create DNN module for 
requested backend\n");
 return AVERROR(ENOMEM);
 }
+
 if (!sr_context->model_filename){
 av_log(context, AV_LOG_ERROR, "model file for network was not 
specified\n");
 return AVERROR(EIO);
-} else {
-if (!sr_context->dnn_module->load_model) {
-av_log(context, AV_LOG_ERROR, "load_model for network was not 
specified\n");
-return AVERROR(EIO);
-} else {
-sr_context->model = 
(sr_context->dnn_module->load_model)(sr_context->model_filename);
-}
 }
+if (!sr_context->dnn_module->load_model) {
+av_log(context, AV_LOG_ERROR, "load_model for network was not 
specified\n");
+return AVERROR(EIO);
+}
+sr_context->model = 
(sr_context->dnn_module->load_model)(sr_context->model_filename);
 if (!sr_context->model){
 av_log(context, AV_LOG_ERROR, "could not load DNN model\n");
 return AVERROR(EIO);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/3] lavf/sr: Don't need to check NULL before sws_freeContext

2019-05-31 Thread Jun Zhao
From: Jun Zhao 

sws_freeContext have check the NULL pointer, so don't need to check
NULL before sws_freeContext.

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_sr.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c
index a371e44..0be572f 100644
--- a/libavfilter/vf_sr.c
+++ b/libavfilter/vf_sr.c
@@ -286,9 +286,7 @@ static av_cold void uninit(AVFilterContext *context)
 }
 
 for (i = 0; i < 3; ++i){
-if (sr_context->sws_contexts[i]){
-sws_freeContext(sr_context->sws_contexts[i]);
-}
+sws_freeContext(sr_context->sws_contexts[i]);
 }
 }
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V5 0/2] Add slice threading support

2019-05-31 Thread Jun Zhao
V5: - Using Macros for redundant code, don't use the is_16bit check in the 
  thread exec callback to avoid potential performance issues, Thanks 
  Ruiling Song, ZhongLi and Paul B Mahol review/comments/suggestion.

Jun Zhao (2):
  lavfi/colorlevels: Add slice threading support
  lavfi/lut: Add slice threading support

 libavfilter/vf_colorlevels.c |  110 ---
 libavfilter/vf_lut.c |  310 +++---
 2 files changed, 288 insertions(+), 132 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V5 1/2] lavfi/colorlevels: Add slice threading support

2019-05-31 Thread Jun Zhao
From: Jun Zhao 

Add slice threading support, use the command like:

./ffmpeg -i input -vf colorlevels -f null /dev/null

with 1080p h264 clip, the fps from 39 fps to 79 fps
in the local(Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz)

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_colorlevels.c |  110 ++---
 1 files changed, 91 insertions(+), 19 deletions(-)

diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index 5385a5e..fadb39e 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -105,6 +105,68 @@ static int config_input(AVFilterLink *inlink)
 return 0;
 }
 
+struct thread_data {
+const uint8_t *srcrow;
+uint8_t *dstrow;
+int dst_linesize;
+int src_linesize;
+
+double coeff;
+uint8_t offset;
+
+int h;
+
+int imin;
+int omin;
+};
+
+#define LOAD_COMMON\
+ColorLevelsContext *s = ctx->priv;\
+const struct thread_data *td = arg;\
+\
+int process_h = td->h;\
+const int slice_start = (process_h *  jobnr   ) / nb_jobs;\
+const int slice_end   = (process_h * (jobnr+1)) / nb_jobs;\
+int x, y;\
+const uint8_t *srcrow = td->srcrow;\
+uint8_t *dstrow = td->dstrow;\
+const int step = s->step;\
+const uint8_t offset = td->offset;\
+\
+int imin = td->imin;\
+int omin = td->omin;\
+double coeff = td->coeff;\
+
+static int colorlevel_slice_8(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LOAD_COMMON
+
+for (y = slice_start; y < slice_end; y++) {
+const uint8_t *src = srcrow + y * td->src_linesize;
+uint8_t *dst = dstrow + y * td->dst_linesize;
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + 
omin);
+}
+
+return 0;
+}
+
+static int colorlevel_slice_16(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LOAD_COMMON
+
+for (y = slice_start; y < slice_end; y++) {
+const uint16_t *src = (const uint16_t *)(srcrow + y * 
td->src_linesize);
+uint16_t *dst = (uint16_t *)(dstrow + y * td->dst_linesize);
+
+for (x = 0; x < s->linesize; x += step)
+dst[x + offset] = av_clip_uint16((src[x + offset] - imin) * coeff 
+ omin);
+}
+
+return 0;
+}
+
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -137,6 +199,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT8_MAX);
 int omax = lrint(r->out_max * UINT8_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT8_MAX;
@@ -162,15 +225,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h; y++) {
-const uint8_t *src = srcrow;
-uint8_t *dst = dstrow;
-
-for (x = 0; x < s->linesize; x += step)
-dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * 
coeff + omin);
-dstrow += out->linesize[0];
-srcrow += in->linesize[0];
-}
+
+td.srcrow= srcrow;
+td.dstrow= dstrow;
+td.dst_linesize  = out->linesize[0];
+td.src_linesize  = in->linesize[0];
+td.coeff = coeff;
+td.offset= offset;
+td.h = inlink->h;
+td.imin  = imin;
+td.omin  = omin;
+
+ctx->internal->execute(ctx, colorlevel_slice_8, &td, NULL,
+   FFMIN(inlink->h, 
ff_filter_get_nb_threads(ctx)));
 }
 break;
 case 2:
@@ -184,6 +251,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 int omin = lrint(r->out_min * UINT16_MAX);
 int omax = lrint(r->out_max * UINT16_MAX);
 double coeff;
+struct thread_data td;
 
 if (imin < 0) {
 imin = UINT16_MAX;
@@ -209,15 +277,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
 srcrow = in->data[0];
 coeff = (omax - omin) / (double)(imax - imin);
-for (y = 0; y < inlink->h; y++) {
-const uint16_t *src = (const uint16_t*)srcrow;
-uint16_t *dst = (uint16_t *)dstrow;
-
-for (x = 0; x < s->linesize; x += step)
-dst[x + offset] = av_clip_uint16((src[x + offset] - imin) 
* coeff + omin);
-dstrow += out->linesize[0];
-srcrow += in->linesize[0];
-}
+
+td.srcrow= sr

[FFmpeg-devel] [PATCH V5 2/2] lavfi/lut: Add slice threading support

2019-05-31 Thread Jun Zhao
From: Jun Zhao 

Used the command for 1080p h264 clip as follow:

a). ffmpeg -i input -vf lutyuv="u=128:v=128" -f null /dev/null
b). ffmpeg -i input -vf lutrgb="g=0:b=0" -f null /dev/null

after enabled the slice threading, the fps change from:

a). 144fps to 258fps (lutyuv)
b). 94fps  to 153fps (lutrgb)

in Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_lut.c |  310 --
 1 files changed, 197 insertions(+), 113 deletions(-)

diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index c815ddc..90998e6 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -337,13 +337,194 @@ static int config_props(AVFilterLink *inlink)
 return 0;
 }
 
+struct thread_data {
+AVFrame *in;
+AVFrame *out;
+
+int w;
+int h;
+};
+
+#define LOAD_PACKED_COMMON\
+LutContext *s = ctx->priv;\
+const struct thread_data *td = arg;\
+\
+int i, j;\
+const int w = td->w;\
+const int h = td->h;\
+AVFrame *in = td->in;\
+AVFrame *out = td->out;\
+const uint16_t (*tab)[256*256] = (const uint16_t (*)[256*256])s->lut;\
+const int step = s->step;\
+\
+const int slice_start = (h *  jobnr   ) / nb_jobs;\
+const int slice_end   = (h * (jobnr+1)) / nb_jobs;\
+
+/* packed, 16-bit */
+static int lut_packed_16bits(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LOAD_PACKED_COMMON
+
+uint16_t *inrow, *outrow, *inrow0, *outrow0;
+const int in_linesize  =  in->linesize[0] / 2;
+const int out_linesize = out->linesize[0] / 2;
+inrow0  = (uint16_t *)in ->data[0];
+outrow0 = (uint16_t *)out->data[0];
+
+for (i = slice_start; i < slice_end; i++) {
+inrow  = inrow0 + i * in_linesize;
+outrow = outrow0 + i * out_linesize;
+for (j = 0; j < w; j++) {
+
+switch (step) {
+#if HAVE_BIGENDIAN
+case 4:  outrow[3] = av_bswap16(tab[3][av_bswap16(inrow[3])]); // 
Fall-through
+case 3:  outrow[2] = av_bswap16(tab[2][av_bswap16(inrow[2])]); // 
Fall-through
+case 2:  outrow[1] = av_bswap16(tab[1][av_bswap16(inrow[1])]); // 
Fall-through
+default: outrow[0] = av_bswap16(tab[0][av_bswap16(inrow[0])]);
+#else
+case 4:  outrow[3] = tab[3][inrow[3]]; // Fall-through
+case 3:  outrow[2] = tab[2][inrow[2]]; // Fall-through
+case 2:  outrow[1] = tab[1][inrow[1]]; // Fall-through
+default: outrow[0] = tab[0][inrow[0]];
+#endif
+}
+outrow += step;
+inrow  += step;
+}
+}
+
+return 0;
+}
+
+/* packed, 8-bit */
+static int lut_packed_8bits(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LOAD_PACKED_COMMON
+
+uint8_t *inrow, *outrow, *inrow0, *outrow0;
+const int in_linesize  =  in->linesize[0];
+const int out_linesize = out->linesize[0];
+inrow0  = in ->data[0];
+outrow0 = out->data[0];
+
+for (i = slice_start; i < slice_end; i++) {
+inrow  = inrow0 + i * in_linesize;
+outrow = outrow0 + i * out_linesize;
+for (j = 0; j < w; j++) {
+switch (step) {
+case 4:  outrow[3] = tab[3][inrow[3]]; // Fall-through
+case 3:  outrow[2] = tab[2][inrow[2]]; // Fall-through
+case 2:  outrow[1] = tab[1][inrow[1]]; // Fall-through
+default: outrow[0] = tab[0][inrow[0]];
+}
+outrow += step;
+inrow  += step;
+}
+}
+
+return 0;
+}
+
+#define LOAD_PLANAR_COMMON\
+LutContext *s = ctx->priv;\
+const struct thread_data *td = arg;\
+int i, j, plane;\
+AVFrame *in = td->in;\
+AVFrame *out = td->out;\
+
+#define PLANAR_COMMON\
+int vsub = plane == 1 || plane == 2 ? s->vsub : 0;\
+int hsub = plane == 1 || plane == 2 ? s->hsub : 0;\
+int h = AV_CEIL_RSHIFT(td->h, vsub);\
+int w = AV_CEIL_RSHIFT(td->w, hsub);\
+const uint16_t *tab = s->lut[plane];\
+\
+const int slice_start = (h *  jobnr   ) / nb_jobs;\
+const int slice_end   = (h * (jobnr+1)) / nb_jobs;\
+
+/* planar >8 bit depth */
+static int lut_planar_16bits(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
+{
+LOAD_PLANAR_COMMON
+
+uint16_t *inrow, *outrow;
+
+for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; 
plane++) {
+PLANAR_COMMON
+
+const int in_linesize  =  in->linesize[plane] / 2;
+const int out_linesize = out->linesize[plane] / 2;
+
+inrow  = (uint16_t *)(in ->data[plane] + slice_start * in_linesize);
+outrow = (uint16_t *)(out->data[plane] + slice_start * out_linesize);
+
+for (i = slice_start; i < slice_end; i++) {
+for (j = 0; j < w; j++) {
+#if HAVE_BIGENDIAN
+

[FFmpeg-devel] [PATCH V1 2/5] lavf/webvtt: fix ffmpeg -h demuxer=webvtt can't dump options

2019-06-03 Thread Jun Zhao
From: Jun Zhao 

fix ffmpeg -h demuxer=webvtt can't dump options

Signed-off-by: Jun Zhao 
---
 libavformat/webvttdec.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index e435de3..52579c5 100644
--- a/libavformat/webvttdec.c
+++ b/libavformat/webvttdec.c
@@ -192,14 +192,14 @@ static int webvtt_read_close(AVFormatContext *s)
 }
 
 #define OFFSET(x) offsetof(WebVTTContext, x)
-#define KIND_FLAGS AV_OPT_FLAG_SUBTITLE_PARAM
+#define KIND_FLAGS AV_OPT_FLAG_SUBTITLE_PARAM|AV_OPT_FLAG_DECODING_PARAM
 
 static const AVOption options[] = {
 { "kind", "Set kind of WebVTT track", OFFSET(kind), AV_OPT_TYPE_INT, { 
.i64 = 0 }, 0, INT_MAX, KIND_FLAGS, "webvtt_kind" },
-{ "subtitles","WebVTT subtitles kind",0, AV_OPT_TYPE_CONST, { 
.i64 = 0 },   INT_MIN, INT_MAX, 0, "webvtt_kind" },
-{ "captions", "WebVTT captions kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_CAPTIONS }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
-{ "descriptions", "WebVTT descriptions kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_DESCRIPTIONS }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
-{ "metadata", "WebVTT metadata kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_METADATA }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
+{ "subtitles","WebVTT subtitles kind",0, AV_OPT_TYPE_CONST, { 
.i64 = 0 },   INT_MIN, INT_MAX, KIND_FLAGS, 
"webvtt_kind" },
+{ "captions", "WebVTT captions kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_CAPTIONS }, INT_MIN, INT_MAX, KIND_FLAGS, 
"webvtt_kind" },
+{ "descriptions", "WebVTT descriptions kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_DESCRIPTIONS }, INT_MIN, INT_MAX, KIND_FLAGS, 
"webvtt_kind" },
+{ "metadata", "WebVTT metadata kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_METADATA }, INT_MIN, INT_MAX, KIND_FLAGS, 
"webvtt_kind" },
 { NULL }
 };
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 4/5] lavc/webvttenc: fix ffmpeg -h full can't display webvtt encoder

2019-06-03 Thread Jun Zhao
From: Jun Zhao 

fix ffmpeg -h full can't display webvtt encoder

Signed-off-by: Jun Zhao 
---
 libavcodec/webvttenc.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c
index c84bbf4..c19040d 100644
--- a/libavcodec/webvttenc.c
+++ b/libavcodec/webvttenc.c
@@ -24,6 +24,7 @@
 #include "avcodec.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
+#include "libavutil/opt.h"
 #include "ass_split.h"
 #include "ass.h"
 
@@ -224,6 +225,17 @@ static av_cold int webvtt_encode_init(AVCodecContext 
*avctx)
 return s->ass_ctx ? 0 : AVERROR_INVALIDDATA;
 }
 
+static const AVOption options[] = {
+{ NULL },
+};
+
+static const AVClass webvtt_encoder_class = {
+.class_name = "WebVTT encoder",
+.item_name  = av_default_item_name,
+.option = options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
 AVCodec ff_webvtt_encoder = {
 .name   = "webvtt",
 .long_name  = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
@@ -233,4 +245,5 @@ AVCodec ff_webvtt_encoder = {
 .init   = webvtt_encode_init,
 .encode_sub = webvtt_encode_frame,
 .close  = webvtt_encode_close,
+.priv_class = &webvtt_encoder_class,
 };
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/5] lavf/hls: Update av_log() log message

2019-06-03 Thread Jun Zhao
From: Jun Zhao 

Pass correct pointer to av_log() and update some error/warning message,
it's will help the debugging

Signed-off-by: Jun Zhao 
---
 libavformat/hls.c |   22 ++
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 19ea88e..1b45fe2 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -476,17 +476,23 @@ static struct rendition *new_rendition(HLSContext *c, 
struct rendition_info *inf
  * AVC SEI RBSP anyway */
 return NULL;
 
-if (type == AVMEDIA_TYPE_UNKNOWN)
+if (type == AVMEDIA_TYPE_UNKNOWN) {
+av_log(c, AV_LOG_WARNING, "Can't support the type: %s\n", info->type);
 return NULL;
+}
 
 /* URI is mandatory for subtitles as per spec */
-if (type == AVMEDIA_TYPE_SUBTITLE && !info->uri[0])
+if (type == AVMEDIA_TYPE_SUBTITLE && !info->uri[0]) {
+av_log(c, AV_LOG_ERROR, "The URI tag is REQUIRED for subtitle.\n");
 return NULL;
+}
 
 /* TODO: handle subtitles (each segment has to parsed separately) */
 if (c->ctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL)
-if (type == AVMEDIA_TYPE_SUBTITLE)
+if (type == AVMEDIA_TYPE_SUBTITLE) {
+av_log(c, AV_LOG_WARNING, "Can't support the subtitle(uri: %s)\n", 
info->uri);
 return NULL;
+}
 
 rend = av_mallocz(sizeof(struct rendition));
 if (!rend)
@@ -1202,12 +1208,12 @@ static int open_input(HLSContext *c, struct playlist 
*pls, struct segment *seg,
 if (open_url(pls->parent, &pb, seg->key, c->avio_opts, opts, NULL) 
== 0) {
 ret = avio_read(pb, pls->key, sizeof(pls->key));
 if (ret != sizeof(pls->key)) {
-av_log(NULL, AV_LOG_ERROR, "Unable to read key file %s\n",
+av_log(pls->parent, AV_LOG_ERROR, "Unable to read key file 
%s\n",
seg->key);
 }
 ff_format_io_close(pls->parent, &pb);
 } else {
-av_log(NULL, AV_LOG_ERROR, "Unable to open key file %s\n",
+av_log(pls->parent, AV_LOG_ERROR, "Unable to open key file 
%s\n",
seg->key);
 }
 av_strlcpy(pls->key_url, seg->key, sizeof(pls->key_url));
@@ -1419,7 +1425,7 @@ reload:
 reload_interval = v->target_duration / 2;
 }
 if (v->cur_seq_no < v->start_seq_no) {
-av_log(NULL, AV_LOG_WARNING,
+av_log(v->parent, AV_LOG_WARNING,
"skipping %d segments ahead, expired from playlists\n",
v->start_seq_no - v->cur_seq_no);
 v->cur_seq_no = v->start_seq_no;
@@ -1800,7 +1806,7 @@ static int hls_read_header(AVFormatContext *s)
 goto fail;
 
 if (c->n_variants == 0) {
-av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
+av_log(s, AV_LOG_WARNING, "Empty playlist\n");
 ret = AVERROR_EOF;
 goto fail;
 }
@@ -1815,7 +1821,7 @@ static int hls_read_header(AVFormatContext *s)
 }
 
 if (c->variants[0]->playlists[0]->n_segments == 0) {
-av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
+av_log(s, AV_LOG_WARNING, "Empty segment\n");
 ret = AVERROR_EOF;
 goto fail;
 }
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 3/5] lavc/webvttdec: fix ffmpeg -h full can't display webvtt decoder

2019-06-03 Thread Jun Zhao
From: Jun Zhao 

fix ffmpeg -h full can't display webvtt decoder

Signed-off-by: Jun Zhao 
---
 libavcodec/webvttdec.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c
index 7b2d175..28113f6 100644
--- a/libavcodec/webvttdec.c
+++ b/libavcodec/webvttdec.c
@@ -28,6 +28,7 @@
 #include "avcodec.h"
 #include "ass.h"
 #include "libavutil/bprint.h"
+#include "libavutil/opt.h"
 
 static const struct {
 const char *from;
@@ -98,6 +99,17 @@ static int webvtt_decode_frame(AVCodecContext *avctx,
 return avpkt->size;
 }
 
+static const AVOption options[] = {
+{ NULL },
+};
+
+static const AVClass webvtt_decoder_class = {
+.class_name = "WebVTT decoder",
+.item_name  = av_default_item_name,
+.option = options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
 AVCodec ff_webvtt_decoder = {
 .name   = "webvtt",
 .long_name  = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
@@ -107,4 +119,5 @@ AVCodec ff_webvtt_decoder = {
 .init   = ff_ass_subtitle_header_default,
 .flush  = ff_ass_decoder_flush,
 .priv_data_size = sizeof(FFASSDecoderContext),
+.priv_class = &webvtt_decoder_class,
 };
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 5/5] lavf/webvttenc: fix ffmpeg -h full can't display webvtt muxer

2019-06-03 Thread Jun Zhao
From: Jun Zhao 

fix ffmpeg -h full can't display webvtt muxer

Signed-off-by: Jun Zhao 
---
 libavformat/webvttenc.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libavformat/webvttenc.c b/libavformat/webvttenc.c
index 61b7f54..b4e8a61 100644
--- a/libavformat/webvttenc.c
+++ b/libavformat/webvttenc.c
@@ -26,6 +26,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "libavutil/opt.h"
 
 static void webvtt_write_time(AVIOContext *pb, int64_t millisec)
 {
@@ -94,6 +95,17 @@ static int webvtt_write_packet(AVFormatContext *ctx, 
AVPacket *pkt)
 return 0;
 }
 
+static const AVOption options[] = {
+{ NULL }
+};
+
+static const AVClass webvtt_muxer_class = {
+.class_name  = "WebVTT muxer",
+.item_name   = av_default_item_name,
+.option  = options,
+.version = LIBAVUTIL_VERSION_INT,
+};
+
 AVOutputFormat ff_webvtt_muxer = {
 .name  = "webvtt",
 .long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
@@ -103,4 +115,5 @@ AVOutputFormat ff_webvtt_muxer = {
 .subtitle_codec= AV_CODEC_ID_WEBVTT,
 .write_header  = webvtt_write_header,
 .write_packet  = webvtt_write_packet,
+.priv_class= &webvtt_muxer_class,
 };
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 1/4] lavf/webvtt: fix ffmpeg -h demuxer=webvtt can't dump options

2019-06-05 Thread Jun Zhao
From: Jun Zhao 

fix ffmpeg -h demuxer=webvtt can't dump options

Signed-off-by: Jun Zhao 
---
 libavformat/webvttdec.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index e435de3..52579c5 100644
--- a/libavformat/webvttdec.c
+++ b/libavformat/webvttdec.c
@@ -192,14 +192,14 @@ static int webvtt_read_close(AVFormatContext *s)
 }
 
 #define OFFSET(x) offsetof(WebVTTContext, x)
-#define KIND_FLAGS AV_OPT_FLAG_SUBTITLE_PARAM
+#define KIND_FLAGS AV_OPT_FLAG_SUBTITLE_PARAM|AV_OPT_FLAG_DECODING_PARAM
 
 static const AVOption options[] = {
 { "kind", "Set kind of WebVTT track", OFFSET(kind), AV_OPT_TYPE_INT, { 
.i64 = 0 }, 0, INT_MAX, KIND_FLAGS, "webvtt_kind" },
-{ "subtitles","WebVTT subtitles kind",0, AV_OPT_TYPE_CONST, { 
.i64 = 0 },   INT_MIN, INT_MAX, 0, "webvtt_kind" },
-{ "captions", "WebVTT captions kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_CAPTIONS }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
-{ "descriptions", "WebVTT descriptions kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_DESCRIPTIONS }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
-{ "metadata", "WebVTT metadata kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_METADATA }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
+{ "subtitles","WebVTT subtitles kind",0, AV_OPT_TYPE_CONST, { 
.i64 = 0 },   INT_MIN, INT_MAX, KIND_FLAGS, 
"webvtt_kind" },
+{ "captions", "WebVTT captions kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_CAPTIONS }, INT_MIN, INT_MAX, KIND_FLAGS, 
"webvtt_kind" },
+{ "descriptions", "WebVTT descriptions kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_DESCRIPTIONS }, INT_MIN, INT_MAX, KIND_FLAGS, 
"webvtt_kind" },
+{ "metadata", "WebVTT metadata kind", 0, AV_OPT_TYPE_CONST, { 
.i64 = AV_DISPOSITION_METADATA }, INT_MIN, INT_MAX, KIND_FLAGS, 
"webvtt_kind" },
 { NULL }
 };
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 2/4] lavf/webvttenc: fix ffmpeg -h full can't display webvtt muxer

2019-06-05 Thread Jun Zhao
From: Jun Zhao 

fix ffmpeg -h full can't display webvtt muxer

Signed-off-by: Jun Zhao 
---
 libavformat/webvttenc.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libavformat/webvttenc.c b/libavformat/webvttenc.c
index 61b7f54..b4e8a61 100644
--- a/libavformat/webvttenc.c
+++ b/libavformat/webvttenc.c
@@ -26,6 +26,7 @@
 
 #include "avformat.h"
 #include "internal.h"
+#include "libavutil/opt.h"
 
 static void webvtt_write_time(AVIOContext *pb, int64_t millisec)
 {
@@ -94,6 +95,17 @@ static int webvtt_write_packet(AVFormatContext *ctx, 
AVPacket *pkt)
 return 0;
 }
 
+static const AVOption options[] = {
+{ NULL }
+};
+
+static const AVClass webvtt_muxer_class = {
+.class_name  = "WebVTT muxer",
+.item_name   = av_default_item_name,
+.option  = options,
+.version = LIBAVUTIL_VERSION_INT,
+};
+
 AVOutputFormat ff_webvtt_muxer = {
 .name  = "webvtt",
 .long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
@@ -103,4 +115,5 @@ AVOutputFormat ff_webvtt_muxer = {
 .subtitle_codec= AV_CODEC_ID_WEBVTT,
 .write_header  = webvtt_write_header,
 .write_packet  = webvtt_write_packet,
+.priv_class= &webvtt_muxer_class,
 };
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 0/4] fix webvtt can't dump option issue

2019-06-05 Thread Jun Zhao
V2: - fix WebVTT encoder fail issue

Jun Zhao (4):
  lavf/webvtt: fix ffmpeg -h demuxer=webvtt can't dump options
  lavf/webvttenc: fix ffmpeg -h full can't display webvtt muxer
  lavc/webvttdec: fix ffmpeg -h full can't display webvtt decoder
  lavc/webvttenc: fix ffmpeg -h full can't display webvtt encoder

 libavcodec/webvttdec.c  |   13 +
 libavcodec/webvttenc.c  |   14 ++
 libavformat/webvttdec.c |   10 +-
 libavformat/webvttenc.c |   13 +
 4 files changed, 45 insertions(+), 5 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 4/4] lavc/webvttenc: fix ffmpeg -h full can't display webvtt encoder

2019-06-05 Thread Jun Zhao
From: Jun Zhao 

fix ffmpeg -h full can't display webvtt encoder

Signed-off-by: Jun Zhao 
---
 libavcodec/webvttenc.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c
index c84bbf4..21e7d92 100644
--- a/libavcodec/webvttenc.c
+++ b/libavcodec/webvttenc.c
@@ -24,11 +24,13 @@
 #include "avcodec.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
+#include "libavutil/opt.h"
 #include "ass_split.h"
 #include "ass.h"
 
 #define WEBVTT_STACK_SIZE 64
 typedef struct {
+const AVClass *class;
 AVCodecContext *avctx;
 ASSSplitContext *ass_ctx;
 AVBPrint buffer;
@@ -224,6 +226,17 @@ static av_cold int webvtt_encode_init(AVCodecContext 
*avctx)
 return s->ass_ctx ? 0 : AVERROR_INVALIDDATA;
 }
 
+static const AVOption options[] = {
+{ NULL },
+};
+
+static const AVClass webvtt_encoder_class = {
+.class_name = "WebVTT encoder",
+.item_name  = av_default_item_name,
+.option = options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
 AVCodec ff_webvtt_encoder = {
 .name   = "webvtt",
 .long_name  = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
@@ -233,4 +246,5 @@ AVCodec ff_webvtt_encoder = {
 .init   = webvtt_encode_init,
 .encode_sub = webvtt_encode_frame,
 .close  = webvtt_encode_close,
+.priv_class = &webvtt_encoder_class,
 };
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 3/4] lavc/webvttdec: fix ffmpeg -h full can't display webvtt decoder

2019-06-05 Thread Jun Zhao
From: Jun Zhao 

fix ffmpeg -h full can't display webvtt decoder

Signed-off-by: Jun Zhao 
---
 libavcodec/webvttdec.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c
index 7b2d175..28113f6 100644
--- a/libavcodec/webvttdec.c
+++ b/libavcodec/webvttdec.c
@@ -28,6 +28,7 @@
 #include "avcodec.h"
 #include "ass.h"
 #include "libavutil/bprint.h"
+#include "libavutil/opt.h"
 
 static const struct {
 const char *from;
@@ -98,6 +99,17 @@ static int webvtt_decode_frame(AVCodecContext *avctx,
 return avpkt->size;
 }
 
+static const AVOption options[] = {
+{ NULL },
+};
+
+static const AVClass webvtt_decoder_class = {
+.class_name = "WebVTT decoder",
+.item_name  = av_default_item_name,
+.option = options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
 AVCodec ff_webvtt_decoder = {
 .name   = "webvtt",
 .long_name  = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
@@ -107,4 +119,5 @@ AVCodec ff_webvtt_decoder = {
 .init   = ff_ass_subtitle_header_default,
 .flush  = ff_ass_decoder_flush,
 .priv_data_size = sizeof(FFASSDecoderContext),
+.priv_class = &webvtt_decoder_class,
 };
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] doc/formats: document f_strict/strict for AVFormatContext

2019-06-08 Thread Jun Zhao
From: Jun Zhao 

document f_strict/strict option for AVFormatContext

Signed-off-by: Jun Zhao 
---
 doc/formats.texi |   22 ++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/doc/formats.texi b/doc/formats.texi
index a992506..729c77b 100644
--- a/doc/formats.texi
+++ b/doc/formats.texi
@@ -224,6 +224,28 @@ would require too many resources due to a large number of 
streams.
 @item skip_estimate_duration_from_pts @var{bool} (@emph{input})
 Skip estimation of input duration when calculated using PTS.
 At present, applicable for MPEG-PS and MPEG-TS.
+
+@item strict, f_strict @var{integer} (@emph{input/output})
+Specify how strictly to follow the standards. @code{f_strict} is deprecated and
+should be used only via the @command{ffmpeg} tool.
+
+Possible values:
+@table @samp
+@item very
+strictly conform to an older more strict version of the spec or reference 
software
+@item strict
+strictly conform to all the things in the spec no matter what consequences
+@item normal
+
+@item unofficial
+allow unofficial extensions
+@item experimental
+allow non standardized experimental things, experimental
+(unfinished/work in progress/not well tested) decoders and encoders.
+Note: experimental decoders can pose a security risk, do not use this for
+decoding untrusted input.
+@end table
+
 @end table
 
 @c man end FORMAT OPTIONS
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] doc/fftools-common-opts: document ffmpeg -h bsf=bitstream_filter_name

2019-06-08 Thread Jun Zhao
From: Jun Zhao 

document ffmpeg -h bsf=bitstream_filter_name

Signed-off-by: Jun Zhao 
---
 doc/fftools-common-opts.texi |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index 4c821ba..1234de8 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -109,6 +109,10 @@ Print detailed information about the muxer named 
@var{muxer_name}. Use the
 @item filter=@var{filter_name}
 Print detailed information about the filter name @var{filter_name}. Use the
 @option{-filters} option to get a list of all filters.
+
+@item bsf=@var{bitstream_filter_name}
+Print detailed information about the bitstream filter name 
@var{bitstream_filter_name}.
+Use the @option{-bsfs} option to get a list of all bitstream filters.
 @end table
 
 @item -version
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] lavf/dashdec: Save and forward more avio options same as HLS demuxer

2019-06-13 Thread Jun Zhao
From: Jun Zhao 

Save and forward more avio options same as HLS demuxer

Signed-off-by: Jun Zhao 
---
 libavformat/dashdec.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 2c50f23..446825d 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1834,7 +1834,9 @@ end:
 static int save_avio_options(AVFormatContext *s)
 {
 DASHContext *c = s->priv_data;
-const char *opts[] = { "headers", "user_agent", "cookies", NULL }, **opt = 
opts;
+static const char * const opts[] = {
+"headers", "http_proxy", "user_agent", "cookies", "referer", 
"rw_timeout", NULL };
+const char * const * opt = opts;
 uint8_t *buf = NULL;
 int ret = 0;
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] lavf/hls: More log message

2019-06-13 Thread Jun Zhao
From: Jun Zhao 

More log message, it's will help the debugging

Signed-off-by: Jun Zhao 
---
 libavformat/hls.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index b5df9ae..3b1d4fe 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -849,6 +849,7 @@ static int parse_playlist(HLSContext *c, const char *url,
 if (ptr)
 seg_offset = strtoll(ptr+1, NULL, 10);
 } else if (av_strstart(line, "#", NULL)) {
+av_log(c->ctx, AV_LOG_INFO, "Skip ('%s')\n", line);
 continue;
 } else if (line[0]) {
 if (is_variant) {
@@ -1398,8 +1399,8 @@ restart:
 v->needed = playlist_needed(v);
 
 if (!v->needed) {
-av_log(v->parent, AV_LOG_INFO, "No longer receiving playlist %d\n",
-v->index);
+av_log(v->parent, AV_LOG_INFO, "No longer receiving playlist %d 
('%s')\n",
+   v->index, v->url);
 return AVERROR_EOF;
 }
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/3] lavf/mpegtsenc: fix logic check error

2019-06-15 Thread Jun Zhao
From: Jun Zhao 

fix the logic check error

Signed-off-by: Jun Zhao 
---
 libavformat/mpegtsenc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index fc0ea22..5d679c9 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1651,7 +1651,7 @@ static int mpegts_write_packet_internal(AVFormatContext 
*s, AVPacket *pkt)
 } while (p < buf_end && (state & 0x7e) != 2*35 &&
  (state & 0x7e) >= 2*32);
 
-if ((state & 0x7e) < 2*16 && (state & 0x7e) >= 2*24)
+if ((state & 0x7e) < 2*16 || (state & 0x7e) >= 2*24)
 extradd = 0;
 if ((state & 0x7e) != 2*35) { // AUD NAL
 data = av_malloc(pkt->size + 7 + extradd);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 3/3] lavfi/af_asetnsamples: Remove the redundant condition check

2019-06-15 Thread Jun Zhao
From: Jun Zhao 

Redundant condition: '!A || B' is equivalent to '!A || (A && B)' but
more clearly.

Signed-off-by: Jun Zhao 
---
 libavfilter/af_asetnsamples.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index a7e424f..bbc391a 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -67,7 +67,7 @@ static int activate(AVFilterContext *ctx)
 return ret;
 
 if (ret > 0) {
-if ((!s->pad || (s->pad && frame->nb_samples == s->nb_out_samples))) {
+if (!s->pad || frame->nb_samples == s->nb_out_samples) {
 ret = ff_filter_frame(outlink, frame);
 if (ff_inlink_queued_samples(inlink) >= s->nb_out_samples)
 ff_filter_set_ready(ctx, 100);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/3] lavf/asfdec: Simplify the check conditions

2019-06-15 Thread Jun Zhao
From: Jun Zhao 

Simplify the check conditions

Signed-off-by: Jun Zhao 
---
 libavformat/asfdec_o.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 8e7f044..7891b23 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -1165,7 +1165,7 @@ static int asf_read_replicated_data(AVFormatContext *s, 
ASFPacket *asf_pkt)
 } else
 avio_skip(pb, 4); // reading of media object size is already done
 asf_pkt->dts = avio_rl32(pb); // read presentation time
-if (asf->rep_data_len && (asf->rep_data_len >= 8))
+if (asf->rep_data_len >= 8)
 avio_skip(pb, asf->rep_data_len - 8); // skip replicated data
 
 return 0;
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/2] doc/muxers: fix and update docs for hls_playlist_type

2019-06-16 Thread Jun Zhao
From: Jun Zhao 

fix and update docs for hls_playlist_type

Signed-off-by: Jun Zhao 
---
 doc/muxers.texi |   16 ++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 50147c4..b2fbe3f 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -896,14 +896,26 @@ before they have been added to the m3u8 playlist.
 
 @end table
 
-@item hls_playlist_type event
+@item hls_playlist_type @var{int}
+Set the HLS playlist type, Default value is none.
+
+Possible values:
+@table @option
+
+@item none (default)
+NOT contain the EXT-X-PLAYLIST-TYPE tag, usually in the Live playlist, that
+tag allows Media Segments to be removed.
+
+@item event
 Emit @code{#EXT-X-PLAYLIST-TYPE:EVENT} in the m3u8 header. Forces
 @option{hls_list_size} to 0; the playlist can only be appended to.
 
-@item hls_playlist_type vod
+@item vod
 Emit @code{#EXT-X-PLAYLIST-TYPE:VOD} in the m3u8 header. Forces
 @option{hls_list_size} to 0; the playlist must not change.
 
+@end table
+
 @item method
 Use the given HTTP method to create the hls files.
 @example
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] lavf/hlsenc: Update suboption for hls_playlist_type

2019-06-16 Thread Jun Zhao
From: Jun Zhao 

Update suboption for hls_playlist_type

Signed-off-by: Jun Zhao 
---
 libavformat/hlsenc.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 9884f74..6c0d0a5 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2945,6 +2945,7 @@ static const AVOption options[] = {
 #endif
 {"strftime_mkdir", "create last directory component in strftime-generated 
filename", OFFSET(use_localtime_mkdir), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E 
},
 {"hls_playlist_type", "set the HLS playlist type", OFFSET(pl_type), 
AV_OPT_TYPE_INT, {.i64 = PLAYLIST_TYPE_NONE }, 0, PLAYLIST_TYPE_NB-1, E, 
"pl_type" },
+{"none", "Not contain the EXT-X-PLAYLIST-TYPE tag", 0, AV_OPT_TYPE_CONST, 
{.i64 = PLAYLIST_TYPE_NONE }, INT_MIN, INT_MAX, E, "pl_type" },
 {"event", "EVENT playlist", 0, AV_OPT_TYPE_CONST, {.i64 = 
PLAYLIST_TYPE_EVENT }, INT_MIN, INT_MAX, E, "pl_type" },
 {"vod", "VOD playlist", 0, AV_OPT_TYPE_CONST, {.i64 = PLAYLIST_TYPE_VOD }, 
INT_MIN, INT_MAX, E, "pl_type" },
 {"method", "set the HTTP method(default: PUT)", OFFSET(method), 
AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,E},
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 2/3] ffmpeg_opt: Respect default disposition when select audio/video

2019-06-19 Thread Jun Zhao
From: Jun Zhao 

Respect default disposition when select audio/video

Signed-off-by: Jun Zhao 
---
 fftools/ffmpeg_opt.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 53d688b..f5ca18a 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2198,7 +2198,8 @@ static int open_output_file(OptionsContext *o, const char 
*filename)
 for (i = 0; i < nb_input_streams; i++) {
 int new_area;
 ist = input_streams[i];
-new_area = ist->st->codecpar->width * 
ist->st->codecpar->height + 1*!!ist->st->codec_info_nb_frames;
+new_area = ist->st->codecpar->width * 
ist->st->codecpar->height + 1*!!ist->st->codec_info_nb_frames
+   + 500*!!(ist->st->disposition & 
AV_DISPOSITION_DEFAULT);
 if (ist->user_set_discard == AVDISCARD_ALL)
 continue;
 if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & 
AV_DISPOSITION_ATTACHED_PIC))
@@ -2221,7 +,8 @@ static int open_output_file(OptionsContext *o, const char 
*filename)
 for (i = 0; i < nb_input_streams; i++) {
 int score;
 ist = input_streams[i];
-score = ist->st->codecpar->channels + 
1*!!ist->st->codec_info_nb_frames;
+score = ist->st->codecpar->channels + 
1*!!ist->st->codec_info_nb_frames
++ 500*!!(ist->st->disposition & 
AV_DISPOSITION_DEFAULT);
 if (ist->user_set_discard == AVDISCARD_ALL)
 continue;
 if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 3/3] lavf/dump: More disposition flag dump

2019-06-19 Thread Jun Zhao
From: Jun Zhao 

More disposition flag dump

Signed-off-by: Jun Zhao 
---
 libavformat/dump.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index bb8c72f..1c44656 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -547,8 +547,16 @@ static void dump_stream_format(AVFormatContext *ic, int i,
 av_log(NULL, AV_LOG_INFO, " (visual impaired)");
 if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
 av_log(NULL, AV_LOG_INFO, " (clean effects)");
+if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
+av_log(NULL, AV_LOG_INFO, " (attached pic)");
+if (st->disposition & AV_DISPOSITION_TIMED_THUMBNAILS)
+av_log(NULL, AV_LOG_INFO, " (timed thumbnails)");
+if (st->disposition & AV_DISPOSITION_CAPTIONS)
+av_log(NULL, AV_LOG_INFO, " (captions)");
 if (st->disposition & AV_DISPOSITION_DESCRIPTIONS)
 av_log(NULL, AV_LOG_INFO, " (descriptions)");
+if (st->disposition & AV_DISPOSITION_METADATA)
+av_log(NULL, AV_LOG_INFO, " (metadata)");
 if (st->disposition & AV_DISPOSITION_DEPENDENT)
 av_log(NULL, AV_LOG_INFO, " (dependent)");
 if (st->disposition & AV_DISPOSITION_STILL_IMAGE)
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/3] lavf/utils: Respect default disposition when select the AVStream

2019-06-19 Thread Jun Zhao
From: Jun Zhao 

Respect default disposition when select the AVStream

Signed-off-by: Jun Zhao 
---
 libavformat/utils.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3d764c1..886cd6f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4218,7 +4218,8 @@ int av_find_best_stream(AVFormatContext *ic, enum 
AVMediaType type,
 continue;
 }
 }
-disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | 
AV_DISPOSITION_VISUAL_IMPAIRED));
+disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | 
AV_DISPOSITION_VISUAL_IMPAIRED))
+  + !! (st->disposition & AV_DISPOSITION_DEFAULT);
 count = st->codec_info_nb_frames;
 bitrate = par->bit_rate;
 multiframe = FFMIN(5, count);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1] lavfi/normalize: improve the performance

2019-06-20 Thread Jun Zhao
From: Jun Zhao 

Remove unnecessary max value found, it's will improve the performance
about 10%. Used the test command like:
ffmpeg -i 1080P.mp4 -an -vf normalize -f null /dev/null, the FPS change
from 96fps to 107fps.

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_normalize.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_normalize.c b/libavfilter/vf_normalize.c
index 48eea59..40dc031 100644
--- a/libavfilter/vf_normalize.c
+++ b/libavfilter/vf_normalize.c
@@ -143,14 +143,13 @@ static void normalize(NormalizeContext *s, AVFrame *in, 
AVFrame *out)
 min[c].in = max[c].in = in->data[0][s->co[c]];
 for (y = 0; y < in->height; y++) {
 uint8_t *inp = in->data[0] + y * in->linesize[0];
-uint8_t *outp = out->data[0] + y * out->linesize[0];
 for (x = 0; x < in->width; x++) {
 for (c = 0; c < 3; c++) {
-min[c].in = FFMIN(min[c].in, inp[s->co[c]]);
-max[c].in = FFMAX(max[c].in, inp[s->co[c]]);
+uint8_t val = inp[s->co[c]];
+if (val < min[c].in)  min[c].in = val;
+else if (val > max[c].in) max[c].in = val;
 }
 inp += s->step;
-outp += s->step;
 }
 }
 
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1] lavf/flvenc: add automatic bitstream filtering

2019-06-22 Thread Jun Zhao
From: Jun Zhao 

add automatic bitstream filtering when mux AAC

Signed-off-by: Jun Zhao 
---
 libavformat/flvenc.c |   27 ---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index e4863f1..fb1dede 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -653,11 +653,9 @@ end:
 return ret;
 }
 
-
-static int flv_write_header(AVFormatContext *s)
+static int flv_init(struct AVFormatContext *s)
 {
 int i;
-AVIOContext *pb = s->pb;
 FLVContext *flv = s->priv_data;
 
 for (i = 0; i < s->nb_streams; i++) {
@@ -736,6 +734,15 @@ static int flv_write_header(AVFormatContext *s)
 
 flv->delay = AV_NOPTS_VALUE;
 
+return 0;
+}
+
+static int flv_write_header(AVFormatContext *s)
+{
+int i;
+AVIOContext *pb = s->pb;
+FLVContext *flv = s->priv_data;
+
 avio_write(pb, "FLV", 3);
 avio_w8(pb, 1);
 avio_w8(pb, FLV_HEADER_FLAG_HASAUDIO * !!flv->audio_par +
@@ -1074,6 +1081,18 @@ static int flv_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 return pb->error;
 }
 
+static int flv_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)
+{
+int ret = 1;
+AVStream *st = s->streams[pkt->stream_index];
+
+if (st->codecpar->codec_id == AV_CODEC_ID_AAC) {
+if (pkt->size > 2 && (AV_RB16(pkt->data) & 0xfff0) == 0xfff0)
+ret = ff_stream_add_bitstream_filter(st, "aac_adtstoasc", NULL);
+}
+return ret;
+}
+
 static const AVOption options[] = {
 { "flvflags", "FLV muxer flags", offsetof(FLVContext, flags), 
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 
"flvflags" },
 { "aac_seq_header_detect", "Put AAC sequence header based on stream data", 
0, AV_OPT_TYPE_CONST, {.i64 = FLV_AAC_SEQ_HEADER_DETECT}, INT_MIN, INT_MAX, 
AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
@@ -1099,9 +1118,11 @@ AVOutputFormat ff_flv_muxer = {
 .priv_data_size = sizeof(FLVContext),
 .audio_codec= CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : 
AV_CODEC_ID_ADPCM_SWF,
 .video_codec= AV_CODEC_ID_FLV1,
+.init   = flv_init,
 .write_header   = flv_write_header,
 .write_packet   = flv_write_packet,
 .write_trailer  = flv_write_trailer,
+.check_bitstream= flv_check_bitstream,
 .codec_tag  = (const AVCodecTag* const []) {
   flv_video_codec_ids, flv_audio_codec_ids, 0
   },
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 0/4] Respect default disposition when select stream

2019-06-28 Thread Jun Zhao
V2: - Add FATE test case, the test clip will upload to FATE server

Jun Zhao (4):
  lavf/utils: Respect default disposition when select the AVStream
  ffmpeg_opt: Respect default disposition when select audio/video
  lavf/dump: More disposition flag dump
  fate: add disposition default test case

 fftools/ffmpeg_opt.c  |6 +-
 libavformat/dump.c|8 ++
 libavformat/utils.c   |3 +-
 tests/fate/ffmpeg.mak |4 +
 tests/ref/fate/ffmpeg-disposition_default |  106 +
 5 files changed, 124 insertions(+), 3 deletions(-)
 create mode 100644 tests/ref/fate/ffmpeg-disposition_default

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 4/4] fate: add disposition default test case

2019-06-28 Thread Jun Zhao
From: Jun Zhao 

add disposition default test case

Signed-off-by: Jun Zhao 
---
 tests/fate/ffmpeg.mak |4 +
 tests/ref/fate/ffmpeg-disposition_default |  106 +
 2 files changed, 110 insertions(+), 0 deletions(-)
 create mode 100644 tests/ref/fate/ffmpeg-disposition_default

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 71ab2f1..557064e 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -34,6 +34,10 @@ fate-ffmpeg-filter_complex_audio: CMD = framecrc 
-filter_complex "aevalsrc=0:d=0
 FATE_SAMPLES_FFMPEG-$(call ALLYES, MOV_DEMUXER PNG_DECODER ALAC_DECODER 
PCM_S16LE_ENCODER RAWVIDEO_ENCODER) += fate-ffmpeg-attached_pics
 fate-ffmpeg-attached_pics: CMD = threads=2 framecrc -i 
$(TARGET_SAMPLES)/lossless-audio/inside.m4a -c:a pcm_s16le 
-max_muxing_queue_size 16
 
+# disposition default
+FATE_SAMPLES_FFMPEG-$(call ALLYES, MOV_DEMUXER H264_DECODER AAC_DECODER) += 
fate-ffmpeg-disposition_default
+fate-ffmpeg-disposition_default: CMD = framecrc -i 
$(TARGET_SAMPLES)/mov/disposition_default.mp4 -vn -aframes 100
+
 FATE_SAMPLES_FFMPEG-$(CONFIG_COLORKEY_FILTER) += fate-ffmpeg-filter_colorkey
 fate-ffmpeg-filter_colorkey: tests/data/filtergraphs/colorkey
 fate-ffmpeg-filter_colorkey: CMD = framecrc -idct simple -fflags +bitexact 
-flags +bitexact  -sws_flags +accurate_rnd+bitexact -i 
$(TARGET_SAMPLES)/cavs/cavs.mpg -fflags +bitexact -flags +bitexact -sws_flags 
+accurate_rnd+bitexact -i $(TARGET_SAMPLES)/lena.pnm -an -filter_complex_script 
$(TARGET_PATH)/tests/data/filtergraphs/colorkey -sws_flags 
+accurate_rnd+bitexact -fflags +bitexact -flags +bitexact -qscale 2 -frames:v 10
diff --git a/tests/ref/fate/ffmpeg-disposition_default 
b/tests/ref/fate/ffmpeg-disposition_default
new file mode 100644
index 000..0ccf888
--- /dev/null
+++ b/tests/ref/fate/ffmpeg-disposition_default
@@ -0,0 +1,106 @@
+#tb 0: 1/44100
+#media_type 0: audio
+#codec_id 0: pcm_s16le
+#sample_rate 0: 44100
+#channel_layout 0: 4
+#channel_layout_name 0: mono
+0,  0,  0, 1024, 2048, 0x8e3cfba8
+0,   1024,   1024, 1024, 2048, 0x9f92feba
+0,   2048,   2048, 1024, 2048, 0x17ab01ba
+0,   3072,   3072, 1024, 2048, 0x8ae0fe83
+0,   4096,   4096, 1024, 2048, 0x27e7fdb7
+0,   5120,   5120, 1024, 2048, 0xcbe5f4e1
+0,   6144,   6144, 1024, 2048, 0xf3170253
+0,   7168,   7168, 1024, 2048, 0x842ffb9a
+0,   8192,   8192, 1024, 2048, 0xf883ffd3
+0,   9216,   9216, 1024, 2048, 0x8ba5107e
+0,  10240,  10240, 1024, 2048, 0xd9300100
+0,  11264,  11264, 1024, 2048, 0xe68df95d
+0,  12288,  12288, 1024, 2048, 0xc65bfe90
+0,  13312,  13312, 1024, 2048, 0x3a3dfe8e
+0,  14336,  14336, 1024, 2048, 0xe5e8e891
+0,  15360,  15360, 1024, 2048, 0xed3fe566
+0,  16384,  16384, 1024, 2048, 0x891a00a7
+0,  17408,  17408, 1024, 2048, 0x5733fd83
+0,  18432,  18432, 1024, 2048, 0x3f17fbf9
+0,  19456,  19456, 1024, 2048, 0x8d9af9a0
+0,  20480,  20480, 1024, 2048, 0x07befe47
+0,  21504,  21504, 1024, 2048, 0x1d9b0942
+0,  22528,  22528, 1024, 2048, 0xa80ef560
+0,  23552,  23552, 1024, 2048, 0xe32bfb07
+0,  24576,  24576, 1024, 2048, 0xa7bf12ad
+0,  25600,  25600, 1024, 2048, 0xf328f4cb
+0,  26624,  26624, 1024, 2048, 0xdfbcf999
+0,  27648,  27648, 1024, 2048, 0xe054ee68
+0,  28672,  28672, 1024, 2048, 0x23aef44f
+0,  29696,  29696, 1024, 2048, 0xe8d6f9fc
+0,  30720,  30720, 1024, 2048, 0x01760509
+0,  31744,  31744, 1024, 2048, 0x7a6af785
+0,  32768,  32768, 1024, 2048, 0x5821ea5e
+0,  33792,  33792, 1024, 2048, 0x47291609
+0,  34816,  34816, 1024, 2048, 0x40c004a5
+0,  35840,  35840, 1024, 2048, 0xc32deeed
+0,  36864,  36864, 1024, 2048, 0x594e087a
+0,  37888,  37888, 1024, 2048, 0x99680bd4
+0,  38912,  38912, 1024, 2048, 0x73c9fb51
+0,  39936,  39936, 1024, 2048, 0x983bf683
+0,  40960,  40960, 1024, 2048, 0x0b8af1dc
+0,  41984,  41984, 1024, 2048, 0x6e13fb89
+0,  43008,  43008, 1024, 2048, 0x56e3043f
+0,  44032,  44032, 1024, 2048, 0x3dd4f3b4
+0,  45056,  45056, 1024, 2048, 0x67eaf658
+0,  46080,  46080, 1024, 2048, 0x550af765
+0,  47104,  47104, 1024, 2048, 0xc2c9f90e
+0,  48128,  48128, 1024, 2048, 0x10980f21
+0,  49152,  49152, 1024, 2048, 0x6f96005b
+0,  50176,  50176, 1024, 2048, 0x3bf7f2

[FFmpeg-devel] [PATCH V2 1/4] lavf/utils: Respect default disposition when select the AVStream

2019-06-28 Thread Jun Zhao
From: Jun Zhao 

Respect default disposition when select the AVStream

Signed-off-by: Jun Zhao 
---
 libavformat/utils.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3d764c1..886cd6f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4218,7 +4218,8 @@ int av_find_best_stream(AVFormatContext *ic, enum 
AVMediaType type,
 continue;
 }
 }
-disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | 
AV_DISPOSITION_VISUAL_IMPAIRED));
+disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | 
AV_DISPOSITION_VISUAL_IMPAIRED))
+  + !! (st->disposition & AV_DISPOSITION_DEFAULT);
 count = st->codec_info_nb_frames;
 bitrate = par->bit_rate;
 multiframe = FFMIN(5, count);
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 2/4] ffmpeg_opt: Respect default disposition when select audio/video

2019-06-28 Thread Jun Zhao
From: Jun Zhao 

Respect default disposition when select audio/video

Signed-off-by: Jun Zhao 
---
 fftools/ffmpeg_opt.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 53d688b..f5ca18a 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2198,7 +2198,8 @@ static int open_output_file(OptionsContext *o, const char 
*filename)
 for (i = 0; i < nb_input_streams; i++) {
 int new_area;
 ist = input_streams[i];
-new_area = ist->st->codecpar->width * 
ist->st->codecpar->height + 1*!!ist->st->codec_info_nb_frames;
+new_area = ist->st->codecpar->width * 
ist->st->codecpar->height + 1*!!ist->st->codec_info_nb_frames
+   + 500*!!(ist->st->disposition & 
AV_DISPOSITION_DEFAULT);
 if (ist->user_set_discard == AVDISCARD_ALL)
 continue;
 if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & 
AV_DISPOSITION_ATTACHED_PIC))
@@ -2221,7 +,8 @@ static int open_output_file(OptionsContext *o, const char 
*filename)
 for (i = 0; i < nb_input_streams; i++) {
 int score;
 ist = input_streams[i];
-score = ist->st->codecpar->channels + 
1*!!ist->st->codec_info_nb_frames;
+score = ist->st->codecpar->channels + 
1*!!ist->st->codec_info_nb_frames
++ 500*!!(ist->st->disposition & 
AV_DISPOSITION_DEFAULT);
 if (ist->user_set_discard == AVDISCARD_ALL)
 continue;
 if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 3/4] lavf/dump: More disposition flag dump

2019-06-28 Thread Jun Zhao
From: Jun Zhao 

More disposition flag dump

Signed-off-by: Jun Zhao 
---
 libavformat/dump.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index bb8c72f..1c44656 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -547,8 +547,16 @@ static void dump_stream_format(AVFormatContext *ic, int i,
 av_log(NULL, AV_LOG_INFO, " (visual impaired)");
 if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
 av_log(NULL, AV_LOG_INFO, " (clean effects)");
+if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
+av_log(NULL, AV_LOG_INFO, " (attached pic)");
+if (st->disposition & AV_DISPOSITION_TIMED_THUMBNAILS)
+av_log(NULL, AV_LOG_INFO, " (timed thumbnails)");
+if (st->disposition & AV_DISPOSITION_CAPTIONS)
+av_log(NULL, AV_LOG_INFO, " (captions)");
 if (st->disposition & AV_DISPOSITION_DESCRIPTIONS)
 av_log(NULL, AV_LOG_INFO, " (descriptions)");
+if (st->disposition & AV_DISPOSITION_METADATA)
+av_log(NULL, AV_LOG_INFO, " (metadata)");
 if (st->disposition & AV_DISPOSITION_DEPENDENT)
 av_log(NULL, AV_LOG_INFO, " (dependent)");
 if (st->disposition & AV_DISPOSITION_STILL_IMAGE)
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V1 1/2] doc/muxers: fix and update docs for HLS muxer

2019-06-28 Thread Jun Zhao
From: Jun Zhao 

fix and update docs for HLS muxer

Signed-off-by: Jun Zhao 
---
 doc/muxers.texi |   68 ++
 1 files changed, 38 insertions(+), 30 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index dd64672..d93d1cf 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -554,32 +554,32 @@ segmentation.
 This muxer supports the following options:
 
 @table @option
-@item hls_init_time @var{seconds}
+@item -hls_init_time @var{seconds}
 Set the initial target segment length in seconds. Default value is @var{0}.
 Segment will be cut on the next key frame after this time has passed on the 
first m3u8 list.
 After the initial playlist is filled @command{ffmpeg} will cut segments
 at duration equal to @code{hls_time}
 
-@item hls_time @var{seconds}
+@item -hls_time @var{seconds}
 Set the target segment length in seconds. Default value is 2.
 Segment will be cut on the next key frame after this time has passed.
 
-@item hls_list_size @var{size}
+@item -hls_list_size @var{size}
 Set the maximum number of playlist entries. If set to 0 the list file
 will contain all the segments. Default value is 5.
 
-@item hls_delete_threshold @var{size}
+@item -hls_delete_threshold @var{size}
 Set the number of unreferenced segments to keep on disk before @code{hls_flags 
delete_segments}
 deletes them. Increase this to allow continue clients to download segments 
which
 were recently referenced in the playlist. Default value is 1, meaning segments 
older than
 @code{hls_list_size+1} will be deleted.
 
-@item hls_ts_options @var{options_list}
+@item -hls_ts_options @var{options_list}
 Set output format options using a :-separated list of key=value
 parameters. Values containing @code{:} special characters must be
 escaped.
 
-@item hls_wrap @var{wrap}
+@item -hls_wrap @var{wrap}
 This is a deprecated option, you can use @code{hls_list_size}
 and @code{hls_flags delete_segments} instead it
 
@@ -588,7 +588,7 @@ files, and limits the maximum number of segment files 
written to disk
 to @var{wrap}.
 
 
-@item hls_start_number_source
+@item -hls_start_number_source
 Start the playlist sequence number (@code{#EXT-X-MEDIA-SEQUENCE}) according to 
the specified source.
 Unless @code{hls_flags single_file} is set, it also specifies source of 
starting sequence numbers of
 segment and subtitle filenames. In any case, if @code{hls_flags append_list}
@@ -610,16 +610,16 @@ The start number will be based on the current date/time 
as mmddHHMMSS. e.g.
 
 @end table
 
-@item start_number @var{number}
+@item -start_number @var{number}
 Start the playlist sequence number (@code{#EXT-X-MEDIA-SEQUENCE}) from the 
specified @var{number}
 when @var{hls_start_number_source} value is @var{generic}. (This is the 
default case.)
 Unless @code{hls_flags single_file} is set, it also specifies starting 
sequence numbers of segment and subtitle filenames.
 Default value is 0.
 
-@item hls_allow_cache @var{allowcache}
+@item -hls_allow_cache @var{allowcache}
 Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
 
-@item hls_base_url @var{baseurl}
+@item -hls_base_url @var{baseurl}
 Append @var{baseurl} to every entry in the playlist.
 Useful to generate playlists with absolute paths.
 
@@ -628,7 +628,7 @@ and it is not to be confused with the segment filename 
sequence number
 which can be cyclic, for example if the @option{wrap} option is
 specified.
 
-@item hls_segment_filename @var{filename}
+@item -hls_segment_filename @var{filename}
 Set the segment filename. Unless @code{hls_flags single_file} is set,
 @var{filename} is used as a string format with the segment number:
 @example
@@ -670,10 +670,10 @@ This example will produce the playlists segment file sets:
 @file{vs0/file_000.ts}, @file{vs0/file_001.ts}, @file{vs0/file_002.ts}, etc. 
and
 @file{vs1/file_000.ts}, @file{vs1/file_001.ts}, @file{vs1/file_002.ts}, etc.
 
-@item use_localtime
+@item -use_localtime
 Same as strftime option, will be deprecated.
 
-@item strftime
+@item -strftime
 Use strftime() on @var{filename} to expand the segment filename with localtime.
 The segment number is also available in this mode, but to use it, you need to 
specify second_level_segment_index
 hls_flag and %%d will be the specifier.
@@ -690,10 +690,10 @@ ffmpeg -i in.nut -strftime 1 -hls_flags 
second_level_segment_index -hls_segment_
 This example will produce the playlist, @file{out.m3u8}, and segment files:
 @file{file-20160215-0001.ts}, @file{file-20160215-0002.ts}, etc.
 
-@item use_localtime_mkdir
+@item -use_localtime_mkdir
 Same as strftime_mkdir option, will be deprecated .
 
-@item strftime_mkdir
+@item -strftime_mkdir
 Used together with -strftime_mkdir, it will create all subdirectories which
 is expanded in @var{filename}.
 @example
@@ -711,7 +711,7 @@ produce the playlist, @file{out.m3u8}, and segment files:
 @file{2016/02/15/file-20160215-1455569023.ts}, 
@file{2016/02/15/file-20160215-1455569024.ts

[FFmpeg-devel] [PATCH V1 2/2] doc/muxers: fix docs format for DASH muxer

2019-06-28 Thread Jun Zhao
From: Jun Zhao 

fix docs format for DASH muxer

Signed-off-by: Jun Zhao 
---
 doc/muxers.texi |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index d93d1cf..044c838 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -256,7 +256,7 @@ DASH-templated name to used for the initialization segment. 
Default is "init-str
 DASH-templated name to used for the media segments. Default is 
"chunk-stream$RepresentationID$-$Number%05d$.$ext$". "$ext$" is replaced with 
the file name extension specific for the segment format.
 @item -utc_timing_url @var{utc_url}
 URL of the page that will return the UTC timestamp in ISO format. Example: 
"https://time.akamai.com/?iso";
-@item method @var{method}
+@item -method @var{method}
 Use the given HTTP method to create output files. Generally set to PUT or POST.
 @item -http_user_agent @var{user_agent}
 Override User-Agent field in HTTP header. Applicable only for HTTP output.
@@ -298,6 +298,7 @@ Write global SIDX atom. Applicable only for single file, 
mp4 output, non-streami
 
 @item -dash_segment_type @var{dash_segment_type}
 Possible values:
+@table @option
 @item auto
 If this flag is set, the dash segment files format will be selected based on 
the stream codec. This is the default mode.
 
@@ -306,6 +307,7 @@ If this flag is set, the dash segment files will be in in 
ISOBMFF format.
 
 @item webm
 If this flag is set, the dash segment files will be in in WebM format.
+@end table
 
 @item -ignore_io_errors @var{ignore_io_errors}
 Ignore IO errors during open and write. Useful for long-duration runs with 
network output.
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 0/2] Fix and update docs for HLS/DASH muxer

2019-06-28 Thread Jun Zhao
V2: - remove hyphen from option name in the docs

Jun Zhao (2):
  doc/muxers: fix and update docs for HLS muxer
  doc/muxers: fix docs format for DASH muxer

 doc/muxers.texi |   86 ++
 1 files changed, 48 insertions(+), 38 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2 2/2] doc/muxers: fix docs format for DASH muxer

2019-06-28 Thread Jun Zhao
From: Jun Zhao 

fix docs format for DASH muxer

Signed-off-by: Jun Zhao 
---
 doc/muxers.texi |   62 --
 1 files changed, 32 insertions(+), 30 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index d179584..c220bd2 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -220,64 +220,64 @@ In addition to the standard identifiers, an 
ffmpeg-specific "$ext$" identifier i
 When specified ffmpeg will replace $ext$ in the file name with muxing format's 
extensions such as mp4, webm etc.,
 
 @example
-ffmpeg -re -i  -map 0 -map 0 -c:a libfdk_aac -c:v libx264
--b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline
--profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0
--b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1
--window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a"
+ffmpeg -re -i  -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
+-b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
+-profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
+-b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
+-window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \
 -f dash /path/to/out.mpd
 @end example
 
 @table @option
-@item -min_seg_duration @var{microseconds}
+@item min_seg_duration @var{microseconds}
 This is a deprecated option to set the segment length in microseconds, use 
@var{seg_duration} instead.
-@item -seg_duration @var{duration}
+@item seg_duration @var{duration}
 Set the segment length in seconds (fractional value can be set). The value is
 treated as average segment duration when @var{use_template} is enabled and
 @var{use_timeline} is disabled and as minimum segment duration for all the 
other
 use cases.
-@item -window_size @var{size}
+@item window_size @var{size}
 Set the maximum number of segments kept in the manifest.
-@item -extra_window_size @var{size}
+@item extra_window_size @var{size}
 Set the maximum number of segments kept outside of the manifest before 
removing from disk.
-@item -remove_at_exit @var{remove}
+@item remove_at_exit @var{remove}
 Enable (1) or disable (0) removal of all segments when finished.
-@item -use_template @var{template}
+@item use_template @var{template}
 Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.
-@item -use_timeline @var{timeline}
+@item use_timeline @var{timeline}
 Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.
-@item -single_file @var{single_file}
+@item single_file @var{single_file}
 Enable (1) or disable (0) storing all segments in one file, accessed using 
byte ranges.
-@item -single_file_name @var{file_name}
+@item single_file_name @var{file_name}
 DASH-templated name to be used for baseURL. Implies @var{single_file} set to 
"1". In the template, "$ext$" is replaced with the file name extension specific 
for the segment format.
-@item -init_seg_name @var{init_name}
+@item init_seg_name @var{init_name}
 DASH-templated name to used for the initialization segment. Default is 
"init-stream$RepresentationID$.$ext$". "$ext$" is replaced with the file name 
extension specific for the segment format.
-@item -media_seg_name @var{segment_name}
+@item media_seg_name @var{segment_name}
 DASH-templated name to used for the media segments. Default is 
"chunk-stream$RepresentationID$-$Number%05d$.$ext$". "$ext$" is replaced with 
the file name extension specific for the segment format.
-@item -utc_timing_url @var{utc_url}
+@item utc_timing_url @var{utc_url}
 URL of the page that will return the UTC timestamp in ISO format. Example: 
"https://time.akamai.com/?iso";
 @item method @var{method}
 Use the given HTTP method to create output files. Generally set to PUT or POST.
-@item -http_user_agent @var{user_agent}
+@item http_user_agent @var{user_agent}
 Override User-Agent field in HTTP header. Applicable only for HTTP output.
-@item -http_persistent @var{http_persistent}
+@item http_persistent @var{http_persistent}
 Use persistent HTTP connections. Applicable only for HTTP output.
-@item -hls_playlist @var{hls_playlist}
+@item hls_playlist @var{hls_playlist}
 Generate HLS playlist files as well. The master playlist is generated with the 
filename master.m3u8.
 One media playlist file is generated for each stream with filenames 
media_0.m3u8, media_1.m3u8, etc.
-@item -streaming @var{streaming}
+@item streaming @var{streaming}
 Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming
 mode, each frame will be a moof fragment which forms a chunk.
-@item -adaptation_sets @var{adaptation_sets}
+@item adaptation_sets @var{adaptation_sets}
 Assign streams to AdaptationSets. Syntax is "id=x,streams=a,b,c 
id=y,streams=d,e" with x and y being the IDs
 of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.
 
 To map all video (or audio) streams t

[FFmpeg-devel] [PATCH V2 1/2] doc/muxers: fix and update docs for HLS muxer

2019-06-28 Thread Jun Zhao
From: Jun Zhao 

fix and update docs for HLS muxer

Signed-off-by: Jun Zhao 
---
 doc/muxers.texi |   24 
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index dd64672..d179584 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -525,7 +525,7 @@ See also the @ref{framehash} muxer.
 @anchor{hls}
 @section hls
 
-Apple HTTP Live Streaming muxer that segments MPEG-TS according to
+Apple HTTP Live Streaming muxer that segments MPEG-TS/fragmented MP4 according 
to
 the HTTP Live Streaming (HLS) specification.
 
 It creates a playlist file, and one or more segment files. The output filename
@@ -767,20 +767,20 @@ ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags 
delete_segments \
   -hls_key_info_file file.keyinfo out.m3u8
 @end example
 
-@item -hls_enc @var{enc}
+@item hls_enc @var{enc}
 Enable (1) or disable (0) the AES128 encryption.
 When enabled every segment generated is encrypted and the encryption key
 is saved as @var{playlist name}.key.
 
-@item -hls_enc_key @var{key}
+@item hls_enc_key @var{key}
 Hex-coded 16byte key to encrypt the segments, by default it
 is randomly generated.
 
-@item -hls_enc_key_url @var{keyurl}
+@item hls_enc_key_url @var{keyurl}
 If set, @var{keyurl} is prepended instead of @var{baseurl} to the key filename
 in the playlist.
 
-@item -hls_enc_iv @var{iv}
+@item hls_enc_iv @var{iv}
 Hex-coded 16byte initialization vector for every segment instead
 of the autogenerated ones.
 
@@ -901,14 +901,22 @@ are always written into temporary file regardles of this 
flag if @code{master_pl
 
 @end table
 
-@item hls_playlist_type event
+@item hls_playlist_type @var{int}
+Set the HLS playlist type, Default value is 0.
+
+Other possible values:
+@table @option
+
+@item event
 Emit @code{#EXT-X-PLAYLIST-TYPE:EVENT} in the m3u8 header. Forces
 @option{hls_list_size} to 0; the playlist can only be appended to.
 
-@item hls_playlist_type vod
+@item vod
 Emit @code{#EXT-X-PLAYLIST-TYPE:VOD} in the m3u8 header. Forces
 @option{hls_list_size} to 0; the playlist must not change.
 
+@end table
+
 @item method
 Use the given HTTP method to create the hls files.
 @example
@@ -1090,7 +1098,7 @@ Use persistent HTTP connections. Applicable only for HTTP 
output.
 @item timeout
 Set timeout for socket I/O operations. Applicable only for HTTP output.
 
-@item -ignore_io_errors
+@item ignore_io_errors
 Ignore IO errors during open, write and delete. Useful for long-duration runs 
with network output.
 
 @item headers
-- 
1.7.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-requ...@ffmpeg.org with subject "unsubscribe".

  1   2   3   4   5   6   7   8   9   10   >