FreeBSD Bugzilla – Attachment 231123 Details for
Bug 261302
multimedia/ffmpeg: update to 6.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
v1 (apply via "git am")
bug261302.diff (text/plain), 30.78 KB, created by
Jan Beich
on 2022-01-18 10:39:49 UTC
(
hide
)
Description:
v1 (apply via "git am")
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2022-01-18 10:39:49 UTC
Size:
30.78 KB
patch
obsolete
>From ab289b4241ea0fb8fbb282228544b34278236f3d Mon Sep 17 00:00:00 2001 >From: Jan Beich <jbeich@FreeBSD.org> >Date: Fri, 14 Jan 2022 18:45:42 +0000 >Subject: [PATCH] multimedia/ffmpeg: update to 5.0 > >* --enable-avresample is gone per https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/420cedd49745 >* SHADERC replaces GLSLANG per https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/da72aca7b025 >* VULKAN is enabled per https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/fa2e460f635 >* LIBPLACEBO is enabled to have even more Vulkan goodies > >Changes: https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/n5.0:/Changelog >PR: 261302 >Reported by: Repology >Exp-run by: antoine >--- > multimedia/ffmpeg/Makefile | 25 ++- > multimedia/ffmpeg/distinfo | 6 +- > multimedia/ffmpeg/files/patch-vmaf | 312 +++++++++++++++++++---------- > multimedia/ffmpeg/pkg-plist | 41 ++-- > 4 files changed, 244 insertions(+), 140 deletions(-) > >diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile >index 2428c5f40f57..a895d527ac8e 100644 >--- a/multimedia/ffmpeg/Makefile >+++ b/multimedia/ffmpeg/Makefile >@@ -1,8 +1,7 @@ > # Created by: Martin Matuska <mm@FreeBSD.org> > > PORTNAME= ffmpeg >-PORTVERSION= 4.4.1 >-PORTREVISION= 3 >+PORTVERSION= 5.0 > PORTEPOCH= 1 > CATEGORIES= multimedia audio net > MASTER_SITES= https://ffmpeg.org/releases/ >@@ -37,18 +36,18 @@ PORTSCOUT= limit:^4\. > OPTIONS_DEFINE= ALSA AMR_NB AMR_WB AOM ARIBB24 ASM ASS BS2B CACA CDIO \ > CODEC2 DAV1D DAVS2 DC1394 DEBUG DOCS DRM FDK_AAC FLITE \ > FONTCONFIG FREETYPE FREI0R FRIBIDI GLSLANG GME GSM ICONV ILBC \ >- JACK KLVANC KVAZAAR LADSPA LAME LENSFUN LIBBLURAY LIBRSVG2 \ >+ JACK KLVANC KVAZAAR LADSPA LAME LENSFUN LIBBLURAY LIBPLACEBO LIBRSVG2 \ > LIBXML2 LTO LV2 MFX MODPLUG MYSOFA OPENAL OPENCL OPENGL \ > OPENH264 OPENJPEG OPENMPT OPENVINO OPTIMIZED_CFLAGS OPUS POCKETSPHINX \ >- PULSEAUDIO RAV1E RABBITMQ RIST RTCPU RUBBERBAND SDL SMB SNAPPY \ >+ PULSEAUDIO RAV1E RABBITMQ RIST RTCPU RUBBERBAND SDL SHADERC SMB SNAPPY \ > SNDIO SOXR SPEEX SRT SSH SVTAV1 SVTHEVC SVTVP9 TENSORFLOW \ > TESSERACT THEORA TWOLAME UAVS3D V4L VAAPI VAPOURSYNTH VDPAU VIDSTAB \ > VMAF VO_AMRWBENC VORBIS VPX VULKAN WEBP X264 X265 \ > XAVS2 XCB XVID XVIDEO ZIMG ZMQ ZVBI > > OPTIONS_DEFAULT= AOM ASM ASS DAV1D DRM FONTCONFIG FREETYPE FREI0R GMP \ >- GNUTLS ICONV LAME LIBXML2 OPTIMIZED_CFLAGS OPUS RTCPU \ >- THEORA V4L VAAPI VDPAU VMAF VORBIS VPX X264 X265 XCB XVID >+ GNUTLS ICONV LAME LIBPLACEBO LIBXML2 OPTIMIZED_CFLAGS OPUS RTCPU \ >+ THEORA V4L VAAPI VDPAU VMAF VORBIS VPX VULKAN X264 X265 XCB XVID > > # i386 is too register-starved for LTO (PR257124) > OPTIONS_EXCLUDE_i386= LTO >@@ -127,10 +126,12 @@ RIST_DESC= Reliable Internet Stream Transport protocol via librist > RUBBERBAND_DESC=Time-stretching and pitch-shifting with librubberband > RTCPU_DESC= Detect CPU capabilities at runtime > RTMP_DESC= RTMP(T)E protocol support >+SHADERC_DESC= GLSL->SPIRV compilation via libshaderc > SRT_DESC= Haivision SRT protocol via libsrt > SVTAV1_DESC= AV1 encoding via SVT-AV1 > SVTHEVC_DESC= HEVC encoding via SVT-HEVC > SVTVP9_DESC= VP9 encoding via SVT-VP9 >+LIBPLACEBO_DESC=GPU filters from libplacebo > LIBRTMP_DESC= ${RTMP_DESC} via librtmp > TENSORFLOW_DESC=TensorFlow as a DNN module backend for DNN based filters like sr > TESSERACT_DESC= Optical Character Recognition via Tesseract >@@ -310,6 +311,10 @@ LENSFUN_CONFIGURE_ENABLE= liblensfun > LIBBLURAY_LIB_DEPENDS= libbluray.so:multimedia/libbluray > LIBBLURAY_CONFIGURE_ENABLE= libbluray > >+# libplacebo >+LIBPLACEBO_LIB_DEPENDS= libplacebo.so:graphics/libplacebo >+LIBPLACEBO_CONFIGURE_ENABLE= libplacebo >+ > # librsvg > LIBRSVG2_USES= gnome > LIBRSVG2_USE= GNOME=cairo,librsvg2 >@@ -429,6 +434,11 @@ SDL_USES= sdl > SDL_USE= SDL=sdl2 > SDL_CONFIGURE_ENABLE= sdl2 > >+# shaderc >+SHADERC_LIB_DEPENDS= libshaderc_shared.so:graphics/shaderc >+SHADERC_CONFIGURE_ENABLE= libshaderc >+SHADERC_PREVENTS= GLSLANG >+ > # smbclient > SMB_USES= samba:lib > SMB_CONFIGURE_ENABLE= libsmbclient >@@ -540,7 +550,7 @@ VPX_CONFIGURE_ENABLE= libvpx > VULKAN_BUILD_DEPENDS= vulkan-headers>0:graphics/vulkan-headers > VULKAN_LIB_DEPENDS= libvulkan.so:graphics/vulkan-loader > VULKAN_CONFIGURE_ENABLE= vulkan >-VULKAN_IMPLIES= GLSLANG >+VULKAN_IMPLIES= ${"${PORT_OPTIONS:MGLSLANG}":?GLSLANG:SHADERC} > > # webp > WEBP_LIB_DEPENDS= libwebp.so:graphics/webp >@@ -613,7 +623,6 @@ CONFIGURE_ARGS+=--prefix="${PREFIX}" \ > --enable-shared \ > --enable-pic \ > --enable-gpl \ >- --enable-avresample \ > --cc="${CC}" \ > --cxx="${CXX}" > >diff --git a/multimedia/ffmpeg/distinfo b/multimedia/ffmpeg/distinfo >index 5653a5667639..5a91cd3996b4 100644 >--- a/multimedia/ffmpeg/distinfo >+++ b/multimedia/ffmpeg/distinfo >@@ -1,6 +1,6 @@ >-TIMESTAMP = 1635171801 >-SHA256 (ffmpeg-4.4.1.tar.xz) = eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02 >-SIZE (ffmpeg-4.4.1.tar.xz) = 9557516 >+TIMESTAMP = 1642185942 >+SHA256 (ffmpeg-5.0.tar.xz) = 51e919f7d205062c0fd4fae6243a84850391115104ccf1efc451733bc0ac7298 >+SIZE (ffmpeg-5.0.tar.xz) = 9811480 > SHA256 (0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch) = 376ea23e9d876390fbca936c80cb437bb9daa6232ff65df0ea91673e18b739ff > SIZE (0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch) = 24259 > SHA256 (0002-doc-Add-libsvt_hevc-encoder-docs.patch) = d16589efc4be2602a9f436e9938cfee0cc7b5ccd7a4a6b41c0c9a59ae0859fda >diff --git a/multimedia/ffmpeg/files/patch-vmaf b/multimedia/ffmpeg/files/patch-vmaf >index b503561803c1..b643b8f572eb 100644 >--- a/multimedia/ffmpeg/files/patch-vmaf >+++ b/multimedia/ffmpeg/files/patch-vmaf >@@ -1,9 +1,9 @@ >-https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html >+https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2022-January/291606.html > >---- configure.orig 2021-10-24 20:47:11 UTC >+--- configure.orig 2022-01-14 18:45:39 UTC > +++ configure >-@@ -3663,7 +3663,7 @@ uspp_filter_deps="gpl avcodec" >- vaguedenoiser_filter_deps="gpl" >+@@ -3747,7 +3747,7 @@ vaguedenoiser_filter_deps="gpl" >+ vflip_vulkan_filter_deps="vulkan spirv_compiler" > vidstabdetect_filter_deps="libvidstab" > vidstabtransform_filter_deps="libvidstab" > -libvmaf_filter_deps="libvmaf pthreads" >@@ -11,7 +11,7 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > zmq_filter_deps="libzmq" > zoompan_filter_deps="swscale" > zscale_filter_deps="libzimg const_nan" >-@@ -6441,7 +6441,7 @@ enabled libtwolame && require libtwolame twolam >+@@ -6615,7 +6615,7 @@ enabled libtwolame && require libtwolame twolam > enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode > enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl > enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit >@@ -20,9 +20,9 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc > enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init && > require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init >---- doc/filters.texi.orig 2021-10-24 20:47:07 UTC >+--- doc/filters.texi.orig 2022-01-14 18:45:39 UTC > +++ doc/filters.texi >-@@ -13867,66 +13867,37 @@ ffmpeg -i input.mov -vf lensfun=make=Canon:model="Cano >+@@ -14666,68 +14666,39 @@ ffmpeg -i input.mov -vf lensfun=make=Canon:model="Cano > > @section libvmaf > >@@ -31,6 +31,9 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > +Calulate the VMAF (Video Multi-Method Assessment Fusion) score for a > +reference/distorted pair of input videos. > >+-The first input is the encoded video, and the second input is the reference video. >++The first input is the distorted video, and the second input is the reference video. >+ > The obtained VMAF score is printed through the logging system. > > It requires Netflix's vmaf library (libvmaf) as a pre-requisite. >@@ -102,7 +105,7 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > @end table > > This filter also supports the @ref{framesync} options. >-@@ -13934,23 +13905,31 @@ This filter also supports the @ref{framesync} options. >+@@ -14735,23 +14706,31 @@ This filter also supports the @ref{framesync} options. > @subsection Examples > @itemize > @item >@@ -140,7 +143,7 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > @end example > @end itemize > >---- libavfilter/vf_libvmaf.c.orig 2021-10-24 20:47:07 UTC >+--- libavfilter/vf_libvmaf.c.orig 2022-01-14 18:45:40 UTC > +++ libavfilter/vf_libvmaf.c > @@ -24,8 +24,8 @@ > * Calculate the VMAF between two input videos. >@@ -152,7 +155,7 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > #include "libavutil/avstring.h" > #include "libavutil/opt.h" > #include "libavutil/pixdesc.h" >-@@ -39,211 +39,372 @@ >+@@ -39,23 +39,9 @@ > typedef struct LIBVMAFContext { > const AVClass *class; > FFFrameSync fs; >@@ -168,20 +171,18 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > - AVFrame *gmain; > - AVFrame *gref; > - int frame_set; >-- char *model_path; >+ char *model_path; > char *log_path; > char *log_fmt; > - int disable_clip; > - int disable_avx; >-- int enable_transform; >-- int phone_model; >-- int psnr; >-- int ssim; >-- int ms_ssim; >-- char *pool; >+ int enable_transform; >+ int phone_model; >+ int psnr; >+@@ -65,185 +51,483 @@ typedef struct LIBVMAFContext { > int n_threads; > int n_subsample; >-- int enable_conf_interval; >+ int enable_conf_interval; > - int error; > + char *model_cfg; > + char *feature_cfg; >@@ -204,16 +205,21 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > - {"psnr", "Enables computing psnr along with vmaf.", OFFSET(psnr), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS}, > - {"ssim", "Enables computing ssim along with vmaf.", OFFSET(ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS}, > - {"ms_ssim", "Enables computing ms-ssim along with vmaf.", OFFSET(ms_ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS}, >-- {"pool", "Set the pool method to be used for computing vmaf.", OFFSET(pool), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, >-- {"n_threads", "Set number of threads to be used when computing vmaf.", OFFSET(n_threads), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT_MAX, FLAGS}, >-- {"n_subsample", "Set interval for frame subsampling used when computing vmaf.", OFFSET(n_subsample), AV_OPT_TYPE_INT, {.i64=1}, 1, UINT_MAX, FLAGS}, >++ {"model_path", "use model='path=...'.", OFFSET(model_path), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, >++ {"log_path", "Set the file path to be used to write log.", OFFSET(log_path), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, >++ {"log_fmt", "Set the format of the log (csv, json, xml, or sub).", OFFSET(log_fmt), AV_OPT_TYPE_STRING, {.str="xml"}, 0, 1, FLAGS}, >++ {"enable_transform", "use model='enable_transform=true'.", OFFSET(enable_transform), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, >++ {"phone_model", "use model='enable_transform=true'.", OFFSET(phone_model), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, >++ {"psnr", "use feature='name=psnr'.", OFFSET(psnr), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, >++ {"ssim", "use feature='name=ssim'.", OFFSET(ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, >++ {"ms_ssim", "use feature='name=ms_ssim'.", OFFSET(ms_ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, >+ {"pool", "Set the pool method to be used for computing vmaf.", OFFSET(pool), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, >+ {"n_threads", "Set number of threads to be used when computing vmaf.", OFFSET(n_threads), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT_MAX, FLAGS}, >+ {"n_subsample", "Set interval for frame subsampling used when computing vmaf.", OFFSET(n_subsample), AV_OPT_TYPE_INT, {.i64=1}, 1, UINT_MAX, FLAGS}, > - {"enable_conf_interval", "Enables confidence interval.", OFFSET(enable_conf_interval), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS}, >-+ {"model", "Set the model to be used for computing vmaf.", OFFSET(model_cfg), AV_OPT_TYPE_STRING, {.str="version=vmaf_v0.6.1"}, 0, 1, FLAGS}, >-+ {"feature", "Set the feature to be used for computing vmaf.", OFFSET(feature_cfg), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, >-+ {"log_path", "Set the file path to be used to write log.", OFFSET(log_path), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, >-+ {"log_fmt", "Set the format of the log (csv, json, xml, or sub).", OFFSET(log_fmt), AV_OPT_TYPE_STRING, {.str="xml"}, 0, 1, FLAGS}, >-+ {"n_threads", "Set number of threads to be used when computing vmaf.", OFFSET(n_threads), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT_MAX, FLAGS}, >-+ {"n_subsample", "Set interval for frame subsampling used when computing vmaf.", OFFSET(n_subsample), AV_OPT_TYPE_INT, {.i64=1}, 1, UINT_MAX, FLAGS}, >++ {"enable_conf_interval", "Enables confidence interval.", OFFSET(enable_conf_interval), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED}, >++ {"model", "Set the model to be used for computing vmaf.", OFFSET(model_cfg), AV_OPT_TYPE_STRING, {.str="version=vmaf_v0.6.1"}, 0, 1, FLAGS}, >++ {"feature", "Set the feature to be used for computing vmaf.", OFFSET(feature_cfg), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, > { NULL } > }; > >@@ -309,7 +315,8 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > +{ > + int err = vmaf_picture_alloc(dst, pix_fmt_map(src->format), bpc, > + src->width, src->height); >-+ if (err) return AVERROR(ENOMEM); >++ if (err) >++ return AVERROR(ENOMEM); > > -static void compute_vmaf_score(LIBVMAFContext *s) > + for (unsigned i = 0; i < 3; i++) { >@@ -332,6 +339,7 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > - char *format; > + AVFilterContext *ctx = fs->parent; > + LIBVMAFContext *s = ctx->priv; >++ VmafPicture pic_ref, pic_dist; > + AVFrame *ref, *dist; > + int err = 0; > >@@ -345,7 +353,6 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > + if (ctx->is_disabled || !ref) > + return ff_filter_frame(ctx->outputs[0], dist); > + >-+ VmafPicture pic_ref; > + err = copy_picture_data(ref, &pic_ref, s->bpc); > + if (err) { > + av_log(s, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n"); >@@ -353,7 +360,6 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > } > > - format = (char *) s->desc->name; >-+ VmafPicture pic_dist; > + err = copy_picture_data(dist, &pic_dist, s->bpc); > + if (err) { > + av_log(s, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n"); >@@ -387,8 +393,13 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > - pthread_mutex_lock(&s->lock); > - pthread_cond_signal(&s->cond); > - pthread_mutex_unlock(&s->lock); >++ AVDictionary **dict = NULL; >++ char *str_copy = NULL; >++ char *saveptr = NULL; > + int err = 0; >-+ if (!str) return NULL; >++ >++ if (!str) >++ return NULL; > + > + *cnt = 1; > + for (char *p = str; *p; p++) { >@@ -397,17 +408,19 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > } > - pthread_exit(NULL); > + >-+ AVDictionary **dict = av_calloc(*cnt, sizeof(*dict)); >-+ if (!dict) goto fail; >++ dict = av_calloc(*cnt, sizeof(*dict)); >++ if (!dict) >++ goto fail; > + >-+ char *str_copy = av_strdup(str); >-+ if (!str_copy) goto fail; >++ str_copy = av_strdup(str); >++ if (!str_copy) >++ goto fail; > + >-+ char *saveptr = NULL; > + for (unsigned i = 0; i < *cnt; i++) { > + char *s = av_strtok(i == 0 ? str_copy : NULL, "|", &saveptr); > + err = av_dict_parse_string(&dict[i], s, "=", ":", 0); >-+ if (err) goto fail; >++ if (err) >++ goto fail; > + } > + > + av_free(str_copy); >@@ -421,8 +434,8 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > + } > + av_free(dict); > + } >-+ if (str_copy) >-+ av_free(str_copy); >++ >++ av_free(str_copy); > + *cnt = 0; > return NULL; > } >@@ -434,18 +447,20 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > LIBVMAFContext *s = ctx->priv; > - AVFrame *master, *ref; > - int ret; >-+ if (!s->feature_cfg) return 0; >++ AVDictionary **dict = NULL; >++ unsigned dict_cnt; >++ int err = 0; > > - ret = ff_framesync_dualinput_get(fs, &master, &ref); > - if (ret < 0) > - return ret; > - if (!ref) > - return ff_filter_frame(ctx->outputs[0], master); >-+ int err = 0; >++ if (!s->feature_cfg) >++ return 0; > > - pthread_mutex_lock(&s->lock); >-+ unsigned dict_cnt = 0; >-+ AVDictionary **dict = delimited_dict_parse(s->feature_cfg, &dict_cnt); >++ dict = delimited_dict_parse(s->feature_cfg, &dict_cnt); > + if (!dict) { > + av_log(ctx, AV_LOG_ERROR, > + "could not parse feature config: %s\n", s->feature_cfg); >@@ -496,12 +511,14 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > +static int parse_models(AVFilterContext *ctx) > +{ > + LIBVMAFContext *s = ctx->priv; >-+ if (!s->model_cfg) return 0; >-+ >++ AVDictionary **dict; >++ unsigned dict_cnt; > + int err = 0; > + >-+ unsigned dict_cnt = 0; >-+ AVDictionary **dict = delimited_dict_parse(s->model_cfg, &dict_cnt); >++ if (!s->model_cfg) return 0; >++ >++ dict_cnt = 0; >++ dict = delimited_dict_parse(s->model_cfg, &dict_cnt); > + if (!dict) { > av_log(ctx, AV_LOG_ERROR, > - "libvmaf encountered an error, check log for details\n"); >@@ -514,13 +531,15 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > - av_frame_ref(s->gmain, master); > + s->model_cnt = dict_cnt; > + s->model = av_calloc(s->model_cnt, sizeof(*s->model)); >-+ if (!s->model) return AVERROR(ENOMEM); >++ if (!s->model) >++ return AVERROR(ENOMEM); > > - s->frame_set = 1; > + for (unsigned i = 0; i < dict_cnt; i++) { >-+ VmafModelConfig model_cfg = {0}; >++ VmafModelConfig model_cfg = { 0 }; > + AVDictionaryEntry *e = NULL; >-+ char *version, *path; >++ char *version = NULL; >++ char *path = NULL; > > - pthread_cond_signal(&s->cond); > - pthread_mutex_unlock(&s->lock); >@@ -569,7 +588,7 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > + if (err) { > + av_log(ctx, AV_LOG_ERROR, > + "could not load libvmaf model with path: %s\n", >-+ e->value); >++ path); > + goto exit; > + } > + } >@@ -581,13 +600,14 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > + goto exit; > + } > + >-+ e = NULL; > + while (e = av_dict_get(dict[i], "", e, AV_DICT_IGNORE_SUFFIX)) { >++ VmafFeatureDictionary *feature_opts_dict = NULL; > + char *feature_opt = NULL; >++ > + char *feature_name = av_strtok(e->key, ".", &feature_opt); >-+ if (!feature_opt) continue; >++ if (!feature_opt) >++ continue; > + >-+ VmafFeatureDictionary *feature_opts_dict = NULL; > + err = vmaf_feature_dictionary_set(&feature_opts_dict, > + feature_opt, e->value); > + if (err) { >@@ -645,6 +665,92 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > + return VMAF_LOG_LEVEL_INFO; > + } > +} >++ >++static int parse_deprecated_options(AVFilterContext *ctx) >++{ >++ LIBVMAFContext *s = ctx->priv; >++ VmafModel *model = NULL; >++ VmafModelCollection *model_collection = NULL; >++ enum VmafModelFlags flags = VMAF_MODEL_FLAGS_DEFAULT; >++ int err = 0; >++ >++ VmafModelConfig model_cfg = { >++ .name = "vmaf", >++ .flags = flags, >++ }; >++ >++ if (s->enable_transform || s->phone_model) >++ flags |= VMAF_MODEL_FLAG_ENABLE_TRANSFORM; >++ >++ if (!s->model_path) >++ goto extra_metrics_only; >++ >++ if (s->enable_conf_interval) { >++ err = vmaf_model_collection_load_from_path(&model, &model_collection, >++ &model_cfg, s->model_path); >++ if (err) { >++ av_log(ctx, AV_LOG_ERROR, >++ "problem loading model file: %s\n", s->model_path); >++ goto exit; >++ } >++ >++ err = vmaf_use_features_from_model_collection(s->vmaf, model_collection); >++ if (err) { >++ av_log(ctx, AV_LOG_ERROR, >++ "problem loading feature extractors from model file: %s\n", >++ s->model_path); >++ goto exit; >++ } >++ } else { >++ err = vmaf_model_load_from_path(&model, &model_cfg, s->model_path); >++ if (err) { >++ av_log(ctx, AV_LOG_ERROR, >++ "problem loading model file: %s\n", s->model_path); >++ goto exit; >++ } >++ err = vmaf_use_features_from_model(s->vmaf, model); >++ if (err) { >++ av_log(ctx, AV_LOG_ERROR, >++ "problem loading feature extractors from model file: %s\n", >++ s->model_path); >++ goto exit; >++ } >++ } >++ >++extra_metrics_only: >++ if (s->psnr) { >++ VmafFeatureDictionary *d = NULL; >++ vmaf_feature_dictionary_set(&d, "enable_chroma", "false"); >++ >++ err = vmaf_use_feature(s->vmaf, "psnr", d); >++ if (err) { >++ av_log(ctx, AV_LOG_ERROR, >++ "problem loading feature extractor: psnr\n"); >++ goto exit; >++ } >++ } >++ >++ if (s->ssim) { >++ err = vmaf_use_feature(s->vmaf, "float_ssim", NULL); >++ if (err) { >++ av_log(ctx, AV_LOG_ERROR, >++ "problem loading feature extractor: ssim\n"); >++ goto exit; >++ } >++ } >++ >++ if (s->ms_ssim) { >++ err = vmaf_use_feature(s->vmaf, "float_ms_ssim", NULL); >++ if (err) { >++ av_log(ctx, AV_LOG_ERROR, >++ "problem loading feature extractor: ms_ssim\n"); >++ goto exit; >++ } >++ } >++ >++exit: >++ return err; >++} > + > static av_cold int init(AVFilterContext *ctx) > { >@@ -663,84 +769,75 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > > - s->error = 0; > + err = vmaf_init(&s->vmaf, cfg); >-+ if (err) return AVERROR(EINVAL); >++ if (err) >++ return AVERROR(EINVAL); > > - s->vmaf_thread_created = 0; > - pthread_mutex_init(&s->lock, NULL); > - pthread_cond_init (&s->cond, NULL); >-+ err = parse_models(ctx); >-+ if (err) return err; >++ err = parse_deprecated_options(ctx); >++ if (err) >++ return err; > >++ err = parse_models(ctx); >++ if (err) >++ return err; >++ > + err = parse_features(ctx); >-+ if (err) return err; >++ if (err) >++ return err; > + > s->fs.on_event = do_vmaf; > return 0; > } >-@@ -251,8 +412,9 @@ static av_cold int init(AVFilterContext *ctx) >- static int query_formats(AVFilterContext *ctx) >- { >- static const enum AVPixelFormat pix_fmts[] = { >-- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, >-- AV_PIX_FMT_YUV444P10LE, AV_PIX_FMT_YUV422P10LE, AV_PIX_FMT_YUV420P10LE, >-+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16LE, >-+ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P16LE, >-+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P16LE, >- AV_PIX_FMT_NONE >- }; >- >-@@ -262,33 +424,32 @@ static int query_formats(AVFilterContext *ctx) >- return ff_set_common_formats(ctx, fmts_list); >- } >+@@ -256,27 +540,32 @@ static const enum AVPixelFormat pix_fmts[] = { > >-- > static int config_input_ref(AVFilterLink *inlink) > { > - AVFilterContext *ctx = inlink->dst; > + AVFilterContext *ctx = inlink->dst; > LIBVMAFContext *s = ctx->priv; > - int th; >++ const AVPixFmtDescriptor *desc; >++ int err = 0; > > - if (ctx->inputs[0]->w != ctx->inputs[1]->w || > - ctx->inputs[0]->h != ctx->inputs[1]->h) { > - av_log(ctx, AV_LOG_ERROR, "Width and height of input videos must be same.\n"); > - return AVERROR(EINVAL); >-+ int err = 0; >-+ > + if (ctx->inputs[0]->w != ctx->inputs[1]->w) { > + av_log(ctx, AV_LOG_ERROR, "input width must match.\n"); >-+ err |= AVERROR(EINVAL); >- } >-+ >-+ if (ctx->inputs[0]->h != ctx->inputs[1]->h) { >-+ av_log(ctx, AV_LOG_ERROR, "input height must match.\n"); >-+ err |= AVERROR(EINVAL); >-+ } >-+ >- if (ctx->inputs[0]->format != ctx->inputs[1]->format) { >-- av_log(ctx, AV_LOG_ERROR, "Inputs must be of same pixel format.\n"); >-- return AVERROR(EINVAL); >-+ av_log(ctx, AV_LOG_ERROR, "input pix_fmt must match.\n"); > + err |= AVERROR(EINVAL); > } > > - s->desc = av_pix_fmt_desc_get(inlink->format); > - s->width = ctx->inputs[0]->w; > - s->height = ctx->inputs[0]->h; >-+ if (err) return err; >++ if (ctx->inputs[0]->h != ctx->inputs[1]->h) { >++ av_log(ctx, AV_LOG_ERROR, "input height must match.\n"); >++ err |= AVERROR(EINVAL); >++ } > > - th = pthread_create(&s->vmaf_thread, NULL, call_vmaf, (void *) s); > - if (th) { > - av_log(ctx, AV_LOG_ERROR, "Thread creation failed.\n"); > - return AVERROR(EINVAL); >-- } >++ if (ctx->inputs[0]->format != ctx->inputs[1]->format) { >++ av_log(ctx, AV_LOG_ERROR, "input pix_fmt must match.\n"); >++ err |= AVERROR(EINVAL); >+ } > - s->vmaf_thread_created = 1; >-+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); >-+ s->bpc = desc->comp[0].depth; > >++ if (err) >++ return err; >++ >++ desc = av_pix_fmt_desc_get(inlink->format); >++ s->bpc = desc->comp[0].depth; >++ > return 0; > } >-@@ -320,35 +481,72 @@ static int activate(AVFilterContext *ctx) >+ >+@@ -307,28 +596,76 @@ static int activate(AVFilterContext *ctx) > return ff_framesync_activate(&s->fs); > } > >@@ -757,20 +854,32 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > + > + return VMAF_OUTPUT_FORMAT_XML; > +} >++ >++static enum VmafPoolingMethod pool_method_map(const char *pool_method) >++{ >++ if (av_stristr(pool_method, "min")) >++ return VMAF_POOL_METHOD_MIN; >++ if (av_stristr(pool_method, "mean")) >++ return VMAF_POOL_METHOD_MEAN; >++ if (av_stristr(pool_method, "harmonic_mean")) >++ return VMAF_POOL_METHOD_HARMONIC_MEAN; >++ >++ return VMAF_POOL_METHOD_MEAN; >++} > + > static av_cold void uninit(AVFilterContext *ctx) > { > LIBVMAFContext *s = ctx->priv; >- > + int err = 0; >-+ >+ > ff_framesync_uninit(&s->fs); > > - pthread_mutex_lock(&s->lock); > - s->eof = 1; > - pthread_cond_signal(&s->cond); > - pthread_mutex_unlock(&s->lock); >-+ if (!s->frame_cnt) goto clean_up; >++ if (!s->frame_cnt) >++ goto clean_up; > > - if (s->vmaf_thread_created) > - { >@@ -786,7 +895,7 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > - av_frame_free(&s->gmain); > + for (unsigned i = 0; i < s->model_cnt; i++) { > + double vmaf_score; >-+ err = vmaf_score_pooled(s->vmaf, s->model[i], VMAF_POOL_METHOD_MEAN, >++ err = vmaf_score_pooled(s->vmaf, s->model[i], pool_method_map(s->pool), > + &vmaf_score, 0, s->frame_cnt - 1); > + if (err) { > + av_log(ctx, AV_LOG_ERROR, >@@ -817,12 +926,3 @@ https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281878.html > } > > static const AVFilterPad libvmaf_inputs[] = { >- { >- .name = "main", >- .type = AVMEDIA_TYPE_VIDEO, >-- },{ >-+ }, >-+ { >- .name = "reference", >- .type = AVMEDIA_TYPE_VIDEO, >- .config_props = config_input_ref, >diff --git a/multimedia/ffmpeg/pkg-plist b/multimedia/ffmpeg/pkg-plist >index 6f5f8c0b8db6..a77b28a050e2 100644 >--- a/multimedia/ffmpeg/pkg-plist >+++ b/multimedia/ffmpeg/pkg-plist >@@ -12,6 +12,7 @@ include/libavcodec/codec_desc.h > include/libavcodec/codec_id.h > include/libavcodec/codec_par.h > include/libavcodec/d3d11va.h >+include/libavcodec/defs.h > include/libavcodec/dirac.h > include/libavcodec/dv_profile.h > include/libavcodec/dxva2.h >@@ -19,7 +20,6 @@ include/libavcodec/jni.h > include/libavcodec/mediacodec.h > include/libavcodec/packet.h > include/libavcodec/qsv.h >-include/libavcodec/vaapi.h > include/libavcodec/vdpau.h > include/libavcodec/version.h > include/libavcodec/videotoolbox.h >@@ -34,8 +34,6 @@ include/libavfilter/version.h > include/libavformat/avformat.h > include/libavformat/avio.h > include/libavformat/version.h >-include/libavresample/avresample.h >-include/libavresample/version.h > include/libavutil/adler32.h > include/libavutil/aes.h > include/libavutil/aes_ctr.h >@@ -57,6 +55,7 @@ include/libavutil/common.h > include/libavutil/cpu.h > include/libavutil/crc.h > include/libavutil/des.h >+include/libavutil/detection_bbox.h > include/libavutil/dict.h > include/libavutil/display.h > include/libavutil/dovi_meta.h >@@ -130,37 +129,33 @@ include/libswresample/version.h > include/libswscale/swscale.h > include/libswscale/version.h > lib/libavcodec.so >-lib/libavcodec.so.58 >-lib/libavcodec.so.58.134.100 >+lib/libavcodec.so.59 >+lib/libavcodec.so.59.18.100 > lib/libavdevice.so >-lib/libavdevice.so.58 >-lib/libavdevice.so.58.13.100 >+lib/libavdevice.so.59 >+lib/libavdevice.so.59.4.100 > lib/libavfilter.so >-lib/libavfilter.so.7 >-lib/libavfilter.so.7.110.100 >+lib/libavfilter.so.8 >+lib/libavfilter.so.8.24.100 > lib/libavformat.so >-lib/libavformat.so.58 >-lib/libavformat.so.58.76.100 >-lib/libavresample.so >-lib/libavresample.so.4 >-lib/libavresample.so.4.0.0 >+lib/libavformat.so.59 >+lib/libavformat.so.59.16.100 > lib/libavutil.so >-lib/libavutil.so.56 >-lib/libavutil.so.56.70.100 >+lib/libavutil.so.57 >+lib/libavutil.so.57.17.100 > lib/libpostproc.so >-lib/libpostproc.so.55 >-lib/libpostproc.so.55.9.100 >+lib/libpostproc.so.56 >+lib/libpostproc.so.56.3.100 > lib/libswresample.so >-lib/libswresample.so.3 >-lib/libswresample.so.3.9.100 >+lib/libswresample.so.4 >+lib/libswresample.so.4.3.100 > lib/libswscale.so >-lib/libswscale.so.5 >-lib/libswscale.so.5.9.100 >+lib/libswscale.so.6 >+lib/libswscale.so.6.4.100 > libdata/pkgconfig/libavcodec.pc > libdata/pkgconfig/libavdevice.pc > libdata/pkgconfig/libavfilter.pc > libdata/pkgconfig/libavformat.pc >-libdata/pkgconfig/libavresample.pc > libdata/pkgconfig/libavutil.pc > libdata/pkgconfig/libpostproc.pc > libdata/pkgconfig/libswresample.pc
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 261302
:
231123
|
232276
|
232765
|
233207
|
233428
|
234023
|
235680
|
235729
|
235731
|
235805
|
236550
|
237100
|
237192
|
237463
|
239307
|
239460
|
239461
|
239469
|
240656
|
240658
|
241448
|
241531
|
241793