diff options
author | Adel KARA SLIMANE <adel.ks@zegrapher.com> | 2022-03-14 11:09:52 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-03-16 22:33:30 +0000 |
commit | 6ad2b615f414edd77c02ee9ce9c942687b0aaf70 (patch) | |
tree | f2451515321fa0e44b928321e069035a90c5a2ec /media-video/ffmpeg | |
parent | media-libs/libvmaf: new package (diff) | |
download | gentoo-6ad2b615f414edd77c02ee9ce9c942687b0aaf70.tar.gz gentoo-6ad2b615f414edd77c02ee9ce9c942687b0aaf70.tar.bz2 gentoo-6ad2b615f414edd77c02ee9ce9c942687b0aaf70.zip |
media-video/ffmpeg: enable vmaf use flag
To use Netflix' vmaf scoring algorithm
Signed-off-by: Adel KARA SLIMANE <adel.ks@zegrapher.com>
Closes: https://github.com/gentoo/gentoo/pull/23412
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-video/ffmpeg')
-rw-r--r-- | media-video/ffmpeg/ffmpeg-4.4.1-r3.ebuild (renamed from media-video/ffmpeg/ffmpeg-4.4.1-r2.ebuild) | 6 | ||||
-rw-r--r-- | media-video/ffmpeg/ffmpeg-5.0-r1.ebuild (renamed from media-video/ffmpeg/ffmpeg-5.0.ebuild) | 6 | ||||
-rw-r--r-- | media-video/ffmpeg/ffmpeg-9999.ebuild | 6 | ||||
-rw-r--r-- | media-video/ffmpeg/files/vmaf-models-default-path.patch | 13 | ||||
-rw-r--r-- | media-video/ffmpeg/metadata.xml | 1 |
5 files changed, 29 insertions, 3 deletions
diff --git a/media-video/ffmpeg/ffmpeg-4.4.1-r2.ebuild b/media-video/ffmpeg/ffmpeg-4.4.1-r3.ebuild index 0650f5458c0e..2c8dc26e3f13 100644 --- a/media-video/ffmpeg/ffmpeg-4.4.1-r2.ebuild +++ b/media-video/ffmpeg/ffmpeg-4.4.1-r3.ebuild @@ -84,7 +84,7 @@ FFMPEG_FLAG_MAP=( vorbis:libvorbis vpx:libvpx zvbi:libzvbi # libavfilter options appkit - bs2b:libbs2b chromaprint cuda:cuda-llvm flite:libflite frei0r + bs2b:libbs2b chromaprint cuda:cuda-llvm flite:libflite frei0r vmaf:libvmaf fribidi:libfribidi fontconfig ladspa libass libtesseract lv2 truetype:libfreetype vidstab:libvidstab rubberband:librubberband zeromq:libzmq zimg:libzimg # libswresample options @@ -255,6 +255,7 @@ RDEPEND=" nvenc? ( >=media-libs/nv-codec-headers-9.1.23.1[${MULTILIB_USEDEP}] ) vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] ) vidstab? ( >=media-libs/vidstab-1.1.0[${MULTILIB_USEDEP}] ) + vmaf? ( media-libs/libvmaf[${MULTILIB_USEDEP}] ) vorbis? ( >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}] >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}] @@ -338,6 +339,9 @@ src_prepare() { if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot export revision=git-N-${FFMPEG_REVISION} fi + + eapply "${FILESDIR}/vmaf-models-default-path.patch" + default echo 'include $(SRC_PATH)/ffbuild/libffmpeg.mak' >> Makefile || die } diff --git a/media-video/ffmpeg/ffmpeg-5.0.ebuild b/media-video/ffmpeg/ffmpeg-5.0-r1.ebuild index b6c059f58997..a818aa4782dc 100644 --- a/media-video/ffmpeg/ffmpeg-5.0.ebuild +++ b/media-video/ffmpeg/ffmpeg-5.0-r1.ebuild @@ -84,7 +84,7 @@ FFMPEG_FLAG_MAP=( vorbis:libvorbis vpx:libvpx zvbi:libzvbi # libavfilter options appkit - bs2b:libbs2b chromaprint cuda:cuda-llvm flite:libflite frei0r + bs2b:libbs2b chromaprint cuda:cuda-llvm flite:libflite frei0r vmaf:libvmaf fribidi:libfribidi fontconfig ladspa libass libtesseract lv2 truetype:libfreetype vidstab:libvidstab rubberband:librubberband zeromq:libzmq zimg:libzimg # libswresample options @@ -255,6 +255,7 @@ RDEPEND=" nvenc? ( >=media-libs/nv-codec-headers-9.1.23.1[${MULTILIB_USEDEP}] ) vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] ) vidstab? ( >=media-libs/vidstab-1.1.0[${MULTILIB_USEDEP}] ) + vmaf? ( media-libs/libvmaf[${MULTILIB_USEDEP}] ) vorbis? ( >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}] >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}] @@ -337,6 +338,9 @@ src_prepare() { if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot export revision=git-N-${FFMPEG_REVISION} fi + + eapply "${FILESDIR}/vmaf-models-default-path.patch" + default echo 'include $(SRC_PATH)/ffbuild/libffmpeg.mak' >> Makefile || die } diff --git a/media-video/ffmpeg/ffmpeg-9999.ebuild b/media-video/ffmpeg/ffmpeg-9999.ebuild index f1ded0aea4a0..1f70d55ec169 100644 --- a/media-video/ffmpeg/ffmpeg-9999.ebuild +++ b/media-video/ffmpeg/ffmpeg-9999.ebuild @@ -84,7 +84,7 @@ FFMPEG_FLAG_MAP=( vorbis:libvorbis vpx:libvpx zvbi:libzvbi # libavfilter options appkit - bs2b:libbs2b chromaprint cuda:cuda-llvm flite:libflite frei0r + bs2b:libbs2b chromaprint cuda:cuda-llvm flite:libflite frei0r vmaf:libvmaf fribidi:libfribidi fontconfig ladspa libass libtesseract lv2 truetype:libfreetype vidstab:libvidstab rubberband:librubberband zeromq:libzmq zimg:libzimg # libswresample options @@ -255,6 +255,7 @@ RDEPEND=" nvenc? ( >=media-libs/nv-codec-headers-9.1.23.1[${MULTILIB_USEDEP}] ) vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] ) vidstab? ( >=media-libs/vidstab-1.1.0[${MULTILIB_USEDEP}] ) + vmaf? ( media-libs/libvmaf[${MULTILIB_USEDEP}] ) vorbis? ( >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}] >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}] @@ -337,6 +338,9 @@ src_prepare() { if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot export revision=git-N-${FFMPEG_REVISION} fi + + eapply "${FILESDIR}/vmaf-models-default-path.patch" + default echo 'include $(SRC_PATH)/ffbuild/libffmpeg.mak' >> Makefile || die } diff --git a/media-video/ffmpeg/files/vmaf-models-default-path.patch b/media-video/ffmpeg/files/vmaf-models-default-path.patch new file mode 100644 index 000000000000..a9777e94b7aa --- /dev/null +++ b/media-video/ffmpeg/files/vmaf-models-default-path.patch @@ -0,0 +1,13 @@ +Put default path of models to /usr/share/vmaf/model + +--- a/libavfilter/vf_libvmaf.c ++++ b/libavfilter/vf_libvmaf.c +@@ -72,7 +72,7 @@ typedef struct LIBVMAFContext { + #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + + static const AVOption libvmaf_options[] = { +- {"model_path", "Set the model to be used for computing vmaf.", OFFSET(model_path), AV_OPT_TYPE_STRING, {.str="/usr/local/share/model/vmaf_v0.6.1.pkl"}, 0, 1, FLAGS}, ++ {"model_path", "Set the model to be used for computing vmaf.", OFFSET(model_path), AV_OPT_TYPE_STRING, {.str="/usr/share/vmaf/model/vmaf_v0.6.1.json"}, 0, 1, FLAGS}, + {"log_path", "Set the file path to be used to store logs.", OFFSET(log_path), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, + {"log_fmt", "Set the format of the log (xml or json).", OFFSET(log_fmt), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, + {"enable_transform", "Enables transform for computing vmaf.", OFFSET(enable_transform), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS}, diff --git a/media-video/ffmpeg/metadata.xml b/media-video/ffmpeg/metadata.xml index 2f0738126047..c07905a8339b 100644 --- a/media-video/ffmpeg/metadata.xml +++ b/media-video/ffmpeg/metadata.xml @@ -57,6 +57,7 @@ <flag name="svt-av1">Enables AV1 encoding support via <pkg>media-libs/svt-av1</pkg>.</flag> <flag name="twolame">Enables MP2 encoding via <pkg>media-sound/twolame</pkg> as an alternative to the internal encoder.</flag> <flag name="vidstab">Enables video stabilization filter using vid.stab library (<pkg>media-libs/vidstab</pkg>).</flag> + <flag name="vmaf">Enables Netflix's perceptual video quality assessment filter using the library (<pkg>media-libs/libvmaf</pkg>).</flag> <flag name="vpx">Enables VP8 and VP9 codec support using libvpx: Decoding does not require this to be enabled but libvpx can also be used for decoding; encoding requires this useflag to be enabled though.</flag> <flag name="vulkan">Enables support for the vulkan API for GPU offload.</flag> <flag name="x265">Enables HEVC encoding with <pkg>media-libs/x265</pkg>.</flag> |