Re: [FFmpeg-devel] [PATCH v2 1/2] configure: Change the configure check for tonemap_vaapi
> -Original Message- > From: Sun, Xinpeng > Sent: Monday, December 30, 2019 3:33 PM > To: ffmpeg-devel@ffmpeg.org > Cc: Sun, Xinpeng > Subject: [PATCH v2 1/2] configure: Change the configure check for > tonemap_vaapi > > "VAProcFilterParameterBufferHDRToneMapping" was defined in libva 2.4.1, > which will lead to build failure for the filter tonemap_vaapi for libva 2.3.0 > with > current check. This patch is to fix this build error. > > Signed-off-by: Xinpeng Sun > --- > configure | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/configure b/configure > index 43dc409fe6..01b4acd77e 100755 > --- a/configure > +++ b/configure > @@ -3579,7 +3579,7 @@ tinterlace_filter_deps="gpl" > tinterlace_merge_test_deps="tinterlace_filter" > tinterlace_pad_test_deps="tinterlace_filter" > tonemap_filter_deps="const_nan" > -tonemap_vaapi_filter_deps="vaapi > VAProcPipelineParameterBuffer_output_hdr_metadata" > +tonemap_vaapi_filter_deps="vaapi > VAProcFilterParameterBufferHDRToneMapping" > tonemap_opencl_filter_deps="opencl const_nan" > transpose_opencl_filter_deps="opencl" > transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags" > @@ -6584,7 +6584,7 @@ if enabled vaapi; then > > check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC" > check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth > -check_struct "va/va.h va/va_vpp.h" "VAProcPipelineParameterBuffer" > output_hdr_metadata > +check_type "va/va.h va/va_vpp.h" > "VAProcFilterParameterBufferHDRToneMapping" > check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags > check_type "va/va.h va/va_enc_hevc.h" > "VAEncPictureParameterBufferHEVC" > check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG" > -- > 2.17.1 Ping. Thanks, Xinpeng ___ 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".
Re: [FFmpeg-devel] [PATCH] HEVC: Export motion vectors to frame side data.
On Thu, Jan 2, 2020 at 11:59 AM Asaf Kave wrote: > > > On Sun, Dec 29, 2019 at 4:08 PM Asaf Kave wrote: > >> --- >> libavcodec/hevc_refs.c | 15 >> libavcodec/hevcdec.c | 173 - >> libavcodec/hevcdec.h | 13 >> 3 files changed, 200 insertions(+), 1 deletion(-) >> >> diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c >> index 7870a72fd6..20f028fa73 100644 >> --- a/libavcodec/hevc_refs.c >> +++ b/libavcodec/hevc_refs.c >> @@ -42,6 +42,9 @@ void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame >> *frame, int flags) >> av_buffer_unref(&frame->tab_mvf_buf); >> frame->tab_mvf = NULL; >> >> +av_buffer_unref(&frame->cuh_buf); >> +frame->cuh = NULL; >> + >> av_buffer_unref(&frame->rpl_buf); >> av_buffer_unref(&frame->rpl_tab_buf); >> frame->rpl_tab= NULL; >> @@ -101,11 +104,17 @@ static HEVCFrame *alloc_frame(HEVCContext *s) >> goto fail; >> frame->tab_mvf = (MvField *)frame->tab_mvf_buf->data; >> >> +frame->cuh_buf = av_buffer_pool_get(s->cuh_pool); >> +if (!frame->cuh_buf) >> +goto fail; >> +frame->cuh = (CodingUnitHelper *)frame->cuh_buf->data; >> + >> frame->rpl_tab_buf = av_buffer_pool_get(s->rpl_tab_pool); >> if (!frame->rpl_tab_buf) >> goto fail; >> frame->rpl_tab = (RefPicListTab **)frame->rpl_tab_buf->data; >> frame->ctb_count = s->ps.sps->ctb_width * s->ps.sps->ctb_height; >> +frame->cu_count = 0; >> for (j = 0; j < frame->ctb_count; j++) >> frame->rpl_tab[j] = (RefPicListTab *)frame->rpl_buf->data; >> >> @@ -161,6 +170,10 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame >> **frame, int poc) >> else >> ref->flags = HEVC_FRAME_FLAG_SHORT_REF; >> >> +if (s->avctx->flags2 & AV_CODEC_FLAG2_EXPORT_MVS) { >> +ref->flags |= HEVC_FRAME_FLAG_MV; >> +} >> + >> ref->poc = poc; >> ref->sequence = s->seq_decode; >> ref->frame->crop_left = s->ps.sps->output_window.left_offset; >> @@ -216,6 +229,8 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame >> *out, int flush) >> if (ret < 0) >> return ret; >> >> +s->output_frame_poc = frame->poc; >> + >> av_log(s->avctx, AV_LOG_DEBUG, >> "Output frame with POC %d.\n", frame->poc); >> return 1; >> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c >> index 19b0cd815d..aedc559283 100644 >> --- a/libavcodec/hevcdec.c >> +++ b/libavcodec/hevcdec.c >> @@ -32,6 +32,7 @@ >> #include "libavutil/opt.h" >> #include "libavutil/pixdesc.h" >> #include "libavutil/stereo3d.h" >> +#include "libavutil/motion_vector.h" >> >> #include "bswapdsp.h" >> #include "bytestream.h" >> @@ -80,6 +81,7 @@ static void pic_arrays_free(HEVCContext *s) >> av_freep(&s->sh.offset); >> >> av_buffer_pool_uninit(&s->tab_mvf_pool); >> +av_buffer_pool_uninit(&s->cuh_pool); >> av_buffer_pool_uninit(&s->rpl_tab_pool); >> } >> >> @@ -128,9 +130,11 @@ static int pic_arrays_init(HEVCContext *s, const >> HEVCSPS *sps) >> >> s->tab_mvf_pool = av_buffer_pool_init(min_pu_size * sizeof(MvField), >>av_buffer_allocz); >> +s->cuh_pool = av_buffer_pool_init(min_pu_size * >> sizeof(CodingUnitHelper), >> + av_buffer_allocz); >> s->rpl_tab_pool = av_buffer_pool_init(ctb_count * >> sizeof(RefPicListTab), >>av_buffer_allocz); >> -if (!s->tab_mvf_pool || !s->rpl_tab_pool) >> +if (!s->tab_mvf_pool || !s->rpl_tab_pool || !s->cuh_pool) >> goto fail; >> >> return 0; >> @@ -1806,6 +1810,7 @@ static void hls_prediction_unit(HEVCContext *s, int >> x0, int y0, >> int min_pu_width = s->ps.sps->min_pu_width; >> >> MvField *tab_mvf = s->ref->tab_mvf; >> +CodingUnitHelper *cuh = s->ref->cuh; >> RefPicList *refPicList = s->ref->refPicList; >> HEVCFrame *ref0 = NULL, *ref1 = NULL; >> uint8_t *dst0 = POS(0, x0, y0); >> @@ -1843,6 +1848,9 @@ static void hls_prediction_unit(HEVCContext *s, int >> x0, int y0, >> for (i = 0; i < nPbW >> s->ps.sps->log2_min_pu_size; i++) >> tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv; >> >> +struct CodingUnitHelper cuh_ = {lc->cu, log2_cb_size }; >> +cuh[s->ref->cu_count++] = cuh_; >> + >> if (current_mv.pred_flag & PF_L0) { >> ref0 = refPicList[0].ref[current_mv.ref_idx[0]]; >> if (!ref0) >> @@ -3192,6 +3200,160 @@ static int hevc_decode_extradata(HEVCContext *s, >> uint8_t *buf, int length, int f >> return 0; >> } >> >> +static int set_mv(AVMotionVector *mv, int puW, int puH, >> + int dst_x, int dst_y, >> + int motion_x, int motion_y, int motion_scale, >> + int direction)
Re: [FFmpeg-devel] [PATCH v2] avfilter: add overlay vaapi filter
On Mon, Jan 06, 2020 at 15:48:21 +0800, Xinpeng Sun wrote: > +@item x > +Set the x coordinate of the overlaid video on the main video. > +Default value is @code{0}. > + > +@item y > +Set the x coordinate of the overlaid video on the main video. > +Default value is @code{0}. Copy/paste error: "y coordinate", not "x coordinate". > +Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs > are yuv420p format. > +@example > +-i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, > hwupload[b], [a][b]overlay_vaapi" OUTPUT "Both inputs are yuv420p format" is a bit misleading. I guess you mean the inputs to the filter, it could also be read as the two input files to ffmpeg? You are converting LOGO to yuv420p, so it doesn't need to be yuv420p originally. > +if (!support_flag) { > + av_log(avctx, AV_LOG_ERROR, "VAAPI driver doesn't support global alpha > blending\n"); > +return AVERROR(EINVAL); Still incorrect indentation. > +output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3]; Is this a double typecast? Just wondering. Cheers, Moritz ___ 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".
Re: [FFmpeg-devel] [PATCH 1/6] avformat: remove unneded avio_flush() calls before calling avio_close_dyn_buf()
On Sun, Jan 05, 2020 at 14:14:08 +0100, Marton Balint wrote: > Subject: avformat: remove unneded avio_flush() calls before calling > avio_close_dyn_buf() ^ Pasky nit: "unneeded". ;-) ___ 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".
Re: [FFmpeg-devel] [PATCH] lavc/pthread_frame: Update user context in ff_frame_thread_free
Hi, > -Original Message- > From: ffmpeg-devel On Behalf Of Fu, > Linjie > Sent: Monday, December 30, 2019 09:45 > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH] lavc/pthread_frame: Update user > context in ff_frame_thread_free > > Hi, > > > -Original Message- > > From: Fu, Linjie > > Sent: Friday, December 27, 2019 16:48 > > To: ffmpeg-devel@ffmpeg.org > > Cc: Fu, Linjie > > Subject: [PATCH] lavc/pthread_frame: Update user context in > > ff_frame_thread_free > > > > Resolution/format changes lead to re-initialization of hardware > > accelerations(vaapi/dxva2/..) with new hwaccel_priv_data in > > the worker-thread. But hwaccel_priv_data in user context won't > > be updated until the resolution changing frame is output. > > > > A termination with "-vframes" just after the reinit will lead to: > > 1. memory leak in worker-thread. > > 2. double free in user-thread. > > > > Update user context in ff_frame_thread_free with the last thread > > submit_packet() was called on. > > > > To reproduce: > > ffmpeg -hwaccel vaapi(dxva2) -v verbose -i > > fate-suite/h264/reinit-large_420_8-to-small_420_8.h264 -pix_fmt nv12 > > -f rawvideo -vsync passthrough -vframes 47 -y out.yuv > > > > Signed-off-by: Linjie Fu > > --- > > libavcodec/pthread_frame.c | 7 +++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c > > index 36ac0ac..8bdd735 100644 > > --- a/libavcodec/pthread_frame.c > > +++ b/libavcodec/pthread_frame.c > > @@ -657,6 +657,13 @@ void ff_frame_thread_free(AVCodecContext > *avctx, > > int thread_count) > > > > park_frame_worker_threads(fctx, thread_count); > > > > +if (fctx->prev_thread && avctx->internal->hwaccel_priv_data != > > + > > fctx->prev_thread->avctx->internal->hwaccel_priv_data) { > > +if (update_context_from_thread(avctx, fctx->prev_thread->avctx, 1) > < > > 0) { > > +av_log(avctx, AV_LOG_ERROR, "Failed to update user thread.\n"); > > +} > > +} > > + > > if (fctx->prev_thread && fctx->prev_thread != fctx->threads) > > if (update_context_from_thread(fctx->threads->avctx, fctx- > > >prev_thread->avctx, 0) < 0) { > > av_log(avctx, AV_LOG_ERROR, "Final thread update failed\n"); > > -- > > 2.7.4 > > Ping. > This patch helps to fix the decoding crashes. > Ping. - linjie ___ 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] avcodec/vmdaudio: Check block_align more
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 19788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMDAUDIO_fuzzer-5743379690553344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/vmdaudio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/vmdaudio.c b/libavcodec/vmdaudio.c index c7826fa3ce..dfbd49fd84 100644 --- a/libavcodec/vmdaudio.c +++ b/libavcodec/vmdaudio.c @@ -76,7 +76,9 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n"); return AVERROR(EINVAL); } -if (avctx->block_align < 1 || avctx->block_align % avctx->channels) { +if (avctx->block_align < 1 || avctx->block_align % avctx->channels || +avctx->block_align > INT_MAX - avctx->channels +) { av_log(avctx, AV_LOG_ERROR, "invalid block align\n"); return AVERROR(EINVAL); } -- 2.24.0 ___ 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".
Re: [FFmpeg-devel] [PATCH v2] avfilter: add overlay vaapi filter
> -Original Message- > From: ffmpeg-devel On Behalf Of Moritz > Barsnick > Sent: Monday, January 6, 2020 5:18 PM > To: FFmpeg development discussions and patches > Subject: Re: [FFmpeg-devel] [PATCH v2] avfilter: add overlay vaapi filter > > On Mon, Jan 06, 2020 at 15:48:21 +0800, Xinpeng Sun wrote: > > +@item x > > +Set the x coordinate of the overlaid video on the main video. > > +Default value is @code{0}. > > + > > +@item y > > +Set the x coordinate of the overlaid video on the main video. > > +Default value is @code{0}. > > Copy/paste error: "y coordinate", not "x coordinate". Will fix in the next version. > > > +Overlay an image LOGO at the top-left corner of the INPUT video. Both > inputs are yuv420p format. > > +@example > > +-i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], > > +[1:v]format=yuv420p, hwupload[b], [a][b]overlay_vaapi" OUTPUT > > "Both inputs are yuv420p format" is a bit misleading. I guess you mean the > inputs to the filter, it could also be read as the two input files to ffmpeg? > You are > converting LOGO to yuv420p, so it doesn't need to be yuv420p originally. > The "inputs" here refers to the inputs for the filter. How about changing the description to " Both inputs for this filter are yuv420p format "? > > +if (!support_flag) { > > + av_log(avctx, AV_LOG_ERROR, "VAAPI driver doesn't support global > > alpha > blending\n"); > > +return AVERROR(EINVAL); > > Still incorrect indentation. Sorry about this. I will double check and prevent this from happening again. > > > +output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3]; > > Is this a double typecast? Just wondering. Yes. IMHO, it mainly for safety to be compatible with each platform. > > Cheers, > Moritz > ___ > 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 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] avfilter/af_amix: change the max range of the number of inputs
From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/af_amix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index 89a1b0568f..1e1753b078 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -182,7 +182,7 @@ typedef struct MixContext { #define F AV_OPT_FLAG_FILTERING_PARAM static const AVOption amix_options[] = { { "inputs", "Number of inputs.", -OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, 1024, A|F }, +OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, A|F }, { "duration", "How to determine the end-of-stream.", OFFSET(duration_mode), AV_OPT_TYPE_INT, { .i64 = DURATION_LONGEST }, 0, 2, A|F, "duration" }, { "longest", "Duration of longest input.", 0, AV_OPT_TYPE_CONST, { .i64 = DURATION_LONGEST }, 0, 0, A|F, "duration" }, -- 2.21.0 ___ 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] avcodec/decode: replace avctx->internal with avci for better readability
From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/decode.c | 52 +++-- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index cd275bacc4..03b9da25f9 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -479,32 +479,32 @@ static int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame) side= av_packet_get_side_data(avci->last_pkt_props, AV_PKT_DATA_SKIP_SAMPLES, &side_size); if(side && side_size>=10) { -avctx->internal->skip_samples = AV_RL32(side) * avctx->internal->skip_samples_multiplier; +avci->skip_samples = AV_RL32(side) * avci->skip_samples_multiplier; discard_padding = AV_RL32(side + 4); av_log(avctx, AV_LOG_DEBUG, "skip %d / discard %d samples due to side data\n", - avctx->internal->skip_samples, (int)discard_padding); + avci->skip_samples, (int)discard_padding); skip_reason = AV_RL8(side + 8); discard_reason = AV_RL8(side + 9); } if ((frame->flags & AV_FRAME_FLAG_DISCARD) && got_frame && !(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) { -avctx->internal->skip_samples = FFMAX(0, avctx->internal->skip_samples - frame->nb_samples); +avci->skip_samples = FFMAX(0, avci->skip_samples - frame->nb_samples); got_frame = 0; } -if (avctx->internal->skip_samples > 0 && got_frame && +if (avci->skip_samples > 0 && got_frame && !(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) { -if(frame->nb_samples <= avctx->internal->skip_samples){ +if(frame->nb_samples <= avci->skip_samples){ got_frame = 0; -avctx->internal->skip_samples -= frame->nb_samples; +avci->skip_samples -= frame->nb_samples; av_log(avctx, AV_LOG_DEBUG, "skip whole frame, skip left: %d\n", - avctx->internal->skip_samples); + avci->skip_samples); } else { -av_samples_copy(frame->extended_data, frame->extended_data, 0, avctx->internal->skip_samples, -frame->nb_samples - avctx->internal->skip_samples, avctx->channels, frame->format); +av_samples_copy(frame->extended_data, frame->extended_data, 0, avci->skip_samples, +frame->nb_samples - avci->skip_samples, avctx->channels, frame->format); if(avctx->pkt_timebase.num && avctx->sample_rate) { -int64_t diff_ts = av_rescale_q(avctx->internal->skip_samples, +int64_t diff_ts = av_rescale_q(avci->skip_samples, (AVRational){1, avctx->sample_rate}, avctx->pkt_timebase); if(frame->pts!=AV_NOPTS_VALUE) @@ -523,9 +523,9 @@ FF_ENABLE_DEPRECATION_WARNINGS av_log(avctx, AV_LOG_WARNING, "Could not update timestamps for skipped samples.\n"); } av_log(avctx, AV_LOG_DEBUG, "skip %d/%d samples\n", - avctx->internal->skip_samples, frame->nb_samples); -frame->nb_samples -= avctx->internal->skip_samples; -avctx->internal->skip_samples = 0; + avci->skip_samples, frame->nb_samples); +frame->nb_samples -= avci->skip_samples; +avci->skip_samples = 0; } } @@ -551,11 +551,11 @@ FF_ENABLE_DEPRECATION_WARNINGS if ((avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL) && got_frame) { AVFrameSideData *fside = av_frame_new_side_data(frame, AV_FRAME_DATA_SKIP_SAMPLES, 10); if (fside) { -AV_WL32(fside->data, avctx->internal->skip_samples); +AV_WL32(fside->data, avci->skip_samples); AV_WL32(fside->data + 4, discard_padding); AV_WL8(fside->data + 8, skip_reason); AV_WL8(fside->data + 9, discard_reason); -avctx->internal->skip_samples = 0; +avci->skip_samples = 0; } } } @@ -580,7 +580,7 @@ FF_ENABLE_DEPRECATION_WARNINGS /* do not stop draining when actual_got_frame != 0 or ret < 0 */ /* got_frame == 0 but actual_got_frame != 0 when frame is discarded */ -if (avctx->internal->draining && !actual_got_frame) { +if (avci->draining && !actual_got_frame) { if (ret < 0) { /* prevent infinite loop if a decoder wrongly always return error on draining */ /* reasonable nb_errors_max = maximum b frames + thread count */ @@ -2030,15 +2030,17 @@ static void bsfs_flush(AVCodecContext *avctx) void avcodec_flush_buffers(AVCodecContext *avctx) { -avctx->interna
Re: [FFmpeg-devel] [PATCH 2/6] avformat: remove uneeded avio_flush() calls from the end of write_header functions
On Mon, 6 Jan 2020, Marton Balint wrote: On Sun, 5 Jan 2020, Martin Storsjö wrote: On Sun, 5 Jan 2020, Marton Balint wrote: The IO context is flushed by libavformat/mux.c after writing the header by calling avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_UNKNOWN), so this change should have no effect at all. Signed-off-by: Marton Balint If I read avio_write_marker correctly, it won't do an implicit flush on these calls unless the user actually has set the s->write_data_type function pointer - which only is set when used by direct API users. So for normal cases, if I read it correctly, one can't assume avio_write_marker implies a flush in general. Yes, you are right, I missed that too... I believe the patch is still correct if I fix the commit message: avformat: remove avio_flush() calls from the end of write_header functions Hmm, yes, with that reasoning I think it is ok. // Martin ___ 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".
Re: [FFmpeg-devel] [PATCH v1] avfilter/af_amix: change the max range of the number of inputs
Limit is not real, its too big. On 1/6/20, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Signed-off-by: Limin Wang > --- > libavfilter/af_amix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c > index 89a1b0568f..1e1753b078 100644 > --- a/libavfilter/af_amix.c > +++ b/libavfilter/af_amix.c > @@ -182,7 +182,7 @@ typedef struct MixContext { > #define F AV_OPT_FLAG_FILTERING_PARAM > static const AVOption amix_options[] = { > { "inputs", "Number of inputs.", > -OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, 1024, A|F > }, > +OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, > A|F }, > { "duration", "How to determine the end-of-stream.", > OFFSET(duration_mode), AV_OPT_TYPE_INT, { .i64 = > DURATION_LONGEST }, 0, 2, A|F, "duration" }, > { "longest", "Duration of longest input.", 0, AV_OPT_TYPE_CONST, > { .i64 = DURATION_LONGEST }, 0, 0, A|F, "duration" }, > -- > 2.21.0 > > ___ > 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 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".
Re: [FFmpeg-devel] [PATCH v1] avfilter/af_amix: change the max range of the number of inputs
On Mon, Jan 06, 2020 at 01:28:45PM +0100, Paul B Mahol wrote: > Limit is not real, its too big. So what's reasonable value to use? I notice video mix choose INT_MAX, so I use the same. [lmwang@vpn ffmpeg]$ grep nb_inputs libavfilter/vf_mix.c |grep INT_MAX { "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=2}, 2, INT_MAX, .flags = FLAGS }, > > On 1/6/20, lance.lmw...@gmail.com wrote: > > From: Limin Wang > > > > Signed-off-by: Limin Wang > > --- > > libavfilter/af_amix.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c > > index 89a1b0568f..1e1753b078 100644 > > --- a/libavfilter/af_amix.c > > +++ b/libavfilter/af_amix.c > > @@ -182,7 +182,7 @@ typedef struct MixContext { > > #define F AV_OPT_FLAG_FILTERING_PARAM > > static const AVOption amix_options[] = { > > { "inputs", "Number of inputs.", > > -OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, 1024, A|F > > }, > > +OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, > > A|F }, > > { "duration", "How to determine the end-of-stream.", > > OFFSET(duration_mode), AV_OPT_TYPE_INT, { .i64 = > > DURATION_LONGEST }, 0, 2, A|F, "duration" }, > > { "longest", "Duration of longest input.", 0, AV_OPT_TYPE_CONST, > > { .i64 = DURATION_LONGEST }, 0, 0, A|F, "duration" }, > > -- > > 2.21.0 > > > > ___ > > 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". -- Thanks, Limin Wang ___ 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".
Re: [FFmpeg-devel] [PATCH v1] avfilter/af_amix: change the max range of the number of inputs
On 1/6/20, Limin Wang wrote: > On Mon, Jan 06, 2020 at 01:28:45PM +0100, Paul B Mahol wrote: >> Limit is not real, its too big. > > So what's reasonable value to use? > I notice video mix choose INT_MAX, so I use the same. INT16_MAX seems high enough. > > [lmwang@vpn ffmpeg]$ grep nb_inputs libavfilter/vf_mix.c |grep INT_MAX > { "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, > {.i64=2}, 2, INT_MAX, .flags = FLAGS }, > >> >> On 1/6/20, lance.lmw...@gmail.com wrote: >> > From: Limin Wang >> > >> > Signed-off-by: Limin Wang >> > --- >> > libavfilter/af_amix.c | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> > >> > diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c >> > index 89a1b0568f..1e1753b078 100644 >> > --- a/libavfilter/af_amix.c >> > +++ b/libavfilter/af_amix.c >> > @@ -182,7 +182,7 @@ typedef struct MixContext { >> > #define F AV_OPT_FLAG_FILTERING_PARAM >> > static const AVOption amix_options[] = { >> > { "inputs", "Number of inputs.", >> > -OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, 1024, >> > A|F >> > }, >> > +OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, >> > INT_MAX, >> > A|F }, >> > { "duration", "How to determine the end-of-stream.", >> > OFFSET(duration_mode), AV_OPT_TYPE_INT, { .i64 = >> > DURATION_LONGEST }, 0, 2, A|F, "duration" }, >> > { "longest", "Duration of longest input.", 0, >> > AV_OPT_TYPE_CONST, >> > { .i64 = DURATION_LONGEST }, 0, 0, A|F, "duration" }, >> > -- >> > 2.21.0 >> > >> > ___ >> > 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". > > -- > Thanks, > Limin Wang > ___ > 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 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".
Re: [FFmpeg-devel] [PATCH v1] avfilter/af_amix: change the max range of the number of inputs
On Mon, Jan 06, 2020 at 02:27:36PM +0100, Paul B Mahol wrote: > On 1/6/20, Limin Wang wrote: > > On Mon, Jan 06, 2020 at 01:28:45PM +0100, Paul B Mahol wrote: > >> Limit is not real, its too big. > > > > So what's reasonable value to use? > > I notice video mix choose INT_MAX, so I use the same. > > INT16_MAX seems high enough. Sure, I'll update to use INT16_MAX. > > > > > [lmwang@vpn ffmpeg]$ grep nb_inputs libavfilter/vf_mix.c |grep INT_MAX > > { "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, > > {.i64=2}, 2, INT_MAX, .flags = FLAGS }, > > > >> > >> On 1/6/20, lance.lmw...@gmail.com wrote: > >> > From: Limin Wang > >> > > >> > Signed-off-by: Limin Wang > >> > --- > >> > libavfilter/af_amix.c | 2 +- > >> > 1 file changed, 1 insertion(+), 1 deletion(-) > >> > > >> > diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c > >> > index 89a1b0568f..1e1753b078 100644 > >> > --- a/libavfilter/af_amix.c > >> > +++ b/libavfilter/af_amix.c > >> > @@ -182,7 +182,7 @@ typedef struct MixContext { > >> > #define F AV_OPT_FLAG_FILTERING_PARAM > >> > static const AVOption amix_options[] = { > >> > { "inputs", "Number of inputs.", > >> > -OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, 1024, > >> > A|F > >> > }, > >> > +OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, > >> > INT_MAX, > >> > A|F }, > >> > { "duration", "How to determine the end-of-stream.", > >> > OFFSET(duration_mode), AV_OPT_TYPE_INT, { .i64 = > >> > DURATION_LONGEST }, 0, 2, A|F, "duration" }, > >> > { "longest", "Duration of longest input.", 0, > >> > AV_OPT_TYPE_CONST, > >> > { .i64 = DURATION_LONGEST }, 0, 0, A|F, "duration" }, > >> > -- > >> > 2.21.0 > >> > > >> > ___ > >> > 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". > > > > -- > > Thanks, > > Limin Wang > > ___ > > 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 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". -- Thanks, Limin Wang ___ 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] avfilter/af_amix: change the max range of the number of inputs
From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/af_amix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index 89a1b0568f..1e1753b078 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -182,7 +182,7 @@ typedef struct MixContext { #define F AV_OPT_FLAG_FILTERING_PARAM static const AVOption amix_options[] = { { "inputs", "Number of inputs.", -OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, 1024, A|F }, +OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT16_MAX, A|F }, { "duration", "How to determine the end-of-stream.", OFFSET(duration_mode), AV_OPT_TYPE_INT, { .i64 = DURATION_LONGEST }, 0, 2, A|F, "duration" }, { "longest", "Duration of longest input.", 0, AV_OPT_TYPE_CONST, { .i64 = DURATION_LONGEST }, 0, 0, A|F, "duration" }, -- 2.21.0 ___ 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] avfilter/vf_mix: change the max range of the number of inputs
From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/vf_mix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c index b5a282a..9e1ae79 100644 --- a/libavfilter/vf_mix.c +++ b/libavfilter/vf_mix.c @@ -305,7 +305,7 @@ static int activate(AVFilterContext *ctx) #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM static const AVOption mix_options[] = { -{ "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=2}, 2, INT_MAX, .flags = FLAGS }, +{ "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=2}, 2, INT16_MAX, .flags = FLAGS }, { "weights", "set weight for each input", OFFSET(weights_str), AV_OPT_TYPE_STRING, {.str="1 1"}, 0, 0, .flags = FLAGS }, { "scale", "set scale", OFFSET(scale), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, INT16_MAX, .flags = FLAGS }, { "duration", "how to determine end of stream", OFFSET(duration), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, .flags = FLAGS, "duration" }, -- 2.9.5 ___ 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] tests/fate/lavf-video.mak: better looking gif dependancies
The gif test should depend on gif not fits Signed-off-by: Michael Niedermayer --- tests/fate/lavf-video.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fate/lavf-video.mak b/tests/fate/lavf-video.mak index 7a70ac90ce..f6e98246c4 100644 --- a/tests/fate/lavf-video.mak +++ b/tests/fate/lavf-video.mak @@ -6,7 +6,7 @@ FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gbrp.fits FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gbrap.fits FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gbrp16be.fits FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gbrap16be.fits -FATE_LAVF_VIDEO-$(call ENCDEC, GIF,FITS) += gif +FATE_LAVF_VIDEO-$(call ENCDEC, GIF, GIF) += gif FATE_LAVF_VIDEO-$(CONFIG_YUV4MPEGPIPE_MUXER)+= y4m FATE_LAVF_VIDEO = $(FATE_LAVF_VIDEO-yes:%=fate-lavf-%) -- 2.24.0 ___ 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] remove tests/ref/lavf/fits
This appears to be forgotten in ac4b5d86222006fa71ffe5922e1a34f1422507d8 Signed-off-by: Michael Niedermayer --- tests/ref/lavf/fits | 18 -- 1 file changed, 18 deletions(-) delete mode 100644 tests/ref/lavf/fits diff --git a/tests/ref/lavf/fits b/tests/ref/lavf/fits deleted file mode 100644 index 489542b32b..00 --- a/tests/ref/lavf/fits +++ /dev/null @@ -1,18 +0,0 @@ -ed9fd697d0d782df6201f6a2db184552 *./tests/data/lavf/graylavf.fits -5328000 ./tests/data/lavf/graylavf.fits -./tests/data/lavf/graylavf.fits CRC=0xbacf446c -48e6caf6a59e32f9a8a39979c9183a7f *./tests/data/lavf/gray16belavf.fits -10368000 ./tests/data/lavf/gray16belavf.fits -./tests/data/lavf/gray16belavf.fits CRC=0xae2b58d4 -be2f7112fd193c9a909304c81e662769 *./tests/data/lavf/gbrplavf.fits -15408000 ./tests/data/lavf/gbrplavf.fits -./tests/data/lavf/gbrplavf.fits CRC=0x04ed3828 -c89a72185cfad363aa9cc42e84fed301 *./tests/data/lavf/gbraplavf.fits -20448000 ./tests/data/lavf/gbraplavf.fits -./tests/data/lavf/gbraplavf.fits CRC=0x032a6409 -d539b9e02f5ab8fb85717c8adb60b6cc *./tests/data/lavf/gbrp16belavf.fits -30672000 ./tests/data/lavf/gbrp16belavf.fits -./tests/data/lavf/gbrp16belavf.fits CRC=0x81897ff7 -3dc3622fb09a338b406d8a12a30f2545 *./tests/data/lavf/gbrap16belavf.fits -40752000 ./tests/data/lavf/gbrap16belavf.fits -./tests/data/lavf/gbrap16belavf.fits CRC=0x247dd7b9 -- 2.24.0 ___ 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".
Re: [FFmpeg-devel] [PATCH v5] avformat/mov: Memory optimization with QuickTime/MP4
Hi, is there something I can do to get this patch applied? Cheers, Jörg > -Ursprüngliche Nachricht- > Von: ffmpeg-devel Im Auftrag von Jörg > Beckmann > Gesendet: Montag, 9. Dezember 2019 16:05 > An: ffmpeg-devel@ffmpeg.org > Betreff: [FFmpeg-devel] [PATCH v5] avformat/mov: Memory optimization with > QuickTime/MP4 > > Invents a new option "discard_fragments" for the MP4/Quicktime/MOV decoder. > > If the option is not set, nothing changes at all. If it is set, old fragments > are > discarded as far as possible on each call to switch_root. For pure audio > streams, > the memory usage is now constant. For video streams, the memory usage is > reduced. It's tested with audio streams received from a professional DAB+ > receiver and with video streams created on my own with "ffmpeg -i .m4v > - > c:a:0 copy -c:v copy -c:s copy -f ismv -movflags \ frag_keyframe -movflags > faststart tcp://localhost:1234?listen" and "ffmpeg -i tcp://localhost:1234 > -c:a copy - > c:v copy -c:s copy -y ". > > Signed-off-by: Jörg Beckmann > --- > libavformat/isom.h | 1 + > libavformat/mov.c | 49 > - > 2 files changed, 49 insertions(+), 1 deletion(-) > > diff --git a/libavformat/isom.h b/libavformat/isom.h index > 4943b80ccf..9b4753f4d7 > 100644 > --- a/libavformat/isom.h > +++ b/libavformat/isom.h > @@ -268,6 +268,7 @@ typedef struct MOVContext { > int advanced_editlist; > int ignore_chapters; > int seek_individually; > +int discard_fragments; > int64_t next_root_atom; ///< offset of the next root atom > int export_all; > int export_xmp; > diff --git a/libavformat/mov.c b/libavformat/mov.c index > 7553a7fdfc..deb3ff5508 > 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -7698,8 +7698,11 @@ static int should_retry(AVIOContext *pb, int > error_code) > { > > static int mov_switch_root(AVFormatContext *s, int64_t target, int index) { > -int ret; > +int ret, i; > MOVContext *mov = s->priv_data; > +AVStream *st = NULL; > +MOVStreamContext *sc; > +MOVFragment *frag; > > if (index >= 0 && index < mov->frag_index.nb_items) > target = mov->frag_index.item[index].moof_offset; > @@ -7721,6 +7724,43 @@ static int mov_switch_root(AVFormatContext *s, int64_t > target, int index) > > mov->found_mdat = 0; > > +if (mov->discard_fragments) { > +frag = &mov->fragment; > + > +for (i = 0; i < mov->fc->nb_streams; i++) { > +if (mov->fc->streams[i]->id == frag->track_id) { > +st = mov->fc->streams[i]; > +break; > +} > +} > + > +av_assert0(st); > + > +sc = st->priv_data; > + > +switch (st->codecpar->codec_type) { > +case AVMEDIA_TYPE_AUDIO: > +case AVMEDIA_TYPE_SUBTITLE: > +/* Freeing VIDEO tables leads to corrupted video when > writing to eg. > MKV */ > +av_freep(&st->index_entries); > +st->nb_index_entries = 0; > +st->index_entries_allocated_size = 0; > + > +sc->current_index = 0; > +sc->current_sample = 0; > + > +av_freep(&sc->ctts_data); > +sc->ctts_allocated_size = 0; > +sc->ctts_count = 0; > +break; > +} > + > +av_free(mov->frag_index.item->stream_info); > +av_freep(&mov->frag_index.item); > +mov->frag_index.allocated_size = 0; > +mov->frag_index.nb_items = 0; > +} > + > ret = mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX > }); > if (ret < 0) > return ret; > @@ -7975,6 +8015,9 @@ static int mov_read_seek(AVFormatContext *s, int > stream_index, int64_t sample_ti > int sample; > int i; > > +if (mc->discard_fragments) // Seeking is not possible if fragments are > discarded. > +return AVERROR(ENOTSUP); > + > if (stream_index >= s->nb_streams) > return AVERROR_INVALIDDATA; > > @@ -8063,6 +8106,10 @@ static const AVOption mov_options[] = { > { "decryption_key", "The media decryption key (hex)", > OFFSET(decryption_key), AV_OPT_TYPE_BINARY, .flags = > AV_OPT_FLAG_DECODING_PARAM }, > { "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), > AV_OPT_TYPE_BOOL, > {.i64 = 0}, 0, 1, FLAGS }, > +{"discard_fragments", > +"Discard fragments after they have been read to support live > streams.", > +OFFSET(discard_fragments), AV_OPT_TYPE_BOOL, { .i64 = 0 }, > +0, 1, FLAGS }, > > { NULL }, > }; > > ___ > 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". ___ f
Re: [FFmpeg-devel] [SCISYS Possible Spam] Re: [PATCH v5] avformat/mov: Memory optimization with QuickTime/MP4
Am Mo., 16. Dez. 2019 um 12:13 Uhr schrieb Jörg Beckmann : > > > > -Ursprüngliche Nachricht- > > Von: ffmpeg-devel Im Auftrag von Carl > > Eugen Hoyos > > Gesendet: Montag, 16. Dezember 2019 11:50 > > An: FFmpeg development discussions and patches > > Betreff: [SCISYS Possible Spam] Re: [FFmpeg-devel] [PATCH v5] avformat/mov: > > Memory optimization with QuickTime/MP4 > > > > Am Mo., 9. Dez. 2019 um 16:05 Uhr schrieb Jörg Beckmann > > : > > > > > > Invents a new option "discard_fragments" for the MP4/Quicktime/MOV > > > decoder. > > > > > > If the option is not set, nothing changes at all. If it is set, old > > > fragments are discarded as far as possible on each call to switch_root. > > > > > For pure audio streams, the memory usage is now constant. > > > > Is it possible to detect this case? > > If possible, the new option could have an "auto" setting. > > I'm not sure whether it really works with all possible stream types. Why is it not possible to detect that the stream only contains audio? Carl Eugen ___ 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".
Re: [FFmpeg-devel] [SCISYS Possible Spam] Re: [SCISYS Possible Spam] Re: [PATCH v5] avformat/mov: Memory optimization with QuickTime/MP4
> -Ursprüngliche Nachricht- > Von: ffmpeg-devel Im Auftrag von Carl > Eugen Hoyos > Gesendet: Montag, 6. Januar 2020 15:24 > An: FFmpeg development discussions and patches > Betreff: [SCISYS Possible Spam] Re: [FFmpeg-devel] [SCISYS Possible Spam] > Re: [PATCH v5] avformat/mov: Memory optimization with QuickTime/MP4 > > Am Mo., 16. Dez. 2019 um 12:13 Uhr schrieb Jörg Beckmann > : > > > > > > > -Ursprüngliche Nachricht- > > > Von: ffmpeg-devel Im Auftrag von > > > Carl Eugen Hoyos > > > Gesendet: Montag, 16. Dezember 2019 11:50 > > > An: FFmpeg development discussions and patches > > > > > > Betreff: [SCISYS Possible Spam] Re: [FFmpeg-devel] [PATCH v5] > avformat/mov: > > > Memory optimization with QuickTime/MP4 > > > > > > Am Mo., 9. Dez. 2019 um 16:05 Uhr schrieb Jörg Beckmann > > > : > > > > > > > > Invents a new option "discard_fragments" for the MP4/Quicktime/MOV > decoder. > > > > > > > > If the option is not set, nothing changes at all. If it is set, > > > > old fragments are discarded as far as possible on each call to > > > > switch_root. > > > > > > > For pure audio streams, the memory usage is now constant. > > > > > > Is it possible to detect this case? > > > If possible, the new option could have an "auto" setting. > > > > I'm not sure whether it really works with all possible stream types. > > Why is it not possible to detect that the stream only contains audio? Oh sorry, I misunderstood your question. Of course it is possible to detect that it contains only audio. I thought you suggested to detect that is fragmented. I'll take a look into the sources to find an appropriate location for the check and send the modified patch again. But it will take a few days. Do you think, "auto" should be the default value? > > Carl Eugen Jörg ___ 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".
Re: [FFmpeg-devel] [SCISYS Possible Spam] Re: [SCISYS Possible Spam] Re: [PATCH v5] avformat/mov: Memory optimization with QuickTime/MP4
Am Mo., 6. Jan. 2020 um 15:37 Uhr schrieb Jörg Beckmann : > > > -Ursprüngliche Nachricht- > > Von: ffmpeg-devel Im Auftrag von Carl > > Eugen Hoyos > > Gesendet: Montag, 6. Januar 2020 15:24 > > An: FFmpeg development discussions and patches > > Betreff: [SCISYS Possible Spam] Re: [FFmpeg-devel] [SCISYS Possible Spam] > > Re: [PATCH v5] avformat/mov: Memory optimization with QuickTime/MP4 > > > > Am Mo., 16. Dez. 2019 um 12:13 Uhr schrieb Jörg Beckmann > > : > > > > > > > > > > -Ursprüngliche Nachricht- > > > > Von: ffmpeg-devel Im Auftrag von > > > > Carl Eugen Hoyos > > > > Gesendet: Montag, 16. Dezember 2019 11:50 > > > > An: FFmpeg development discussions and patches > > > > > > > > Betreff: [SCISYS Possible Spam] Re: [FFmpeg-devel] [PATCH v5] > > avformat/mov: > > > > Memory optimization with QuickTime/MP4 > > > > > > > > Am Mo., 9. Dez. 2019 um 16:05 Uhr schrieb Jörg Beckmann > > > > : > > > > > > > > > > Invents a new option "discard_fragments" for the MP4/Quicktime/MOV > > decoder. > > > > > > > > > > If the option is not set, nothing changes at all. If it is set, > > > > > old fragments are discarded as far as possible on each call to > > > > > switch_root. > > > > > > > > > For pure audio streams, the memory usage is now constant. > > > > > > > > Is it possible to detect this case? > > > > If possible, the new option could have an "auto" setting. > > > > > > I'm not sure whether it really works with all possible stream types. > > > > Why is it not possible to detect that the stream only contains audio? > > Oh sorry, I misunderstood your question. Of course it is possible to detect > that it contains only audio. I thought you suggested to detect that is > fragmented. > I'll take a look into the sources to find an appropriate location for the > check and > send the modified patch again. But it will take a few days. > > Do you think, "auto" should be the default value? If your patch means that receiving audio streams allocates less memory and the audio-only case can be detected, yes. Carl Eugen ___ 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".
Re: [FFmpeg-devel] [PATCH 2/2] tests/fate/lavf-video.mak: better looking gif dependancies
On 1/6/2020 10:55 AM, Michael Niedermayer wrote: > The gif test should depend on gif not fits > > Signed-off-by: Michael Niedermayer > --- > tests/fate/lavf-video.mak | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/fate/lavf-video.mak b/tests/fate/lavf-video.mak > index 7a70ac90ce..f6e98246c4 100644 > --- a/tests/fate/lavf-video.mak > +++ b/tests/fate/lavf-video.mak > @@ -6,7 +6,7 @@ FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) > += gbrp.fits > FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gbrap.fits > FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += > gbrp16be.fits > FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += > gbrap16be.fits > -FATE_LAVF_VIDEO-$(call ENCDEC, GIF,FITS) += gif > +FATE_LAVF_VIDEO-$(call ENCDEC, GIF, GIF) += gif Before ac4b5d86222006fa71ffe5922e1a34f1422507d8 it was IMAGE2, not GIF for the decoder part, so probably better to use that again. > FATE_LAVF_VIDEO-$(CONFIG_YUV4MPEGPIPE_MUXER)+= y4m > > FATE_LAVF_VIDEO = $(FATE_LAVF_VIDEO-yes:%=fate-lavf-%) > Make the commit message "fix fate-lavf-gif dependencies" instead of "better looking gif dependancies". And mention the above commit as the source of the regression. LGTM otherwise. ___ 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] avformat/aviobuf: Remove AVIOInternal and one level of indirection
In the Libav commit cae448cf, the opaque of every AVIOContext opened by ffio_fdopen() (which is used internally by avio_open() and avio_open2()) changed: It was a simple pointer to an URLContext before, but now it was a structure (namely AVIOInternal) containing a pointer to an URLContext as its only member. The next commits (namely 8c0ceafb and ec4c4839) added members to AVIOInternal to allow white-/blacklisting of protocols. But these two commits were never merged into FFmpeg (they were only merged as no-ops in 510046c2 and 063b26d3), because FFmpeg chose a different way to implement this (in 93629735); and so our AVIOInternal still has exactly one member. This of course means that it is unnecessary to use AVIOInternal as opaque as it is just adding a level of indirection (not only pointer dereference, but also wrapper functions). Therefore this commit removes AVIOInternal entirely and essentially reverts cae448cf. Signed-off-by: Andreas Rheinhardt --- libavformat/aviobuf.c | 86 --- 1 file changed, 15 insertions(+), 71 deletions(-) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 70e1d2ca10..0e2f038988 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -42,15 +42,10 @@ */ #define SHORT_SEEK_THRESHOLD 4096 -typedef struct AVIOInternal { -URLContext *h; -} AVIOInternal; - static void *ff_avio_child_next(void *obj, void *prev) { AVIOContext *s = obj; -AVIOInternal *internal = s->opaque; -return prev ? NULL : internal->h; +return prev ? NULL : s->opaque; } static const AVClass *ff_avio_child_class_next(const AVClass *prev) @@ -940,49 +935,8 @@ uint64_t ffio_read_varlen(AVIOContext *bc){ return val; } -static int io_read_packet(void *opaque, uint8_t *buf, int buf_size) -{ -AVIOInternal *internal = opaque; -return ffurl_read(internal->h, buf, buf_size); -} - -static int io_write_packet(void *opaque, uint8_t *buf, int buf_size) -{ -AVIOInternal *internal = opaque; -return ffurl_write(internal->h, buf, buf_size); -} - -static int64_t io_seek(void *opaque, int64_t offset, int whence) -{ -AVIOInternal *internal = opaque; -return ffurl_seek(internal->h, offset, whence); -} - -static int io_short_seek(void *opaque) -{ -AVIOInternal *internal = opaque; -return ffurl_get_short_seek(internal->h); -} - -static int io_read_pause(void *opaque, int pause) -{ -AVIOInternal *internal = opaque; -if (!internal->h->prot->url_read_pause) -return AVERROR(ENOSYS); -return internal->h->prot->url_read_pause(internal->h, pause); -} - -static int64_t io_read_seek(void *opaque, int stream_index, int64_t timestamp, int flags) -{ -AVIOInternal *internal = opaque; -if (!internal->h->prot->url_read_seek) -return AVERROR(ENOSYS); -return internal->h->prot->url_read_seek(internal->h, stream_index, timestamp, flags); -} - int ffio_fdopen(AVIOContext **s, URLContext *h) { -AVIOInternal *internal = NULL; uint8_t *buffer = NULL; int buffer_size, max_packet_size; @@ -996,14 +950,10 @@ int ffio_fdopen(AVIOContext **s, URLContext *h) if (!buffer) return AVERROR(ENOMEM); -internal = av_mallocz(sizeof(*internal)); -if (!internal) -goto fail; - -internal->h = h; - -*s = avio_alloc_context(buffer, buffer_size, h->flags & AVIO_FLAG_WRITE, -internal, io_read_packet, io_write_packet, io_seek); +*s = avio_alloc_context(buffer, buffer_size, h->flags & AVIO_FLAG_WRITE, h, +(int (*)(void *, uint8_t *, int)) ffurl_read, +(int (*)(void *, uint8_t *, int)) ffurl_write, +(int64_t (*)(void *, int64_t, int))ffurl_seek); if (!*s) goto fail; @@ -1023,30 +973,28 @@ int ffio_fdopen(AVIOContext **s, URLContext *h) (*s)->max_packet_size = max_packet_size; (*s)->min_packet_size = h->min_packet_size; if(h->prot) { -(*s)->read_pause = io_read_pause; -(*s)->read_seek = io_read_seek; +(*s)->read_pause = (int (*)(void *, int))h->prot->url_read_pause; +(*s)->read_seek = +(int64_t (*)(void *, int, int64_t, int))h->prot->url_read_seek; if (h->prot->url_read_seek) (*s)->seekable |= AVIO_SEEKABLE_TIME; } -(*s)->short_seek_get = io_short_seek; +(*s)->short_seek_get = (int (*)(void *))ffurl_get_short_seek; (*s)->av_class = &ff_avio_class; return 0; fail: -av_freep(&internal); av_freep(&buffer); return AVERROR(ENOMEM); } URLContext* ffio_geturlcontext(AVIOContext *s) { -AVIOInternal *internal; if (!s) return NULL; -internal = s->opaque; -if (internal && s->read_packet == io_read_packet) -return internal->h; +if (s->opaque && s->read_packet == (int (*)(void *, uint8_t *, int))ffurl_read) +return s->opaque; else return NU
[FFmpeg-devel] [PATCH v6] avutil: add AV_FRAME_DATA_USER_DATA_UNREGISTERED side data type
From: Limin Wang Signed-off-by: Limin Wang --- Fix for the v5 commit message change when copy(add avutil:) doc/APIchanges | 3 +++ libavutil/frame.c | 1 + libavutil/frame.h | 8 libavutil/version.h | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 3c24dc6..6e1673e 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2017-10-21 API changes, most recent first: +2020-01-xx - xx - lavu 56.39.100 - frame.h + Add AV_FRAME_DATA_USER_DATA_UNREGISTERED. + 2019-12-27 - xx - lavu 56.38.100 - eval.h Add av_expr_count_func(). diff --git a/libavutil/frame.c b/libavutil/frame.c index e403809..1d0faec6 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -842,6 +842,7 @@ const char *av_frame_side_data_name(enum AVFrameSideDataType type) #endif case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata SMPTE2094-40 (HDR10+)"; case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest"; +case AV_FRAME_DATA_USER_DATA_UNREGISTERED: return "User Data Unregistered"; } return NULL; } diff --git a/libavutil/frame.h b/libavutil/frame.h index b5afb58..9e8c3a9 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -179,6 +179,14 @@ enum AVFrameSideDataType { * array element is implied by AVFrameSideData.size / AVRegionOfInterest.self_size. */ AV_FRAME_DATA_REGIONS_OF_INTEREST, + +/** + * User data unregistered metadata associated with a video frame. + * This data payload is stored as uint8_t in AVFrameSideData.data. + * The number of bytes of data payload is AVFrameSideData.size. + * The data payload consists of 16 bytes UUID and real user data. + */ +AV_FRAME_DATA_USER_DATA_UNREGISTERED, }; enum AVActiveFormatDescription { diff --git a/libavutil/version.h b/libavutil/version.h index af8f614..2bc1b98 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 56 -#define LIBAVUTIL_VERSION_MINOR 38 +#define LIBAVUTIL_VERSION_MINOR 39 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ -- 2.9.5 ___ 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] avformat/aviobuf: Honor avio_open[2] documentation
The documentation of both avio_open() as well as avio_open2() states that on failure, the pointer to an AVIOContext given to this function (via a pointer to a pointer to an AVIOContext) will be set to NULL. Yet it didn't happen upon failure of ffurl_open_whitelist() or when allocating the internal buffer failed. This commit changes this. Signed-off-by: Andreas Rheinhardt --- libavformat/aviobuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 0e2f038988..cc22beff28 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -1145,6 +1145,8 @@ int ffio_open_whitelist(AVIOContext **s, const char *filename, int flags, URLContext *h; int err; +*s = NULL; + err = ffurl_open_whitelist(&h, filename, flags, int_cb, options, whitelist, blacklist, NULL); if (err < 0) return err; -- 2.20.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".
Re: [FFmpeg-devel] [PATCH v1] avfilter/af_amix: change the max range of the number of inputs
It think this should be big enough, even if user tries to produce audio with denormals it should be pretty high number. On 1/6/20, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Signed-off-by: Limin Wang > --- > libavfilter/af_amix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c > index 89a1b0568f..1e1753b078 100644 > --- a/libavfilter/af_amix.c > +++ b/libavfilter/af_amix.c > @@ -182,7 +182,7 @@ typedef struct MixContext { > #define F AV_OPT_FLAG_FILTERING_PARAM > static const AVOption amix_options[] = { > { "inputs", "Number of inputs.", > -OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, 1024, A|F > }, > +OFFSET(nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT16_MAX, > A|F }, > { "duration", "How to determine the end-of-stream.", > OFFSET(duration_mode), AV_OPT_TYPE_INT, { .i64 = > DURATION_LONGEST }, 0, 2, A|F, "duration" }, > { "longest", "Duration of longest input.", 0, AV_OPT_TYPE_CONST, > { .i64 = DURATION_LONGEST }, 0, 0, A|F, "duration" }, > -- > 2.21.0 > > ___ > 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 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".
Re: [FFmpeg-devel] [PATCH] avcodec/vmdaudio: Check block_align more
ok On 1/6/20, Michael Niedermayer wrote: > Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type > 'int' > Fixes: > 19788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMDAUDIO_fuzzer-5743379690553344 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/vmdaudio.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/vmdaudio.c b/libavcodec/vmdaudio.c > index c7826fa3ce..dfbd49fd84 100644 > --- a/libavcodec/vmdaudio.c > +++ b/libavcodec/vmdaudio.c > @@ -76,7 +76,9 @@ static av_cold int vmdaudio_decode_init(AVCodecContext > *avctx) > av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n"); > return AVERROR(EINVAL); > } > -if (avctx->block_align < 1 || avctx->block_align % avctx->channels) { > +if (avctx->block_align < 1 || avctx->block_align % avctx->channels || > +avctx->block_align > INT_MAX - avctx->channels > +) { > av_log(avctx, AV_LOG_ERROR, "invalid block align\n"); > return AVERROR(EINVAL); > } > -- > 2.24.0 > > ___ > 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 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".
Re: [FFmpeg-devel] [PATCH 2/2] tests/fate/lavf-video.mak: better looking gif dependancies
Am Mo., 6. Jan. 2020 um 15:50 Uhr schrieb James Almer : > > On 1/6/2020 10:55 AM, Michael Niedermayer wrote: > > The gif test should depend on gif not fits > > > > Signed-off-by: Michael Niedermayer > > --- > > tests/fate/lavf-video.mak | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tests/fate/lavf-video.mak b/tests/fate/lavf-video.mak > > index 7a70ac90ce..f6e98246c4 100644 > > --- a/tests/fate/lavf-video.mak > > +++ b/tests/fate/lavf-video.mak > > @@ -6,7 +6,7 @@ FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) > > += gbrp.fits > > FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += > > gbrap.fits > > FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += > > gbrp16be.fits > > FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += > > gbrap16be.fits > > -FATE_LAVF_VIDEO-$(call ENCDEC, GIF,FITS) += gif > > +FATE_LAVF_VIDEO-$(call ENCDEC, GIF, GIF) += gif > > Before ac4b5d86222006fa71ffe5922e1a34f1422507d8 it was IMAGE2, not GIF > for the decoder part, so probably better to use that again. The gif demuxer has to be used for this file. Carl Eugen ___ 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]Silence an ugly clang warning
Hi! Attached patch fixes several warnings when compiling with clang. Please comment, Carl Eugen From fa987cd315d432146e48f7d07832ff153eacb4bd Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 6 Jan 2020 16:16:18 +0100 Subject: [PATCH] Silence "string-plus-int" warning shown by clang. libswscale/utils.c:89:42: warning: adding 'unsigned long' to a string does not append to the string [-Wstring-plus-int] --- libavcodec/utils.c | 2 +- libavdevice/avdevice.c | 2 +- libavfilter/avfilter.c | 2 +- libavformat/utils.c| 2 +- libavutil/utils.c | 2 +- libpostproc/postprocess.c | 2 +- libswresample/swresample.c | 2 +- libswscale/utils.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c935e07538..fd5565a5e8 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1444,7 +1444,7 @@ const char *avcodec_configuration(void) const char *avcodec_license(void) { #define LICENSE_PREFIX "libavcodec license: " -return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1]; } int av_get_exact_bits_per_sample(enum AVCodecID codec_id) diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c index 72e1b67887..3d03d89f04 100644 --- a/libavdevice/avdevice.c +++ b/libavdevice/avdevice.c @@ -75,7 +75,7 @@ const char * avdevice_configuration(void) const char * avdevice_license(void) { #define LICENSE_PREFIX "libavdevice license: " -return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1]; } static void *device_next(void *prev, int output, diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index baafd029e9..394811916d 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -88,7 +88,7 @@ const char *avfilter_configuration(void) const char *avfilter_license(void) { #define LICENSE_PREFIX "libavfilter license: " -return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1]; } void ff_command_queue_pop(AVFilterContext *filter) diff --git a/libavformat/utils.c b/libavformat/utils.c index b472762dd1..2470a6ac0e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -77,7 +77,7 @@ const char *avformat_configuration(void) const char *avformat_license(void) { #define LICENSE_PREFIX "libavformat license: " -return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1]; } int ff_lock_avformat(void) diff --git a/libavutil/utils.c b/libavutil/utils.c index 230081ea47..c1cd452eee 100644 --- a/libavutil/utils.c +++ b/libavutil/utils.c @@ -70,7 +70,7 @@ const char *avutil_configuration(void) const char *avutil_license(void) { #define LICENSE_PREFIX "libavutil license: " -return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1]; } const char *av_get_media_type_string(enum AVMediaType media_type) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 1fef8747c0..e16ef259ce 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -108,7 +108,7 @@ const char *postproc_configuration(void) const char *postproc_license(void) { #define LICENSE_PREFIX "libpostproc license: " -return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1]; } #define GET_MODE_BUFFER_SIZE 500 diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 1ac5ef9a30..a7bb69dd4f 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -46,7 +46,7 @@ const char *swresample_configuration(void) const char *swresample_license(void) { #define LICENSE_PREFIX "libswresample license: " -return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1]; } int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map){ diff --git a/libswscale/utils.c b/libswscale/utils.c index c915cf0fca..b2c08a5983 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -86,7 +86,7 @@ const char *swscale_configuration(void) const char *swscale_license(void) { #define LICENSE_PREFIX "libswscale license: " -return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; +return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1]; } typedef struct FormatEntry { -- 2.23.0 ___ 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".
Re: [FFmpeg-devel] [PATCH 3/3] avdevice/decklink: deprecate the -list_formats option
Am 27.12.19 um 23:17 schrieb Marton Balint: > The user should use ffmpeg -sources decklink or ffmpeg -sinks decklink > instead. the subject / log message is wrong (mentions format but patch is about devices) but I guess it's too late now. Matthias > Signed-off-by: Marton Balint > --- > doc/indevs.texi | 6 +++--- > doc/outdevs.texi | 6 +++--- > libavdevice/decklink_dec.cpp | 1 + > libavdevice/decklink_enc.cpp | 1 + > libavdevice/version.h| 2 +- > 5 files changed, 9 insertions(+), 7 deletions(-) > > diff --git a/doc/indevs.texi b/doc/indevs.texi > index d5940b8822..b40cfd8227 100644 > --- a/doc/indevs.texi > +++ b/doc/indevs.texi > @@ -277,8 +277,8 @@ audio track. > > @item list_devices > If set to @option{true}, print a list of devices and exit. > -Defaults to @option{false}. Alternatively you can use the @code{-sources} > -option of ffmpeg to list the available input devices. > +Defaults to @option{false}. This option is deprecated, please use the > +@code{-sources} option of ffmpeg to list the available input devices. > > @item list_formats > If set to @option{true}, print a list of supported formats and exit. > @@ -407,7 +407,7 @@ Defaults to @option{false}. > @item > List input devices: > @example > -ffmpeg -f decklink -list_devices 1 -i dummy > +ffmpeg -sources decklink > @end example > > @item > diff --git a/doc/outdevs.texi b/doc/outdevs.texi > index c96d2d0e43..27f543fa1a 100644 > --- a/doc/outdevs.texi > +++ b/doc/outdevs.texi > @@ -140,8 +140,8 @@ device with @command{-list_formats 1}. Audio sample rate > is always 48 kHz. > > @item list_devices > If set to @option{true}, print a list of devices and exit. > -Defaults to @option{false}. Alternatively you can use the @code{-sinks} > -option of ffmpeg to list the available output devices. > +Defaults to @option{false}. This option is deprecated, please use the > +@code{-sinks} option of ffmpeg to list the available output devices. > > @item list_formats > If set to @option{true}, print a list of supported formats and exit. > @@ -168,7 +168,7 @@ Defaults to @samp{unset}. > @item > List output devices: > @example > -ffmpeg -i test.avi -f decklink -list_devices 1 dummy > +ffmpeg -sinks decklink > @end example > > @item > diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp > index 0360bd16fb..1fd5adf515 100644 > --- a/libavdevice/decklink_dec.cpp > +++ b/libavdevice/decklink_dec.cpp > @@ -1050,6 +1050,7 @@ av_cold int ff_decklink_read_header(AVFormatContext > *avctx) > > /* List available devices. */ > if (ctx->list_devices) { > +av_log(avctx, AV_LOG_WARNING, "The -list_devices option is > deprecated and will be removed. Please use ffmpeg -sources decklink > instead.\n"); > ff_decklink_list_devices_legacy(avctx, 1, 0); > return AVERROR_EXIT; > } > diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp > index 04b06aee3a..883fdeadfb 100644 > --- a/libavdevice/decklink_enc.cpp > +++ b/libavdevice/decklink_enc.cpp > @@ -568,6 +568,7 @@ av_cold int ff_decklink_write_header(AVFormatContext > *avctx) > > /* List available devices and exit. */ > if (ctx->list_devices) { > +av_log(avctx, AV_LOG_WARNING, "The -list_devices option is > deprecated and will be removed. Please use ffmpeg -sinks decklink > instead.\n"); > ff_decklink_list_devices_legacy(avctx, 0, 1); > return AVERROR_EXIT; > } > diff --git a/libavdevice/version.h b/libavdevice/version.h > index 68302908cf..ec0ba776be 100644 > --- a/libavdevice/version.h > +++ b/libavdevice/version.h > @@ -29,7 +29,7 @@ > > #define LIBAVDEVICE_VERSION_MAJOR 58 > #define LIBAVDEVICE_VERSION_MINOR 9 > -#define LIBAVDEVICE_VERSION_MICRO 101 > +#define LIBAVDEVICE_VERSION_MICRO 102 > > #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ > LIBAVDEVICE_VERSION_MINOR, \ ___ 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] lavf/libsrt: Fix typo
--- libavformat/libsrt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c index a727b1c3e4..16975b6d94 100644 --- a/libavformat/libsrt.c +++ b/libavformat/libsrt.c @@ -337,9 +337,9 @@ static int libsrt_set_options_pre(URLContext *h, int fd) (s->kmrefreshrate >= 0 && libsrt_setsockopt(h, fd, SRTO_KMREFRESHRATE, "SRTO_KMREFRESHRATE", &s->kmrefreshrate, sizeof(s->kmrefreshrate)) < 0) || (s->kmpreannounce >= 0 && libsrt_setsockopt(h, fd, SRTO_KMPREANNOUNCE, "SRTO_KMPREANNOUNCE", &s->kmpreannounce, sizeof(s->kmpreannounce)) < 0) || #endif -(s->mss >= 0 && libsrt_setsockopt(h, fd, SRTO_MSS, "SRTO_MMS", &s->mss, sizeof(s->mss)) < 0) || +(s->mss >= 0 && libsrt_setsockopt(h, fd, SRTO_MSS, "SRTO_MSS", &s->mss, sizeof(s->mss)) < 0) || (s->ffs >= 0 && libsrt_setsockopt(h, fd, SRTO_FC, "SRTO_FC", &s->ffs, sizeof(s->ffs)) < 0) || -(s->ipttl >= 0 && libsrt_setsockopt(h, fd, SRTO_IPTTL, "SRTO_UPTTL", &s->ipttl, sizeof(s->ipttl)) < 0) || +(s->ipttl >= 0 && libsrt_setsockopt(h, fd, SRTO_IPTTL, "SRTO_IPTTL", &s->ipttl, sizeof(s->ipttl)) < 0) || (s->iptos >= 0 && libsrt_setsockopt(h, fd, SRTO_IPTOS, "SRTO_IPTOS", &s->iptos, sizeof(s->iptos)) < 0) || (s->latency >= 0 && libsrt_setsockopt(h, fd, SRTO_LATENCY, "SRTO_LATENCY", &latency, sizeof(latency)) < 0) || (s->rcvlatency >= 0 && libsrt_setsockopt(h, fd, SRTO_RCVLATENCY, "SRTO_RCVLATENCY", &rcvlatency, sizeof(rcvlatency)) < 0) || -- 2.24.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".
Re: [FFmpeg-devel] [PATCH]Silence an ugly clang warning
LGTM On 1/6/20, Carl Eugen Hoyos wrote: > Hi! > > Attached patch fixes several warnings when compiling with clang. > > Please comment, Carl Eugen > ___ 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".
Re: [FFmpeg-devel] [PATCH]Silence an ugly clang warning
LGTM On 1/6/20, Carl Eugen Hoyos wrote: > Hi! > > Attached patch fixes several warnings when compiling with clang. > > Please comment, Carl Eugen > ___ 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".
Re: [FFmpeg-devel] [PATCH 3/3] avdevice/decklink: deprecate the -list_formats option
On Mon, 6 Jan 2020, Matthias Hunstock wrote: Am 27.12.19 um 23:17 schrieb Marton Balint: The user should use ffmpeg -sources decklink or ffmpeg -sinks decklink instead. the subject / log message is wrong (mentions format but patch is about devices) but I guess it's too late now. I noticed that too before pushing, so it should be OK in the git history. Thanks, Marton Matthias Signed-off-by: Marton Balint --- doc/indevs.texi | 6 +++--- doc/outdevs.texi | 6 +++--- libavdevice/decklink_dec.cpp | 1 + libavdevice/decklink_enc.cpp | 1 + libavdevice/version.h| 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/indevs.texi b/doc/indevs.texi index d5940b8822..b40cfd8227 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -277,8 +277,8 @@ audio track. @item list_devices If set to @option{true}, print a list of devices and exit. -Defaults to @option{false}. Alternatively you can use the @code{-sources} -option of ffmpeg to list the available input devices. +Defaults to @option{false}. This option is deprecated, please use the +@code{-sources} option of ffmpeg to list the available input devices. @item list_formats If set to @option{true}, print a list of supported formats and exit. @@ -407,7 +407,7 @@ Defaults to @option{false}. @item List input devices: @example -ffmpeg -f decklink -list_devices 1 -i dummy +ffmpeg -sources decklink @end example @item diff --git a/doc/outdevs.texi b/doc/outdevs.texi index c96d2d0e43..27f543fa1a 100644 --- a/doc/outdevs.texi +++ b/doc/outdevs.texi @@ -140,8 +140,8 @@ device with @command{-list_formats 1}. Audio sample rate is always 48 kHz. @item list_devices If set to @option{true}, print a list of devices and exit. -Defaults to @option{false}. Alternatively you can use the @code{-sinks} -option of ffmpeg to list the available output devices. +Defaults to @option{false}. This option is deprecated, please use the +@code{-sinks} option of ffmpeg to list the available output devices. @item list_formats If set to @option{true}, print a list of supported formats and exit. @@ -168,7 +168,7 @@ Defaults to @samp{unset}. @item List output devices: @example -ffmpeg -i test.avi -f decklink -list_devices 1 dummy +ffmpeg -sinks decklink @end example @item diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp index 0360bd16fb..1fd5adf515 100644 --- a/libavdevice/decklink_dec.cpp +++ b/libavdevice/decklink_dec.cpp @@ -1050,6 +1050,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) /* List available devices. */ if (ctx->list_devices) { +av_log(avctx, AV_LOG_WARNING, "The -list_devices option is deprecated and will be removed. Please use ffmpeg -sources decklink instead.\n"); ff_decklink_list_devices_legacy(avctx, 1, 0); return AVERROR_EXIT; } diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp index 04b06aee3a..883fdeadfb 100644 --- a/libavdevice/decklink_enc.cpp +++ b/libavdevice/decklink_enc.cpp @@ -568,6 +568,7 @@ av_cold int ff_decklink_write_header(AVFormatContext *avctx) /* List available devices and exit. */ if (ctx->list_devices) { +av_log(avctx, AV_LOG_WARNING, "The -list_devices option is deprecated and will be removed. Please use ffmpeg -sinks decklink instead.\n"); ff_decklink_list_devices_legacy(avctx, 0, 1); return AVERROR_EXIT; } diff --git a/libavdevice/version.h b/libavdevice/version.h index 68302908cf..ec0ba776be 100644 --- a/libavdevice/version.h +++ b/libavdevice/version.h @@ -29,7 +29,7 @@ #define LIBAVDEVICE_VERSION_MAJOR 58 #define LIBAVDEVICE_VERSION_MINOR 9 -#define LIBAVDEVICE_VERSION_MICRO 101 +#define LIBAVDEVICE_VERSION_MICRO 102 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ LIBAVDEVICE_VERSION_MINOR, \ ___ 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 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] setting vps/sps/pps id via hevc_metadata
Hi, The attached patch allows setting vps/sps/pps id Usage: /ffmpeg -i source -c:v libx265 -bsf:v hevc_metadata=sps_id=8:pps_id=12:vps_id=3 output Best, Eran Gonen 0001-Add-vps-sps-pps-id-set-to-hevc_metadata-bsf.patch Description: Binary data 0001-Add-vps-sps-pps-id-set-to-hevc_metadata-bsf.patch.base64 Description: Binary data ___ 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".
Re: [FFmpeg-devel] setting vps/sps/pps id via hevc_metadata
On Mon, Jan 6, 2020 at 7:54 PM Eran Gonen wrote: > Hi, > > The attached patch allows setting vps/sps/pps id > > Usage: > /ffmpeg -i source -c:v libx265 -bsf:v > hevc_metadata=sps_id=8:pps_id=12:vps_id=3 output > > There is a problem with this: Input files with parameter sets of the same kind with different ids can be broken by this (because they would all share the same id in the output and hence overwrite each other upon decoding). - Andreas ___ 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".
Re: [FFmpeg-devel] setting vps/sps/pps id via hevc_metadata
Thanks Andreas. I also thought about this point. I guess the same goes to the rest of parameters in hevc_metadata. They all affect all sets in the file. Maybe that's the intention of the user for such files. On Mon, Jan 6, 2020 at 9:05 PM Andreas Rheinhardt < andreas.rheinha...@gmail.com> wrote: > On Mon, Jan 6, 2020 at 7:54 PM Eran Gonen > wrote: > > > Hi, > > > > The attached patch allows setting vps/sps/pps id > > > > Usage: > > /ffmpeg -i source -c:v libx265 -bsf:v > > hevc_metadata=sps_id=8:pps_id=12:vps_id=3 output > > > > > There is a problem with this: Input files with parameter sets of the same > kind with different ids can be broken by this (because they would all share > the same id in the output and hence overwrite each other upon decoding). > > - Andreas > ___ > 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 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".
Re: [FFmpeg-devel] [PATCH] CDToons decoder
On Sun, Jan 05, 2020 at 07:37:06PM -0300, James Almer wrote: > > + * Copyright (C) 2011 The FFmpeg project > > 2011? This patch has been lying around for a while. :/ Will update to 2020. > Use av_fast_malloc() instead of constantly freeing and reallocating > these buffers. See libavutil/mem.h Sprites are typically only allocated once for a given sprite_id, so for most situations the only difference would be to delay deallocation until the end of the video. Do you think it's worth doing anyway? (Easy enough to do.) Otherwise: ACK, thank you for the fast review. - Alyssa ___ 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] avcodec/h265_metadata_bsf: Setting vps/sps/pps id
Hi, Resending because it didn't get the patch list. Just one file this time. The attached patch allows setting vps/sps/pps id. Usage: /ffmpeg -i source -c:v libx265 -bsf:v hevc_metadata=sps_id=8:pps_id=12:vps_id=3 output Best, Eran Gonen 0001-Add-vps-sps-pps-id-set-to-hevc_metadata-bsf.patch Description: Binary data ___ 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".
Re: [FFmpeg-devel] setting vps/sps/pps id via hevc_metadata
On 06/01/2020 19:24, Eran Gonen wrote:> On Mon, Jan 6, 2020 at 9:05 PM Andreas Rheinhardt < > andreas.rheinha...@gmail.com> wrote: > >> On Mon, Jan 6, 2020 at 7:54 PM Eran Gonen >> wrote: >> >>> Hi, >>> >>> The attached patch allows setting vps/sps/pps id >>> >>> Usage: >>> /ffmpeg -i source -c:v libx265 -bsf:v >>> hevc_metadata=sps_id=8:pps_id=12:vps_id=3 output >>> >>> >> There is a problem with this: Input files with parameter sets of the same >> kind with different ids can be broken by this (because they would all share >> the same id in the output and hence overwrite each other upon decoding). >> >> - Andreas >> > Thanks Andreas. I also thought about this point. > I guess the same goes to the rest of parameters in hevc_metadata. > They all affect all sets in the file. Maybe that's the intention of the > user for such files. I'm not sure that comparison is really right, because the existing elements which can be modified are the metadata which don't affect the decoding process. Changing the PS IDs will break most streams with multiple parameter sets (try PPS_A_qualcomm_7.bit from the conformance test suite). What is your actual use-case here? If it's fixing some particular set of broken streams then perhaps it could be a separate BSF like h264_redundant_pps. - Mark ___ 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".
Re: [FFmpeg-devel] [PATCH v2 2/2] avcodec/h265_metadata_bsf: add option to insert a string as SEI unregistered user data
On 28/12/2019 01:38, Limin Wang wrote: > On Fri, Dec 27, 2019 at 11:32:40PM +, Mark Thompson wrote: >> On 26/12/2019 01:01, lance.lmw...@gmail.com wrote: >>> From: Limin Wang >>> >>> Signed-off-by: Limin Wang >>> --- >>> update to add keyframe NAL checking as H.264 patch for global header >> >> This case is much easier in H.265, though - the extradata can include SEI >> which applies globally, so just put it there rather than splicing it into >> the stream. > > Mark, are you say put the user data into the extradata? For my case, the > string > in the user data will be updated for every key frame runtime. Yes - if you put it in the extradata then it isn't necessary to update any frames in the stream at all. That ends up being far simpler for global-header streams (MP4 / MKV), and in flat streams (Annex B, TS) the extradata will be spliced in at every seek point by the writer. - Mark ___ 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".
Re: [FFmpeg-devel] [PATCH]Silence an ugly clang warning
Am Mo., 6. Jan. 2020 um 19:42 Uhr schrieb Paul B Mahol : > > LGTM Patch applied. Thank you, Carl Eugen ___ 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".
Re: [FFmpeg-devel] [PATCH v6] avutil: add AV_FRAME_DATA_USER_DATA_UNREGISTERED side data type
On 06/01/2020 14:54, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Signed-off-by: Limin Wang > --- > Fix for the v5 commit message change when copy(add avutil:) > > doc/APIchanges | 3 +++ > libavutil/frame.c | 1 + > libavutil/frame.h | 8 > libavutil/version.h | 2 +- > 4 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index 3c24dc6..6e1673e 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -15,6 +15,9 @@ libavutil: 2017-10-21 > > API changes, most recent first: > > +2020-01-xx - xx - lavu 56.39.100 - frame.h > + Add AV_FRAME_DATA_USER_DATA_UNREGISTERED. > + > 2019-12-27 - xx - lavu 56.38.100 - eval.h >Add av_expr_count_func(). > > diff --git a/libavutil/frame.c b/libavutil/frame.c > index e403809..1d0faec6 100644 > --- a/libavutil/frame.c > +++ b/libavutil/frame.c > @@ -842,6 +842,7 @@ const char *av_frame_side_data_name(enum > AVFrameSideDataType type) > #endif > case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata > SMPTE2094-40 (HDR10+)"; > case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest"; > +case AV_FRAME_DATA_USER_DATA_UNREGISTERED: return "User Data > Unregistered"; > } > return NULL; > } > diff --git a/libavutil/frame.h b/libavutil/frame.h > index b5afb58..9e8c3a9 100644 > --- a/libavutil/frame.h > +++ b/libavutil/frame.h > @@ -179,6 +179,14 @@ enum AVFrameSideDataType { > * array element is implied by AVFrameSideData.size / > AVRegionOfInterest.self_size. > */ > AV_FRAME_DATA_REGIONS_OF_INTEREST, > + > +/** > + * User data unregistered metadata associated with a video frame. IMO it should be stated directly that this is the H.26[45] UDU SEI message, and shouldn't be used for any other purpose. Mention it here and reference the relevant sections of the standards. > + * This data payload is stored as uint8_t in AVFrameSideData.data. > + * The number of bytes of data payload is AVFrameSideData.size. > + * The data payload consists of 16 bytes UUID and real user data. The ambiguity around the word payload is kindof confusing here. I think either avoid using the word payload at all, or name the syntax elements explicitly (16 bytes of uuid_iso_iec_11578 followed by size-16 bytes of user_data_payload_byte). > + */ > +AV_FRAME_DATA_USER_DATA_UNREGISTERED, > }; > > enum AVActiveFormatDescription { > diff --git a/libavutil/version.h b/libavutil/version.h > index af8f614..2bc1b98 100644 > --- a/libavutil/version.h > +++ b/libavutil/version.h > @@ -79,7 +79,7 @@ > */ > > #define LIBAVUTIL_VERSION_MAJOR 56 > -#define LIBAVUTIL_VERSION_MINOR 38 > +#define LIBAVUTIL_VERSION_MINOR 39 > #define LIBAVUTIL_VERSION_MICRO 100 > > #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ > Thanks, - Mark ___ 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".
Re: [FFmpeg-devel] [PATCH v5 4/4] avcodec/h264: create user data unregistered side data H.264
On 02/01/2020 01:28, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Signed-off-by: Limin Wang > --- > libavcodec/h264_sei.c | 20 +++-- > libavcodec/h264_sei.h | 2 + > libavcodec/h264_slice.c | 14 > tests/ref/fate/mov-zombie | 195 > ++ > 4 files changed, 161 insertions(+), 70 deletions(-) > > diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c > index a565fea..43e2814 100644 > --- a/libavcodec/h264_sei.c > +++ b/libavcodec/h264_sei.c > @@ -52,6 +52,10 @@ void ff_h264_sei_uninit(H264SEIContext *h) > h->afd.present = 0; > > av_buffer_unref(&h->a53_caption.buf_ref); > +for (int i = 0; i < h->unregistered.nb_buf_ref; i++) > +av_buffer_unref(&h->unregistered.buf_ref[i]); > +h->unregistered.nb_buf_ref = 0; > +av_freep(&h->unregistered.buf_ref); > } > > static int decode_picture_timing(H264SEIPictureTiming *h, GetBitContext *gb, > @@ -246,25 +250,31 @@ static int > decode_unregistered_user_data(H264SEIUnregistered *h, GetBitContext * > { > uint8_t *user_data; > int e, build, i; > +AVBufferRef *buf_ref, **tmp; > > -if (size < 16 || size >= INT_MAX - 1) > +if (size < 16) > return AVERROR_INVALIDDATA; > > -user_data = av_malloc(size + 1); > -if (!user_data) > +tmp = av_realloc_array(h->buf_ref, h->nb_buf_ref + 1, > sizeof(*h->buf_ref)); > +if (!tmp) > return AVERROR(ENOMEM); > +h->buf_ref = tmp; > + > +buf_ref = av_buffer_alloc(size); > +if (!buf_ref) > +return AVERROR(ENOMEM);> +user_data = buf_ref->data; > > for (i = 0; i < size; i++) > user_data[i] = get_bits(gb, 8); > +h->buf_ref[h->nb_buf_ref++] = buf_ref; > > -user_data[i] = 0; You've lost this terminator, which allows > e = sscanf(user_data + 16, "x264 - core %d", &build); to read over the end of the allocated buffer. > if (e == 1 && build > 0) > h->x264_build = build; > if (e == 1 && build == 1 && !strncmp(user_data+16, "x264 - core ", > 16)) > h->x264_build = 67; > > -av_free(user_data); > return 0; > } > > diff --git a/libavcodec/h264_sei.h b/libavcodec/h264_sei.h > index a75c3aa..aa4595f 100644 > --- a/libavcodec/h264_sei.h > +++ b/libavcodec/h264_sei.h > @@ -121,6 +121,8 @@ typedef struct H264SEIA53Caption { > > typedef struct H264SEIUnregistered { > int x264_build; > +AVBufferRef **buf_ref; > +int nb_buf_ref; > } H264SEIUnregistered; > > typedef struct H264SEIRecoveryPoint { > diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c > index e24d41c..ea967c8 100644 > --- a/libavcodec/h264_slice.c > +++ b/libavcodec/h264_slice.c > @@ -1285,6 +1285,20 @@ static int h264_export_frame_props(H264Context *h) > h->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; > } > > +for (int i = 0; i < h->sei.unregistered.nb_buf_ref; i++) { > +H264SEIUnregistered *unreg = &h->sei.unregistered; > + > +if (unreg->buf_ref[i]) { > +AVFrameSideData *sd = av_frame_new_side_data_from_buf(cur->f, > +AV_FRAME_DATA_USER_DATA_UNREGISTERED, > +unreg->buf_ref[i]); > +if (!sd) > +av_buffer_unref(&unreg->buf_ref[i]); > +unreg->buf_ref[i] = NULL; > +} > +} > +h->sei.unregistered.nb_buf_ref = 0; > + > if (h->sei.picture_timing.timecode_cnt > 0) { > uint32_t tc = 0; > uint32_t *tc_sd; Everything else looks good to me. - Mark ___ 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".
Re: [FFmpeg-devel] [PATCH v5 3/4] avfilter/vf_showinfo: display user data unregistered message
On 02/01/2020 01:28, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Signed-off-by: Limin Wang > --- > libavfilter/vf_showinfo.c | 33 + > 1 file changed, 33 insertions(+) > > diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c > index 31f6b32..bb3b37e 100644 > --- a/libavfilter/vf_showinfo.c > +++ b/libavfilter/vf_showinfo.c > @@ -169,6 +169,36 @@ static void dump_content_light_metadata(AVFilterContext > *ctx, AVFrameSideData *s > metadata->MaxCLL, metadata->MaxFALL); > } > > +static int string_is_ascii(const uint8_t *str) > +{ > +while (*str && *str < 128) str++; > +return !*str; Perhaps isprint() would be better? You don't really want to allow any control characters like newline either. > +} > + > +static void dump_user_data_unregistered_metadata(AVFilterContext *ctx, > AVFrameSideData *sd) > +{ > +const int uuid_size = 16; > +uint8_t *user_data = sd->data; > + > +if (sd->size < uuid_size) { > +av_log(ctx, AV_LOG_ERROR, "invalid data(%d < UUID(%d-bytes))", > sd->size, uuid_size); > +return; > +} > + > +av_log(ctx, AV_LOG_INFO, "User Data Unregistered:\n"); > +av_log(ctx, AV_LOG_INFO, "UUID="); > +for (int i = 0; i < uuid_size; i++) > +av_log(ctx, AV_LOG_INFO, "%x", user_data[i]); "%02x" Putting the hyphens in the standard places would make this more readable, too. > +av_log(ctx, AV_LOG_INFO, "\n"); > + > +user_data += uuid_size; > +/* Only print the user data details if it's string */ > +if (string_is_ascii(user_data)) { > +av_log(ctx, AV_LOG_INFO, "User Data="); > +av_log(ctx, AV_LOG_INFO, "%s", user_data); > +} > +} > + > static void dump_color_property(AVFilterContext *ctx, AVFrame *frame) > { > const char *color_range_str = > av_color_range_name(frame->color_range); > @@ -319,6 +349,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > *frame) > av_log(ctx, AV_LOG_INFO, "GOP timecode - %s", tcbuf); > break; > } > +case AV_FRAME_DATA_USER_DATA_UNREGISTERED: > +dump_user_data_unregistered_metadata(ctx, sd); > +break; > default: > av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d > bytes)", > sd->type, sd->size); > - Mark ___ 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".
Re: [FFmpeg-devel] [PATCH] avcodec/h265_metadata_bsf: Setting vps/sps/pps id
Hello Eran, On Mon, 06. Jan 23:14, Eran Gonen wrote: > Hi, > > Resending because it didn't get the patch list. Just one file this time. I've added your patch to the list: https://patchwork.ffmpeg.org/project/ffmpeg/patch/CAOOJq0rd1qfXB7h_YHKtQR=hckw92ggb3c2fa4yviaxjttw...@mail.gmail.com/ For some reason it was getting skipped because the Content-Type of the attachment was set to application/octet-stream. Also you'll see that your patch failed to apply because patchwork doesn't properly work with attachments at the moment. In the future you are welcome to send patches via Git send-email with --compose or --annotate flags if you want to add a message. Thanks, -- Andriy ___ 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".
Re: [FFmpeg-devel] [PATCH v2 1/2] configure: Change the configure check for tonemap_vaapi
On 30/12/2019 07:32, Xinpeng Sun wrote: > "VAProcFilterParameterBufferHDRToneMapping" was defined in libva 2.4.1, which > will lead to > build failure for the filter tonemap_vaapi for libva 2.3.0 with current > check. This patch > is to fix this build error. > > Signed-off-by: Xinpeng Sun > --- > configure | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/configure b/configure > index 43dc409fe6..01b4acd77e 100755 > --- a/configure > +++ b/configure > @@ -3579,7 +3579,7 @@ tinterlace_filter_deps="gpl" > tinterlace_merge_test_deps="tinterlace_filter" > tinterlace_pad_test_deps="tinterlace_filter" > tonemap_filter_deps="const_nan" > -tonemap_vaapi_filter_deps="vaapi > VAProcPipelineParameterBuffer_output_hdr_metadata" > +tonemap_vaapi_filter_deps="vaapi VAProcFilterParameterBufferHDRToneMapping" > tonemap_opencl_filter_deps="opencl const_nan" > transpose_opencl_filter_deps="opencl" > transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags" > @@ -6584,7 +6584,7 @@ if enabled vaapi; then > > check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC" > check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth > -check_struct "va/va.h va/va_vpp.h" "VAProcPipelineParameterBuffer" > output_hdr_metadata > +check_type "va/va.h va/va_vpp.h" > "VAProcFilterParameterBufferHDRToneMapping" > check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags > check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC" > check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG" > Thanks, applied. Relatedly: can you explain how to get this filter to work? So far the only non-identity transformation I have managed to achieve is to make the output entirely black (which happens if the set the output colour matrix to anything other than the same as the input). E.g. given an input which is: Stream #0:0[0x101]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 25 tbc [Parsed_showinfo_0 @ 0x5609cc1a6d00] side data - mastering display: has_primaries:1 has_luminance:1 r(0.6800,0.3200) g(0.2650,0.6900) b(0.1500 0.0600) wp(0.3127, 0.3290) min_luminance=0.05, max_luminance=1200.00 then doing: -vf tonemap_vaapi=format=nv12 gives identical output to: -vf scale_vaapi=format=nv12 while: -vf tonemap_vaapi=format=nv12:t=bt709:p=bt709:m=bt709 gives output which is entirely black. (Hardware is Icelake 1065G7.) - Mark ___ 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".
Re: [FFmpeg-devel] [PATCH v2 2/2] avcodec/h265_metadata_bsf: add option to insert a string as SEI unregistered user data
On Mon, Jan 06, 2020 at 09:51:34PM +, Mark Thompson wrote: > On 28/12/2019 01:38, Limin Wang wrote: > > On Fri, Dec 27, 2019 at 11:32:40PM +, Mark Thompson wrote: > >> On 26/12/2019 01:01, lance.lmw...@gmail.com wrote: > >>> From: Limin Wang > >>> > >>> Signed-off-by: Limin Wang > >>> --- > >>> update to add keyframe NAL checking as H.264 patch for global header > >> > >> This case is much easier in H.265, though - the extradata can include SEI > >> which applies globally, so just put it there rather than splicing it into > >> the stream. > > > > Mark, are you say put the user data into the extradata? For my case, the > > string > > in the user data will be updated for every key frame runtime. > > Yes - if you put it in the extradata then it isn't necessary to update any > frames in the stream at all. That ends up being far simpler for > global-header streams (MP4 / MKV), and in flat streams (Annex B, TS) the > extradata will be spliced in at every seek point by the writer. Sorry, my description isn't clear before, for my case, The user data may have time related string, so it'll updated for every insertion. Also, it'll be used for real time streaming, RTMP protocol etc. You had to use API to get the function, FFmpeg cli can't test it. > > - Mark > ___ > 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". -- Thanks, Limin Wang ___ 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".
Re: [FFmpeg-devel] [PATCH v5 3/4] avfilter/vf_showinfo: display user data unregistered message
On Mon, Jan 06, 2020 at 10:38:22PM +, Mark Thompson wrote: > On 02/01/2020 01:28, lance.lmw...@gmail.com wrote: > > From: Limin Wang > > > > Signed-off-by: Limin Wang > > --- > > libavfilter/vf_showinfo.c | 33 + > > 1 file changed, 33 insertions(+) > > > > diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c > > index 31f6b32..bb3b37e 100644 > > --- a/libavfilter/vf_showinfo.c > > +++ b/libavfilter/vf_showinfo.c > > @@ -169,6 +169,36 @@ static void > > dump_content_light_metadata(AVFilterContext *ctx, AVFrameSideData *s > > metadata->MaxCLL, metadata->MaxFALL); > > } > > > > +static int string_is_ascii(const uint8_t *str) > > +{ > > +while (*str && *str < 128) str++; > > +return !*str; > > Perhaps isprint() would be better? You don't really want to allow any > control characters like newline either. Sure, it's OK to use isprint, I'll update to use it. > > > +} > > + > > +static void dump_user_data_unregistered_metadata(AVFilterContext *ctx, > > AVFrameSideData *sd) > > +{ > > +const int uuid_size = 16; > > +uint8_t *user_data = sd->data; > > + > > +if (sd->size < uuid_size) { > > +av_log(ctx, AV_LOG_ERROR, "invalid data(%d < UUID(%d-bytes))", > > sd->size, uuid_size); > > +return; > > +} > > + > > +av_log(ctx, AV_LOG_INFO, "User Data Unregistered:\n"); > > +av_log(ctx, AV_LOG_INFO, "UUID="); > > +for (int i = 0; i < uuid_size; i++) > > +av_log(ctx, AV_LOG_INFO, "%x", user_data[i]); > > "%02x" OK > Putting the hyphens in the standard places would make this more readable, too. I'll try to add the hyphens in the standard places. > > > +av_log(ctx, AV_LOG_INFO, "\n"); > > + > > +user_data += uuid_size; > > +/* Only print the user data details if it's string */ > > +if (string_is_ascii(user_data)) { > > +av_log(ctx, AV_LOG_INFO, "User Data="); > > +av_log(ctx, AV_LOG_INFO, "%s", user_data); > > +} > > +} > > + > > static void dump_color_property(AVFilterContext *ctx, AVFrame *frame) > > { > > const char *color_range_str = > > av_color_range_name(frame->color_range); > > @@ -319,6 +349,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > > *frame) > > av_log(ctx, AV_LOG_INFO, "GOP timecode - %s", tcbuf); > > break; > > } > > +case AV_FRAME_DATA_USER_DATA_UNREGISTERED: > > +dump_user_data_unregistered_metadata(ctx, sd); > > +break; > > default: > > av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d > > bytes)", > > sd->type, sd->size); > > > > - Mark > ___ > 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". -- Thanks, Limin Wang ___ 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".
Re: [FFmpeg-devel] [PATCH v5 4/4] avcodec/h264: create user data unregistered side data H.264
On Mon, Jan 06, 2020 at 10:18:13PM +, Mark Thompson wrote: > On 02/01/2020 01:28, lance.lmw...@gmail.com wrote: > > From: Limin Wang > > > > Signed-off-by: Limin Wang > > --- > > libavcodec/h264_sei.c | 20 +++-- > > libavcodec/h264_sei.h | 2 + > > libavcodec/h264_slice.c | 14 > > tests/ref/fate/mov-zombie | 195 > > ++ > > 4 files changed, 161 insertions(+), 70 deletions(-) > > > > diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c > > index a565fea..43e2814 100644 > > --- a/libavcodec/h264_sei.c > > +++ b/libavcodec/h264_sei.c > > @@ -52,6 +52,10 @@ void ff_h264_sei_uninit(H264SEIContext *h) > > h->afd.present = 0; > > > > av_buffer_unref(&h->a53_caption.buf_ref); > > +for (int i = 0; i < h->unregistered.nb_buf_ref; i++) > > +av_buffer_unref(&h->unregistered.buf_ref[i]); > > +h->unregistered.nb_buf_ref = 0; > > +av_freep(&h->unregistered.buf_ref); > > } > > > > static int decode_picture_timing(H264SEIPictureTiming *h, GetBitContext > > *gb, > > @@ -246,25 +250,31 @@ static int > > decode_unregistered_user_data(H264SEIUnregistered *h, GetBitContext * > > { > > uint8_t *user_data; > > int e, build, i; > > +AVBufferRef *buf_ref, **tmp; > > > > -if (size < 16 || size >= INT_MAX - 1) > > +if (size < 16) > > return AVERROR_INVALIDDATA; > > > > -user_data = av_malloc(size + 1); > > -if (!user_data) > > +tmp = av_realloc_array(h->buf_ref, h->nb_buf_ref + 1, > > sizeof(*h->buf_ref)); > > +if (!tmp) > > return AVERROR(ENOMEM); > > +h->buf_ref = tmp; > > + > > +buf_ref = av_buffer_alloc(size); > > +if (!buf_ref) > > +return AVERROR(ENOMEM);> +user_data = buf_ref->data; > > > > for (i = 0; i < size; i++) > > user_data[i] = get_bits(gb, 8); > > +h->buf_ref[h->nb_buf_ref++] = buf_ref; > > > > -user_data[i] = 0; > > You've lost this terminator, which allows I need keep the user data same with original data so remove the extra terminator data, I prefer to add a isprint() checking before x264 string processing. > > > e = sscanf(user_data + 16, "x264 - core %d", &build); > > to read over the end of the allocated buffer. > > > if (e == 1 && build > 0) > > h->x264_build = build; > > if (e == 1 && build == 1 && !strncmp(user_data+16, "x264 - core ", > > 16)) > > h->x264_build = 67; > > > > -av_free(user_data); > > return 0; > > } > > > > diff --git a/libavcodec/h264_sei.h b/libavcodec/h264_sei.h > > index a75c3aa..aa4595f 100644 > > --- a/libavcodec/h264_sei.h > > +++ b/libavcodec/h264_sei.h > > @@ -121,6 +121,8 @@ typedef struct H264SEIA53Caption { > > > > typedef struct H264SEIUnregistered { > > int x264_build; > > +AVBufferRef **buf_ref; > > +int nb_buf_ref; > > } H264SEIUnregistered; > > > > typedef struct H264SEIRecoveryPoint { > > diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c > > index e24d41c..ea967c8 100644 > > --- a/libavcodec/h264_slice.c > > +++ b/libavcodec/h264_slice.c > > @@ -1285,6 +1285,20 @@ static int h264_export_frame_props(H264Context *h) > > h->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; > > } > > > > +for (int i = 0; i < h->sei.unregistered.nb_buf_ref; i++) { > > +H264SEIUnregistered *unreg = &h->sei.unregistered; > > + > > +if (unreg->buf_ref[i]) { > > +AVFrameSideData *sd = av_frame_new_side_data_from_buf(cur->f, > > +AV_FRAME_DATA_USER_DATA_UNREGISTERED, > > +unreg->buf_ref[i]); > > +if (!sd) > > +av_buffer_unref(&unreg->buf_ref[i]); > > +unreg->buf_ref[i] = NULL; > > +} > > +} > > +h->sei.unregistered.nb_buf_ref = 0; > > + > > if (h->sei.picture_timing.timecode_cnt > 0) { > > uint32_t tc = 0; > > uint32_t *tc_sd; > > Everything else looks good to me. > > - Mark > ___ > 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". -- Thanks, Limin Wang ___ 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".
Re: [FFmpeg-devel] [PATCH v6] avutil: add AV_FRAME_DATA_USER_DATA_UNREGISTERED side data type
On Mon, Jan 06, 2020 at 10:03:42PM +, Mark Thompson wrote: > On 06/01/2020 14:54, lance.lmw...@gmail.com wrote: > > From: Limin Wang > > > > Signed-off-by: Limin Wang > > --- > > Fix for the v5 commit message change when copy(add avutil:) > > > > doc/APIchanges | 3 +++ > > libavutil/frame.c | 1 + > > libavutil/frame.h | 8 > > libavutil/version.h | 2 +- > > 4 files changed, 13 insertions(+), 1 deletion(-) > > > > diff --git a/doc/APIchanges b/doc/APIchanges > > index 3c24dc6..6e1673e 100644 > > --- a/doc/APIchanges > > +++ b/doc/APIchanges > > @@ -15,6 +15,9 @@ libavutil: 2017-10-21 > > > > API changes, most recent first: > > > > +2020-01-xx - xx - lavu 56.39.100 - frame.h > > + Add AV_FRAME_DATA_USER_DATA_UNREGISTERED. > > + > > 2019-12-27 - xx - lavu 56.38.100 - eval.h > >Add av_expr_count_func(). > > > > diff --git a/libavutil/frame.c b/libavutil/frame.c > > index e403809..1d0faec6 100644 > > --- a/libavutil/frame.c > > +++ b/libavutil/frame.c > > @@ -842,6 +842,7 @@ const char *av_frame_side_data_name(enum > > AVFrameSideDataType type) > > #endif > > case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata > > SMPTE2094-40 (HDR10+)"; > > case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest"; > > +case AV_FRAME_DATA_USER_DATA_UNREGISTERED: return "User Data > > Unregistered"; > > } > > return NULL; > > } > > diff --git a/libavutil/frame.h b/libavutil/frame.h > > index b5afb58..9e8c3a9 100644 > > --- a/libavutil/frame.h > > +++ b/libavutil/frame.h > > @@ -179,6 +179,14 @@ enum AVFrameSideDataType { > > * array element is implied by AVFrameSideData.size / > > AVRegionOfInterest.self_size. > > */ > > AV_FRAME_DATA_REGIONS_OF_INTEREST, > > + > > +/** > > + * User data unregistered metadata associated with a video frame. > > IMO it should be stated directly that this is the H.26[45] UDU SEI message, > and shouldn't be used for any other purpose. Mention it here and reference > the relevant sections of the standards. OK > > > + * This data payload is stored as uint8_t in AVFrameSideData.data. > > + * The number of bytes of data payload is AVFrameSideData.size. > > + * The data payload consists of 16 bytes UUID and real user data. > > The ambiguity around the word payload is kindof confusing here. I think > either avoid using the word payload at all, or name the syntax elements > explicitly (16 bytes of uuid_iso_iec_11578 followed by size-16 bytes of > user_data_payload_byte). OK, will update by your suggestion. > > > + */ > > +AV_FRAME_DATA_USER_DATA_UNREGISTERED, > > }; > > > > enum AVActiveFormatDescription { > > diff --git a/libavutil/version.h b/libavutil/version.h > > index af8f614..2bc1b98 100644 > > --- a/libavutil/version.h > > +++ b/libavutil/version.h > > @@ -79,7 +79,7 @@ > > */ > > > > #define LIBAVUTIL_VERSION_MAJOR 56 > > -#define LIBAVUTIL_VERSION_MINOR 38 > > +#define LIBAVUTIL_VERSION_MINOR 39 > > #define LIBAVUTIL_VERSION_MICRO 100 > > > > #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ > > > > Thanks, > > - Mark > ___ > 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". -- Thanks, Limin Wang ___ 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".
Re: [FFmpeg-devel] [PATCH V5 2/2] libswscale/x86/yuv2rgb: add ssse3 version
On Mon, Jan 06, 2020 at 03:28:47PM +0800, Ting Fu wrote: > Tested using this command: > /ffmpeg -pix_fmt yuv420p -s 1920*1080 -i ArashRawYuv420.yuv \ > -vcodec rawvideo -s 1920*1080 -pix_fmt rgb24 -f null /dev/null > > The fps increase from 389 to 640 on my local machine. Please include information about the machine, mainly CPU in the commit message thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you think the mosad wants you dead since a long time then you are either wrong or dead since a long time. signature.asc Description: PGP signature ___ 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".
Re: [FFmpeg-devel] [PATCH] avcodec/vmdaudio: Check block_align more
On Mon, Jan 06, 2020 at 04:15:47PM +0100, Paul B Mahol wrote: > ok will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No human being will ever know the Truth, for even if they happen to say it by chance, they would not even known they had done so. -- Xenophanes signature.asc Description: PGP signature ___ 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".
Re: [FFmpeg-devel] [PATCH v3] avfilter/vf_showinfo: Fix erroneous results for mean and stdev with pixel bits >8
On Fri, Nov 29, 2019 at 07:28:23PM +0800, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Have tested with be and le pixel format on be and le system for >8bit. > System: > lmwang@ubuntu:~/ffmpeg.git.mips$ grep HAVE_BIGENDIAN config.h > #define HAVE_BIGENDIAN 1 > ffmpeg.git git:(showinfo) ✗ grep HAVE_BIGENDIAN config.h > #define HAVE_BIGENDIAN 0 > > Test result: > 1, yuv420p > ./ffmpeg -f lavfi -i > color=black:duration=1:r=1:size=1280x720,format=yuv420p,showinfo > Master: > mean:[16 128 128] stdev:[0.0 0.0 0.0] > After applied the patch: > mean:[16 128 128] stdev:[0.0 0.0 0.0] > > 2, yuv420p10le > ./ffmpeg -f lavfi -i > color=black:duration=1:r=1:size=1280x720,format=yuv420p10le,showinfo > Master: > mean:[32 1 1] stdev:[32.0 1.0 1.0] > After applied the patch: > mean:[64 512 512] stdev:[0.0 0.0 0.0] > > 3, yuv420p10be > ./ffmpeg -f lavfi -i > color=black:duration=1:r=1:size=1280x720,format=yuv420p10be,showinfo > Master: > mean:[32 1 1] stdev:[32.0 1.0 1.0] > After applied the patch: > mean:[64 512 512] stdev:[0.0 0.0 0.0] > > > Signed-off-by: Limin Wang > --- > libavfilter/vf_showinfo.c | 34 +++--- > 1 file changed, 31 insertions(+), 3 deletions(-) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have often repented speaking, but never of holding my tongue. -- Xenocrates signature.asc Description: PGP signature ___ 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".
Re: [FFmpeg-devel] [PATCH 2/2] avformat/aviobuf: Honor avio_open[2] documentation
On Mon, Jan 06, 2020 at 03:51:49PM +0100, Andreas Rheinhardt wrote: > The documentation of both avio_open() as well as avio_open2() states > that on failure, the pointer to an AVIOContext given to this function > (via a pointer to a pointer to an AVIOContext) will be set to NULL. Yet > it didn't happen upon failure of ffurl_open_whitelist() or when allocating > the internal buffer failed. This commit changes this. > > Signed-off-by: Andreas Rheinhardt > --- > libavformat/aviobuf.c | 2 ++ > 1 file changed, 2 insertions(+) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch signature.asc Description: PGP signature ___ 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".
Re: [FFmpeg-devel] [PATCH v1] avcodec/decode: replace avctx->internal with avci for better readability
On Mon, Jan 06, 2020 at 06:31:03PM +0800, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Signed-off-by: Limin Wang > --- > libavcodec/decode.c | 52 +++-- > 1 file changed, 27 insertions(+), 25 deletions(-) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad signature.asc Description: PGP signature ___ 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".
Re: [FFmpeg-devel] [PATCH] lavf/libsrt: Fix typo
On Tue, Jan 7, 2020 at 1:43 AM Anthony Delannoy wrote: > > --- > libavformat/libsrt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c > index a727b1c3e4..16975b6d94 100644 > --- a/libavformat/libsrt.c > +++ b/libavformat/libsrt.c > @@ -337,9 +337,9 @@ static int libsrt_set_options_pre(URLContext *h, int fd) > (s->kmrefreshrate >= 0 && libsrt_setsockopt(h, fd, > SRTO_KMREFRESHRATE, "SRTO_KMREFRESHRATE", &s->kmrefreshrate, > sizeof(s->kmrefreshrate)) < 0) || > (s->kmpreannounce >= 0 && libsrt_setsockopt(h, fd, > SRTO_KMPREANNOUNCE, "SRTO_KMPREANNOUNCE", &s->kmpreannounce, > sizeof(s->kmpreannounce)) < 0) || > #endif > -(s->mss >= 0 && libsrt_setsockopt(h, fd, SRTO_MSS, "SRTO_MMS", > &s->mss, sizeof(s->mss)) < 0) || > +(s->mss >= 0 && libsrt_setsockopt(h, fd, SRTO_MSS, "SRTO_MSS", > &s->mss, sizeof(s->mss)) < 0) || > (s->ffs >= 0 && libsrt_setsockopt(h, fd, SRTO_FC, "SRTO_FC", > &s->ffs, sizeof(s->ffs)) < 0) || > -(s->ipttl >= 0 && libsrt_setsockopt(h, fd, SRTO_IPTTL, "SRTO_UPTTL", > &s->ipttl, sizeof(s->ipttl)) < 0) || > +(s->ipttl >= 0 && libsrt_setsockopt(h, fd, SRTO_IPTTL, "SRTO_IPTTL", > &s->ipttl, sizeof(s->ipttl)) < 0) || > (s->iptos >= 0 && libsrt_setsockopt(h, fd, SRTO_IPTOS, "SRTO_IPTOS", > &s->iptos, sizeof(s->iptos)) < 0) || > (s->latency >= 0 && libsrt_setsockopt(h, fd, SRTO_LATENCY, > "SRTO_LATENCY", &latency, sizeof(latency)) < 0) || > (s->rcvlatency >= 0 && libsrt_setsockopt(h, fd, SRTO_RCVLATENCY, > "SRTO_RCVLATENCY", &rcvlatency, sizeof(rcvlatency)) < 0) || > -- > 2.24.1 > LGTM ___ 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".
Re: [FFmpeg-devel] [PATCH] HEVC: Export motion vectors to frame side data.
Haven't tested but patch LGTM Asaf Kave 于2019年12月29日周日 下午10:08写道: > > --- > libavcodec/hevc_refs.c | 15 > libavcodec/hevcdec.c | 173 - > libavcodec/hevcdec.h | 13 > 3 files changed, 200 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c > index 7870a72fd6..20f028fa73 100644 > --- a/libavcodec/hevc_refs.c > +++ b/libavcodec/hevc_refs.c > @@ -42,6 +42,9 @@ void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, > int flags) > av_buffer_unref(&frame->tab_mvf_buf); > frame->tab_mvf = NULL; > > +av_buffer_unref(&frame->cuh_buf); > +frame->cuh = NULL; > + > av_buffer_unref(&frame->rpl_buf); > av_buffer_unref(&frame->rpl_tab_buf); > frame->rpl_tab= NULL; > @@ -101,11 +104,17 @@ static HEVCFrame *alloc_frame(HEVCContext *s) > goto fail; > frame->tab_mvf = (MvField *)frame->tab_mvf_buf->data; > > +frame->cuh_buf = av_buffer_pool_get(s->cuh_pool); > +if (!frame->cuh_buf) > +goto fail; > +frame->cuh = (CodingUnitHelper *)frame->cuh_buf->data; > + > frame->rpl_tab_buf = av_buffer_pool_get(s->rpl_tab_pool); > if (!frame->rpl_tab_buf) > goto fail; > frame->rpl_tab = (RefPicListTab **)frame->rpl_tab_buf->data; > frame->ctb_count = s->ps.sps->ctb_width * s->ps.sps->ctb_height; > +frame->cu_count = 0; > for (j = 0; j < frame->ctb_count; j++) > frame->rpl_tab[j] = (RefPicListTab *)frame->rpl_buf->data; > > @@ -161,6 +170,10 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, > int poc) > else > ref->flags = HEVC_FRAME_FLAG_SHORT_REF; > > +if (s->avctx->flags2 & AV_CODEC_FLAG2_EXPORT_MVS) { > +ref->flags |= HEVC_FRAME_FLAG_MV; > +} > + > ref->poc = poc; > ref->sequence = s->seq_decode; > ref->frame->crop_left = s->ps.sps->output_window.left_offset; > @@ -216,6 +229,8 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, > int flush) > if (ret < 0) > return ret; > > +s->output_frame_poc = frame->poc; > + > av_log(s->avctx, AV_LOG_DEBUG, > "Output frame with POC %d.\n", frame->poc); > return 1; > diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c > index 19b0cd815d..aedc559283 100644 > --- a/libavcodec/hevcdec.c > +++ b/libavcodec/hevcdec.c > @@ -32,6 +32,7 @@ > #include "libavutil/opt.h" > #include "libavutil/pixdesc.h" > #include "libavutil/stereo3d.h" > +#include "libavutil/motion_vector.h" > > #include "bswapdsp.h" > #include "bytestream.h" > @@ -80,6 +81,7 @@ static void pic_arrays_free(HEVCContext *s) > av_freep(&s->sh.offset); > > av_buffer_pool_uninit(&s->tab_mvf_pool); > +av_buffer_pool_uninit(&s->cuh_pool); > av_buffer_pool_uninit(&s->rpl_tab_pool); > } > > @@ -128,9 +130,11 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS > *sps) > > s->tab_mvf_pool = av_buffer_pool_init(min_pu_size * sizeof(MvField), >av_buffer_allocz); > +s->cuh_pool = av_buffer_pool_init(min_pu_size * sizeof(CodingUnitHelper), > + av_buffer_allocz); > s->rpl_tab_pool = av_buffer_pool_init(ctb_count * sizeof(RefPicListTab), >av_buffer_allocz); > -if (!s->tab_mvf_pool || !s->rpl_tab_pool) > +if (!s->tab_mvf_pool || !s->rpl_tab_pool || !s->cuh_pool) > goto fail; > > return 0; > @@ -1806,6 +1810,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, > int y0, > int min_pu_width = s->ps.sps->min_pu_width; > > MvField *tab_mvf = s->ref->tab_mvf; > +CodingUnitHelper *cuh = s->ref->cuh; > RefPicList *refPicList = s->ref->refPicList; > HEVCFrame *ref0 = NULL, *ref1 = NULL; > uint8_t *dst0 = POS(0, x0, y0); > @@ -1843,6 +1848,9 @@ static void hls_prediction_unit(HEVCContext *s, int x0, > int y0, > for (i = 0; i < nPbW >> s->ps.sps->log2_min_pu_size; i++) > tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv; > > +struct CodingUnitHelper cuh_ = {lc->cu, log2_cb_size }; > +cuh[s->ref->cu_count++] = cuh_; > + > if (current_mv.pred_flag & PF_L0) { > ref0 = refPicList[0].ref[current_mv.ref_idx[0]]; > if (!ref0) > @@ -3192,6 +3200,160 @@ static int hevc_decode_extradata(HEVCContext *s, > uint8_t *buf, int length, int f > return 0; > } > > +static int set_mv(AVMotionVector *mv, int puW, int puH, > + int dst_x, int dst_y, > + int motion_x, int motion_y, int motion_scale, > + int direction) > +{ > +mv->w = puW; > +mv->h = puH; > +mv->motion_x = motion_x; > +mv->motion_y = motion_y; > +mv->motion_scale = motion_scale; > +mv->ds
[FFmpeg-devel] [PATCH v7 1/8] avutil: add AV_FRAME_DATA_USER_DATA_UNREGISTERED side data type
From: Limin Wang Signed-off-by: Limin Wang --- doc/APIchanges | 3 +++ libavutil/frame.c | 1 + libavutil/frame.h | 8 libavutil/version.h | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 3c24dc6fbc..6e1673e25e 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2017-10-21 API changes, most recent first: +2020-01-xx - xx - lavu 56.39.100 - frame.h + Add AV_FRAME_DATA_USER_DATA_UNREGISTERED. + 2019-12-27 - xx - lavu 56.38.100 - eval.h Add av_expr_count_func(). diff --git a/libavutil/frame.c b/libavutil/frame.c index e4038096c2..1d0faec687 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -842,6 +842,7 @@ const char *av_frame_side_data_name(enum AVFrameSideDataType type) #endif case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata SMPTE2094-40 (HDR10+)"; case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest"; +case AV_FRAME_DATA_USER_DATA_UNREGISTERED: return "User Data Unregistered"; } return NULL; } diff --git a/libavutil/frame.h b/libavutil/frame.h index b5afb58634..54863c86ce 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -179,6 +179,14 @@ enum AVFrameSideDataType { * array element is implied by AVFrameSideData.size / AVRegionOfInterest.self_size. */ AV_FRAME_DATA_REGIONS_OF_INTEREST, + +/** + * User data unregistered metadata associated with a video frame. + * This is the H.26[45] UDU SEI message, and shouldn't be used for any other purpose + * The data is stored as uint8_t in AVFrameSideData.data which is 16 bytes of + * uuid_iso_iec_11578 followed by AVFrameSideData.size-16 bytes of user_data_payload_byte. + */ +AV_FRAME_DATA_USER_DATA_UNREGISTERED, }; enum AVActiveFormatDescription { diff --git a/libavutil/version.h b/libavutil/version.h index af8f614aff..2bc1b98615 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 56 -#define LIBAVUTIL_VERSION_MINOR 38 +#define LIBAVUTIL_VERSION_MINOR 39 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ -- 2.21.0 ___ 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 v7 5/8] avcodec/h264_metadata_bsf: Fix for the incorrect user data with hyphens
From: Limin Wang How to reproduce: ./ffmpeg -f lavfi -i testsrc -c:v libx264 -g 25 -bsf:v h264_metadata=sei_user_data=186f3693-b7b3-4f2c-9653-21492feee5b8+hello -frames:v 1 h264.mp4 master: [Parsed_showinfo_0 @ 0x7fc8a0703180] UUID=186f3693-7030-4f2c-6030-21492feee5b8 [Parsed_showinfo_0 @ 0x7fc8a0703180] User Data=hello Applied the patch: [Parsed_showinfo_0 @ 0x7f969d408e00] UUID=186f3693-b7b3-4f2c-9653-21492feee5b8 [Parsed_showinfo_0 @ 0x7f969d408e00] User Data=hello Signed-off-by: Limin Wang --- libavcodec/h264_metadata_bsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264_metadata_bsf.c b/libavcodec/h264_metadata_bsf.c index 5de74be9d6..d96a50dbf7 100644 --- a/libavcodec/h264_metadata_bsf.c +++ b/libavcodec/h264_metadata_bsf.c @@ -381,7 +381,7 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *pkt) } else { goto invalid_user_data; } -if (i & 1) +if (j & 1) udu->uuid_iso_iec_11578[j / 2] |= v; else udu->uuid_iso_iec_11578[j / 2] = v << 4; -- 2.21.0 ___ 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 v7 2/8] avcodec/hevc_sei: add support for user data unregistered SEI message
From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/hevc_sei.c | 31 + libavcodec/hevc_sei.h | 6 ++ libavcodec/hevcdec.c| 14 + tests/ref/fate/hevc-monochrome-crop | 3 +++ 4 files changed, 54 insertions(+) diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c index 562ce8b516..a7c49ce081 100644 --- a/libavcodec/hevc_sei.c +++ b/libavcodec/hevc_sei.c @@ -207,6 +207,30 @@ static int decode_registered_user_data_closed_caption(HEVCSEIA53Caption *s, GetB return 0; } +static int decode_nal_sei_user_data_unregistered(HEVCSEIUnregistered *s, GetBitContext *gb, + int size) +{ +AVBufferRef *buf_ref, **tmp; + +if (size < 16) + return AVERROR(EINVAL); + +tmp = av_realloc_array(s->buf_ref, s->nb_buf_ref + 1, sizeof(*s->buf_ref)); +if (!tmp) +return AVERROR(ENOMEM); +s->buf_ref = tmp; + +buf_ref = av_buffer_alloc(size); +if (!buf_ref) +return AVERROR(ENOMEM); + +for (int i = 0; i < size; i++) +buf_ref->data[i] = get_bits(gb, 8); +s->buf_ref[s->nb_buf_ref++] = buf_ref; + +return 0; +} + static int decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetBitContext *gb, int size) { @@ -294,6 +318,8 @@ static int decode_nal_sei_prefix(GetBitContext *gb, void *logctx, HEVCSEI *s, return decode_nal_sei_active_parameter_sets(s, gb, logctx); case HEVC_SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35: return decode_nal_sei_user_data_registered_itu_t_t35(s, gb, size); +case HEVC_SEI_TYPE_USER_DATA_UNREGISTERED: +return decode_nal_sei_user_data_unregistered(&s->unregistered, gb, size); case HEVC_SEI_TYPE_ALTERNATIVE_TRANSFER_CHARACTERISTICS: return decode_nal_sei_alternative_transfer(&s->alternative_transfer, gb); default: @@ -365,4 +391,9 @@ int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, void ff_hevc_reset_sei(HEVCSEI *s) { av_buffer_unref(&s->a53_caption.buf_ref); + +for (int i = 0; i < s->unregistered.nb_buf_ref; i++) +av_buffer_unref(&s->unregistered.buf_ref[i]); +s->unregistered.nb_buf_ref = 0; +av_freep(&s->unregistered.buf_ref); } diff --git a/libavcodec/hevc_sei.h b/libavcodec/hevc_sei.h index 2769d41445..a8a2ab7dc6 100644 --- a/libavcodec/hevc_sei.h +++ b/libavcodec/hevc_sei.h @@ -86,6 +86,11 @@ typedef struct HEVCSEIA53Caption { AVBufferRef *buf_ref; } HEVCSEIA53Caption; +typedef struct HEVCSEIUnregistered { +AVBufferRef **buf_ref; +int nb_buf_ref; +} HEVCSEIUnregistered; + typedef struct HEVCSEIMasteringDisplay { int present; uint16_t display_primaries[3][2]; @@ -111,6 +116,7 @@ typedef struct HEVCSEI { HEVCSEIDisplayOrientation display_orientation; HEVCSEIPictureTiming picture_timing; HEVCSEIA53Caption a53_caption; +HEVCSEIUnregistered unregistered; HEVCSEIMasteringDisplay mastering_display; HEVCSEIContentLight content_light; int active_seq_parameter_set_id; diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 19b0cd815d..f3f855d0aa 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2789,6 +2789,20 @@ static int set_side_data(HEVCContext *s) s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; } +for (int i = 0; i < s->sei.unregistered.nb_buf_ref; i++) { +HEVCSEIUnregistered *unreg = &s->sei.unregistered; + +if (unreg->buf_ref[i]) { +AVFrameSideData *sd = av_frame_new_side_data_from_buf(out, +AV_FRAME_DATA_USER_DATA_UNREGISTERED, +unreg->buf_ref[i]); +if (!sd) +av_buffer_unref(&unreg->buf_ref[i]); +unreg->buf_ref[i] = NULL; +} +} +s->sei.unregistered.nb_buf_ref = 0; + return 0; } diff --git a/tests/ref/fate/hevc-monochrome-crop b/tests/ref/fate/hevc-monochrome-crop index 4e45412acf..43f0abbcfa 100644 --- a/tests/ref/fate/hevc-monochrome-crop +++ b/tests/ref/fate/hevc-monochrome-crop @@ -1,6 +1,9 @@ [FRAME] width=384 height=240 +[SIDE_DATA] +side_data_type=User Data Unregistered +[/SIDE_DATA] [/FRAME] [STREAM] width=384 -- 2.21.0 ___ 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 v7 6/8] avcodec/h264_metadata_bsf: Fix user data failed to insert in case no SPSs NAL for global headers
From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/h264_metadata_bsf.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264_metadata_bsf.c b/libavcodec/h264_metadata_bsf.c index d96a50dbf7..a320589530 100644 --- a/libavcodec/h264_metadata_bsf.c +++ b/libavcodec/h264_metadata_bsf.c @@ -279,7 +279,7 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *pkt) { H264MetadataContext *ctx = bsf->priv_data; CodedBitstreamFragment *au = &ctx->access_unit; -int err, i, j, has_sps; +int err, i, j, has_sps, has_keyframe = 0; H264RawAUD aud; err = ff_bsf_get_packet_ref(bsf, pkt); @@ -359,11 +359,13 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *pkt) goto fail; has_sps = 1; } +if (au->units[i].type == H264_NAL_IDR_SLICE) +has_keyframe = 1; } // Only insert the SEI in access units containing SPSs, and also // unconditionally in the first access unit we ever see. -if (ctx->sei_user_data && (has_sps || !ctx->done_first_au)) { +if (ctx->sei_user_data && (has_sps || !ctx->done_first_au || has_keyframe)) { H264RawSEIPayload payload = { .payload_type = H264_SEI_TYPE_USER_DATA_UNREGISTERED, }; -- 2.21.0 ___ 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 v7 4/8] avcodec/h264: create user data unregistered side data for H.264
From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/h264_sei.c | 30 +- libavcodec/h264_sei.h | 2 + libavcodec/h264_slice.c | 14 +++ tests/ref/fate/mov-zombie | 195 +- 4 files changed, 171 insertions(+), 70 deletions(-) diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c index a565feabe2..f72c48cd3b 100644 --- a/libavcodec/h264_sei.c +++ b/libavcodec/h264_sei.c @@ -24,6 +24,7 @@ * H.264 / AVC / MPEG-4 part10 SEI decoding. * @author Michael Niedermayer */ +#include #include "avcodec.h" #include "get_bits.h" @@ -52,6 +53,10 @@ void ff_h264_sei_uninit(H264SEIContext *h) h->afd.present = 0; av_buffer_unref(&h->a53_caption.buf_ref); +for (int i = 0; i < h->unregistered.nb_buf_ref; i++) +av_buffer_unref(&h->unregistered.buf_ref[i]); +h->unregistered.nb_buf_ref = 0; +av_freep(&h->unregistered.buf_ref); } static int decode_picture_timing(H264SEIPictureTiming *h, GetBitContext *gb, @@ -241,30 +246,45 @@ static int decode_registered_user_data(H264SEIContext *h, GetBitContext *gb, return 0; } +static int string_is_print(const uint8_t *str) +{ +while (isprint(*str)) str++; +return !*str; +} + static int decode_unregistered_user_data(H264SEIUnregistered *h, GetBitContext *gb, void *logctx, int size) { uint8_t *user_data; int e, build, i; +AVBufferRef *buf_ref, **tmp; -if (size < 16 || size >= INT_MAX - 1) +if (size < 16) return AVERROR_INVALIDDATA; -user_data = av_malloc(size + 1); -if (!user_data) +tmp = av_realloc_array(h->buf_ref, h->nb_buf_ref + 1, sizeof(*h->buf_ref)); +if (!tmp) return AVERROR(ENOMEM); +h->buf_ref = tmp; + +buf_ref = av_buffer_alloc(size); +if (!buf_ref) +return AVERROR(ENOMEM); +user_data = buf_ref->data; for (i = 0; i < size; i++) user_data[i] = get_bits(gb, 8); +h->buf_ref[h->nb_buf_ref++] = buf_ref; + +if (!string_is_print(user_data + 16)) +return 0; -user_data[i] = 0; e = sscanf(user_data + 16, "x264 - core %d", &build); if (e == 1 && build > 0) h->x264_build = build; if (e == 1 && build == 1 && !strncmp(user_data+16, "x264 - core ", 16)) h->x264_build = 67; -av_free(user_data); return 0; } diff --git a/libavcodec/h264_sei.h b/libavcodec/h264_sei.h index a75c3aa175..aa4595ff25 100644 --- a/libavcodec/h264_sei.h +++ b/libavcodec/h264_sei.h @@ -121,6 +121,8 @@ typedef struct H264SEIA53Caption { typedef struct H264SEIUnregistered { int x264_build; +AVBufferRef **buf_ref; +int nb_buf_ref; } H264SEIUnregistered; typedef struct H264SEIRecoveryPoint { diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index e24d41ca50..ea967c8411 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1285,6 +1285,20 @@ static int h264_export_frame_props(H264Context *h) h->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; } +for (int i = 0; i < h->sei.unregistered.nb_buf_ref; i++) { +H264SEIUnregistered *unreg = &h->sei.unregistered; + +if (unreg->buf_ref[i]) { +AVFrameSideData *sd = av_frame_new_side_data_from_buf(cur->f, +AV_FRAME_DATA_USER_DATA_UNREGISTERED, +unreg->buf_ref[i]); +if (!sd) +av_buffer_unref(&unreg->buf_ref[i]); +unreg->buf_ref[i] = NULL; +} +} +h->sei.unregistered.nb_buf_ref = 0; + if (h->sei.picture_timing.timecode_cnt > 0) { uint32_t tc = 0; uint32_t *tc_sd; diff --git a/tests/ref/fate/mov-zombie b/tests/ref/fate/mov-zombie index f45fa59637..0888295cfc 100644 --- a/tests/ref/fate/mov-zombie +++ b/tests/ref/fate/mov-zombie @@ -1,133 +1,198 @@ packet|codec_type=video|stream_index=0|pts=0|pts_time=0.00|dts=-3004|dts_time=-0.033378|duration=3003|duration_time=0.033367|convergence_duration=N/A|convergence_duration_time=N/A|size=4133|pos=11309|flags=K_ packet|codec_type=video|stream_index=0|pts=5440|pts_time=0.060444|dts=-567|dts_time=-0.006300|duration=3003|duration_time=0.033367|convergence_duration=N/A|convergence_duration_time=N/A|size=1077|pos=15442|flags=__ -frame|media_type=video|stream_index=0|key_frame=1|pkt_pts=0|pkt_pts_time=0.00|pkt_dts=-567|pkt_dts_time=-0.006300|best_effort_timestamp=0|best_effort_timestamp_time=0.00|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=11309|pkt_size=4133|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=I|coded_picture_number=0|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleft +frame|media_type=video|stream_index=0|key_frame=1|pkt_pts=0|pkt_pts_time=0.00|pkt_dts=-567|pkt_dts_time=-0.006300|best_eff
[FFmpeg-devel] [PATCH v7 3/8] avfilter/vf_showinfo: display user data unregistered message
From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/vf_showinfo.c | 37 + 1 file changed, 37 insertions(+) diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index 31f6b32aa4..14e73019d2 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -23,6 +23,7 @@ */ #include +#include #include "libavutil/adler32.h" #include "libavutil/display.h" @@ -169,6 +170,39 @@ static void dump_content_light_metadata(AVFilterContext *ctx, AVFrameSideData *s metadata->MaxCLL, metadata->MaxFALL); } +static int string_is_print(const uint8_t *str) +{ +while (isprint(*str)) str++; +return !*str; +} + +static void dump_user_data_unregistered_metadata(AVFilterContext *ctx, AVFrameSideData *sd) +{ +const int uuid_size = 16; +uint8_t *user_data = sd->data; + +if (sd->size < uuid_size) { +av_log(ctx, AV_LOG_ERROR, "invalid data(%d < UUID(%d-bytes))", sd->size, uuid_size); +return; +} + +av_log(ctx, AV_LOG_INFO, "User Data Unregistered:\n"); +av_log(ctx, AV_LOG_INFO, "UUID="); +for (int i = 0; i < uuid_size; i++) { +av_log(ctx, AV_LOG_INFO, "%02x", user_data[i]); +if (i == 3 || i == 5 || i == 7 || i == 9) +av_log(ctx, AV_LOG_INFO, "-"); +} +av_log(ctx, AV_LOG_INFO, "\n"); + +user_data += uuid_size; +/* Only print the user data details if it's string */ +if (string_is_print(user_data)) { +av_log(ctx, AV_LOG_INFO, "User Data="); +av_log(ctx, AV_LOG_INFO, "%s", user_data); +} +} + static void dump_color_property(AVFilterContext *ctx, AVFrame *frame) { const char *color_range_str = av_color_range_name(frame->color_range); @@ -319,6 +353,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) av_log(ctx, AV_LOG_INFO, "GOP timecode - %s", tcbuf); break; } +case AV_FRAME_DATA_USER_DATA_UNREGISTERED: +dump_user_data_unregistered_metadata(ctx, sd); +break; default: av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d bytes)", sd->type, sd->size); -- 2.21.0 ___ 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 v7 7/8] avcodec/cbs_h2645: add helper functions to insert and delete SEI PREFIX messages
From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/cbs_h2645.c | 93 ++ libavcodec/cbs_h265.h | 25 2 files changed, 118 insertions(+) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index 5f71d80584..2fc957dc27 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -1612,3 +1612,96 @@ void ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx, (sei->payload_count - position) * sizeof(*sei->payload)); } } + +int ff_cbs_h265_add_sei_prefix_message(CodedBitstreamContext *ctx, +CodedBitstreamFragment *au, +H265RawSEIPayload *payload) +{ +H265RawSEI *sei = NULL; +int err, i; + +// Find an existing SEI PREFIX NAL unit to add to. +for (i = 0; i < au->nb_units; i++) { +if (au->units[i].type == HEVC_NAL_SEI_PREFIX) { +sei = au->units[i].content; +if (sei->payload_count < H265_MAX_SEI_PAYLOADS) +break; + +sei = NULL; +} +} + +if (!sei) { +// Need to make a new SEI NAL unit. Insert it before the first +// slice data NAL unit; if no slice data, add at the end. +AVBufferRef *sei_ref; + +sei = av_mallocz(sizeof(*sei)); +if (!sei) { +err = AVERROR(ENOMEM); +goto fail; +} + +sei->nal_unit_header.nal_unit_type = HEVC_NAL_SEI_PREFIX; +sei->nal_unit_header.nuh_layer_id = 0; +sei->nal_unit_header.nuh_temporal_id_plus1 = 1; + +sei_ref = av_buffer_create((uint8_t*)sei, sizeof(*sei), + &cbs_h265_free_sei, NULL, 0); +if (!sei_ref) { +av_freep(&sei); +err = AVERROR(ENOMEM); +goto fail; +} + +for (i = 0; i < au->nb_units; i++) { +if (au->units[i].type == HEVC_NAL_IDR_W_RADL || +au->units[i].type == HEVC_NAL_IDR_N_LP) +break; +} + +err = ff_cbs_insert_unit_content(ctx, au, i, HEVC_NAL_SEI_PREFIX, + sei, sei_ref); +av_buffer_unref(&sei_ref); +if (err < 0) +goto fail; +} + +memcpy(&sei->payload[sei->payload_count], payload, sizeof(*payload)); +++sei->payload_count; + +return 0; +fail: +cbs_h265_free_sei_payload(payload); +return err; +} + +void ff_cbs_h265_delete_sei_prefix_message(CodedBitstreamContext *ctx, +CodedBitstreamFragment *au, +CodedBitstreamUnit *nal, +int position) +{ +H265RawSEI *sei = nal->content; + +av_assert0(nal->type == HEVC_NAL_SEI_PREFIX); +av_assert0(position >= 0 && position < sei->payload_count); + +if (position == 0 && sei->payload_count == 1) { +// Deleting NAL unit entirely. +int i; + +for (i = 0; i < au->nb_units; i++) { +if (&au->units[i] == nal) +break; +} + +ff_cbs_delete_unit(ctx, au, i); +} else { +cbs_h265_free_sei_payload(&sei->payload[position]); + +--sei->payload_count; +memmove(sei->payload + position, +sei->payload + position + 1, +(sei->payload_count - position) * sizeof(*sei->payload)); +} +} diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h index ad746bf35f..b7e7dff658 100644 --- a/libavcodec/cbs_h265.h +++ b/libavcodec/cbs_h265.h @@ -22,6 +22,7 @@ #include #include +#include "cbs.h" #include "cbs_h2645.h" #include "hevc.h" @@ -745,5 +746,29 @@ typedef struct CodedBitstreamH265Context { const H265RawPPS *active_pps; } CodedBitstreamH265Context; +/** + * Add an SEI message to an access unit. + * + * On success, the payload will be owned by a unit in access_unit; + * on failure, the content of the payload will be freed. + */ +int ff_cbs_h265_add_sei_prefix_message(CodedBitstreamContext *ctx, +CodedBitstreamFragment *access_unit, +H265RawSEIPayload *payload); + +/** + * Delete an SEI message from an access unit. + * + * Deletes from nal_unit, which must be an SEI PREFIX NAL unit. If this is the + * last message in nal_unit, also deletes it from access_unit. + * + * Requires nal_unit to be a unit in access_unit and position to be >= 0 + * and < the payload count of the SEI nal_unit. + */ +void ff_cbs_h265_delete_sei_prefix_message(CodedBitstreamContext *ctx, +CodedBitstreamFragment *access_unit, +CodedBitstreamUnit *nal_unit, +int position); + #endif /* AVCODEC_CBS_H265_H */ -- 2.21.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v7 8/8] avcodec/h265_metadata_bsf: add option to insert a string as SEI unregistered user data
From: Limin Wang Signed-off-by: Limin Wang --- doc/bitstream_filters.texi | 8 libavcodec/h265_metadata_bsf.c | 68 +- 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi index 8fe5b3ad75..81b41d70b3 100644 --- a/doc/bitstream_filters.texi +++ b/doc/bitstream_filters.texi @@ -376,6 +376,14 @@ The argument must be the name of a level (for example, @samp{5.1}), a or the special name @samp{auto} indicating that the filter should attempt to guess the level from the input stream properties. +@item sei_user_data +Insert a string as SEI unregistered user data. The argument must +be of the form @emph{UUID+string}, where the UUID is as a 32-character +(16 bytes) hexadecimal string possibly separated by hyphens, and the +string can be anything. + +For example, @samp{086f3693-b7b3-4f2c-9653-21492feee5b8+hello} will +insert the string ``hello'' associated with the given 32-bit UUID. @end table @section hevc_mp4toannexb diff --git a/libavcodec/h265_metadata_bsf.c b/libavcodec/h265_metadata_bsf.c index b3a1fda144..312545cbe6 100644 --- a/libavcodec/h265_metadata_bsf.c +++ b/libavcodec/h265_metadata_bsf.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/avstring.h" #include "libavutil/common.h" #include "libavutil/opt.h" @@ -23,6 +24,7 @@ #include "cbs.h" #include "cbs_h265.h" #include "hevc.h" +#include "hevc_sei.h" #include "h265_profile_level.h" enum { @@ -65,6 +67,8 @@ typedef struct H265MetadataContext { int crop_top; int crop_bottom; +const char *sei_user_data; + int level; int level_guess; int level_warned; @@ -340,7 +344,7 @@ static int h265_metadata_filter(AVBSFContext *bsf, AVPacket *pkt) { H265MetadataContext *ctx = bsf->priv_data; CodedBitstreamFragment *au = &ctx->access_unit; -int err, i; +int err, i, j, has_sps = 0, has_vps = 0, has_keyframe = 0; err = ff_bsf_get_packet_ref(bsf, pkt); if (err < 0) @@ -410,11 +414,70 @@ static int h265_metadata_filter(AVBSFContext *bsf, AVPacket *pkt) err = h265_metadata_update_vps(bsf, au->units[i].content); if (err < 0) goto fail; +has_vps = 1; } if (au->units[i].type == HEVC_NAL_SPS) { err = h265_metadata_update_sps(bsf, au->units[i].content); if (err < 0) goto fail; +has_sps = 1; +} +if (au->units[i].type >= HEVC_NAL_BLA_W_LP && +au->units[i].type <= HEVC_NAL_IRAP_VCL23) +has_keyframe = 1; +} + +// Only insert the SEI in access units containing SPSs or VPSs or Keyframe +if (ctx->sei_user_data && (has_sps || has_vps || has_keyframe)) { +H265RawSEIPayload payload = { +.payload_type = HEVC_SEI_TYPE_USER_DATA_UNREGISTERED, +}; +H265RawSEIUserDataUnregistered *udu = +&payload.payload.user_data_unregistered; + +for (i = j = 0; j < 32 && ctx->sei_user_data[i]; i++) { +int c, v; +c = ctx->sei_user_data[i]; +if (c == '-') { +continue; +} else if (av_isxdigit(c)) { +c = av_tolower(c); +v = (c <= '9' ? c - '0' : c - 'a' + 10); +} else { +goto invalid_user_data; +} +if (j & 1) +udu->uuid_iso_iec_11578[j / 2] |= v; +else +udu->uuid_iso_iec_11578[j / 2] = v << 4; +++j; +} +if (j == 32 && ctx->sei_user_data[i] == '+') { +size_t len = strlen(ctx->sei_user_data + i + 1); + +udu->data_ref = av_buffer_alloc(len + 1); +if (!udu->data_ref) { +err = AVERROR(ENOMEM); +goto fail; +} + +udu->data= udu->data_ref->data; +udu->data_length = len + 1; +memcpy(udu->data, ctx->sei_user_data + i + 1, len + 1); + +err = ff_cbs_h265_add_sei_prefix_message(ctx->cbc, au, &payload); +if (err < 0) { +av_log(bsf, AV_LOG_ERROR, "Failed to add user data SEI " + "message to access unit.\n"); +goto fail; +} + +} else { +invalid_user_data: +av_log(bsf, AV_LOG_ERROR, "Invalid user data: " + "must be \"UUID+string\".\n"); +err = AVERROR(EINVAL); +goto fail; } } @@ -547,6 +610,9 @@ static const AVOption h265_metadata_options[] = { OFFSET(crop_bottom), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, HEVC_MAX_HEIGHT, FLAGS }, +{ "sei_user_data", "Insert SEI user data (UUID+string)", +OFFSET(sei_user_data), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = FLAGS }, + { "level", "Set level (tabl
Re: [FFmpeg-devel] [PATCH v6] avutil: add AV_FRAME_DATA_USER_DATA_UNREGISTERED side data type
On Mon, Jan 06, 2020 at 10:03:42PM +, Mark Thompson wrote: > On 06/01/2020 14:54, lance.lmw...@gmail.com wrote: > > From: Limin Wang > > > > Signed-off-by: Limin Wang > > --- > > Fix for the v5 commit message change when copy(add avutil:) > > > > doc/APIchanges | 3 +++ > > libavutil/frame.c | 1 + > > libavutil/frame.h | 8 > > libavutil/version.h | 2 +- > > 4 files changed, 13 insertions(+), 1 deletion(-) > > > > diff --git a/doc/APIchanges b/doc/APIchanges > > index 3c24dc6..6e1673e 100644 > > --- a/doc/APIchanges > > +++ b/doc/APIchanges > > @@ -15,6 +15,9 @@ libavutil: 2017-10-21 > > > > API changes, most recent first: > > > > +2020-01-xx - xx - lavu 56.39.100 - frame.h > > + Add AV_FRAME_DATA_USER_DATA_UNREGISTERED. > > + > > 2019-12-27 - xx - lavu 56.38.100 - eval.h > >Add av_expr_count_func(). > > > > diff --git a/libavutil/frame.c b/libavutil/frame.c > > index e403809..1d0faec6 100644 > > --- a/libavutil/frame.c > > +++ b/libavutil/frame.c > > @@ -842,6 +842,7 @@ const char *av_frame_side_data_name(enum > > AVFrameSideDataType type) > > #endif > > case AV_FRAME_DATA_DYNAMIC_HDR_PLUS: return "HDR Dynamic Metadata > > SMPTE2094-40 (HDR10+)"; > > case AV_FRAME_DATA_REGIONS_OF_INTEREST: return "Regions Of Interest"; > > +case AV_FRAME_DATA_USER_DATA_UNREGISTERED: return "User Data > > Unregistered"; > > } > > return NULL; > > } > > diff --git a/libavutil/frame.h b/libavutil/frame.h > > index b5afb58..9e8c3a9 100644 > > --- a/libavutil/frame.h > > +++ b/libavutil/frame.h > > @@ -179,6 +179,14 @@ enum AVFrameSideDataType { > > * array element is implied by AVFrameSideData.size / > > AVRegionOfInterest.self_size. > > */ > > AV_FRAME_DATA_REGIONS_OF_INTEREST, > > + > > +/** > > + * User data unregistered metadata associated with a video frame. > > IMO it should be stated directly that this is the H.26[45] UDU SEI message, > and shouldn't be used for any other purpose. Mention it here and reference > the relevant sections of the standards. > > > + * This data payload is stored as uint8_t in AVFrameSideData.data. > > + * The number of bytes of data payload is AVFrameSideData.size. > > + * The data payload consists of 16 bytes UUID and real user data. > > The ambiguity around the word payload is kindof confusing here. I think > either avoid using the word payload at all, or name the syntax elements > explicitly (16 bytes of uuid_iso_iec_11578 followed by size-16 bytes of > user_data_payload_byte). Mark, I have updated the patch set by your comments, please help to review to sure I have catch your points. If have any missing, please comments further. In addition, I put other related patch into this thread for better review. > > > + */ > > +AV_FRAME_DATA_USER_DATA_UNREGISTERED, > > }; > > > > enum AVActiveFormatDescription { > > diff --git a/libavutil/version.h b/libavutil/version.h > > index af8f614..2bc1b98 100644 > > --- a/libavutil/version.h > > +++ b/libavutil/version.h > > @@ -79,7 +79,7 @@ > > */ > > > > #define LIBAVUTIL_VERSION_MAJOR 56 > > -#define LIBAVUTIL_VERSION_MINOR 38 > > +#define LIBAVUTIL_VERSION_MINOR 39 > > #define LIBAVUTIL_VERSION_MICRO 100 > > > > #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ > > > > Thanks, > > - Mark > ___ > 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". -- Thanks, Limin Wang ___ 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".
Re: [FFmpeg-devel] [PATCH 2/2] vf_dnn_processing: add support for more formats gray8 and grayf32
> -Original Message- > From: Guo, Yejun > Sent: Friday, December 27, 2019 4:34 PM > To: ffmpeg-devel@ffmpeg.org > Cc: Guo, Yejun > Subject: [PATCH 2/2] vf_dnn_processing: add support for more formats gray8 > and grayf32 this patch set asks for review, thanks. btw, I'll add the fate test after this patch set is reviewed. ___ 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".
Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc, cosmetics: prefer sizeof(var)
On Fri, Jan 3, 2020 at 5:28 PM James Almer wrote: > > On 1/3/2020 10:16 PM, James Zern wrote: > > Signed-off-by: James Zern > > --- > > libavcodec/libvpxenc.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c > > index 3f659b4b67..0b8a070304 100644 > > --- a/libavcodec/libvpxenc.c > > +++ b/libavcodec/libvpxenc.c > > @@ -1041,8 +1041,7 @@ static int queue_frames(AVCodecContext *avctx, > > AVPacket *pkt_out) > > if (size < 0) > > return size; > > } else { > > -struct FrameListData *cx_frame = > > -av_malloc(sizeof(struct FrameListData)); > > +struct FrameListData *cx_frame = > > av_malloc(sizeof(*cx_frame)); > > > > if (!cx_frame) { > > av_log(avctx, AV_LOG_ERROR, > > LGTM applied, thanks. ___ 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".