commit 70ff4cff1c38d542fd3ed705847e3311b0f9bba3 Author: Danny Rawlins <contact@romster.me> Date: Sat Feb 19 19:48:31 2022 +1100 [notify] ffmpeg: 4.4.1 -> 5.0 version 5.x, if you need support for older ffmpeg there is contrib/ffmpeg4 that can be installed alongside opt/ffmpeg diff --git a/ffmpeg/.footprint b/ffmpeg/.footprint index 2de828023..3f3ea3139 100644 --- a/ffmpeg/.footprint +++ b/ffmpeg/.footprint @@ -15,6 +15,7 @@ drwxr-xr-x root/root usr/include/libavcodec/ -rw-r--r-- root/root usr/include/libavcodec/codec_id.h -rw-r--r-- root/root usr/include/libavcodec/codec_par.h -rw-r--r-- root/root usr/include/libavcodec/d3d11va.h +-rw-r--r-- root/root usr/include/libavcodec/defs.h -rw-r--r-- root/root usr/include/libavcodec/dirac.h -rw-r--r-- root/root usr/include/libavcodec/dv_profile.h -rw-r--r-- root/root usr/include/libavcodec/dxva2.h @@ -22,7 +23,6 @@ drwxr-xr-x root/root usr/include/libavcodec/ -rw-r--r-- root/root usr/include/libavcodec/mediacodec.h -rw-r--r-- root/root usr/include/libavcodec/packet.h -rw-r--r-- root/root usr/include/libavcodec/qsv.h --rw-r--r-- root/root usr/include/libavcodec/vaapi.h -rw-r--r-- root/root usr/include/libavcodec/vdpau.h -rw-r--r-- root/root usr/include/libavcodec/version.h -rw-r--r-- root/root usr/include/libavcodec/videotoolbox.h @@ -40,9 +40,6 @@ drwxr-xr-x root/root usr/include/libavformat/ -rw-r--r-- root/root usr/include/libavformat/avformat.h -rw-r--r-- root/root usr/include/libavformat/avio.h -rw-r--r-- root/root usr/include/libavformat/version.h -drwxr-xr-x root/root usr/include/libavresample/ --rw-r--r-- root/root usr/include/libavresample/avresample.h --rw-r--r-- root/root usr/include/libavresample/version.h drwxr-xr-x root/root usr/include/libavutil/ -rw-r--r-- root/root usr/include/libavutil/adler32.h -rw-r--r-- root/root usr/include/libavutil/aes.h @@ -65,6 +62,7 @@ drwxr-xr-x root/root usr/include/libavutil/ -rw-r--r-- root/root usr/include/libavutil/cpu.h -rw-r--r-- root/root usr/include/libavutil/crc.h -rw-r--r-- root/root usr/include/libavutil/des.h +-rw-r--r-- root/root usr/include/libavutil/detection_bbox.h -rw-r--r-- root/root usr/include/libavutil/dict.h -rw-r--r-- root/root usr/include/libavutil/display.h -rw-r--r-- root/root usr/include/libavutil/dovi_meta.h @@ -142,47 +140,42 @@ drwxr-xr-x root/root usr/include/libswscale/ -rw-r--r-- root/root usr/include/libswscale/version.h drwxr-xr-x root/root usr/lib/ -rw-r--r-- root/root usr/lib/libavcodec.a -lrwxrwxrwx root/root usr/lib/libavcodec.so -> libavcodec.so.58.134.100 -lrwxrwxrwx root/root usr/lib/libavcodec.so.58 -> libavcodec.so.58.134.100 --rwxr-xr-x root/root usr/lib/libavcodec.so.58.134.100 +lrwxrwxrwx root/root usr/lib/libavcodec.so -> libavcodec.so.59.18.100 +lrwxrwxrwx root/root usr/lib/libavcodec.so.59 -> libavcodec.so.59.18.100 +-rwxr-xr-x root/root usr/lib/libavcodec.so.59.18.100 -rw-r--r-- root/root usr/lib/libavdevice.a -lrwxrwxrwx root/root usr/lib/libavdevice.so -> libavdevice.so.58.13.100 -lrwxrwxrwx root/root usr/lib/libavdevice.so.58 -> libavdevice.so.58.13.100 --rwxr-xr-x root/root usr/lib/libavdevice.so.58.13.100 +lrwxrwxrwx root/root usr/lib/libavdevice.so -> libavdevice.so.59.4.100 +lrwxrwxrwx root/root usr/lib/libavdevice.so.59 -> libavdevice.so.59.4.100 +-rwxr-xr-x root/root usr/lib/libavdevice.so.59.4.100 -rw-r--r-- root/root usr/lib/libavfilter.a -lrwxrwxrwx root/root usr/lib/libavfilter.so -> libavfilter.so.7.110.100 -lrwxrwxrwx root/root usr/lib/libavfilter.so.7 -> libavfilter.so.7.110.100 --rwxr-xr-x root/root usr/lib/libavfilter.so.7.110.100 +lrwxrwxrwx root/root usr/lib/libavfilter.so -> libavfilter.so.8.24.100 +lrwxrwxrwx root/root usr/lib/libavfilter.so.8 -> libavfilter.so.8.24.100 +-rwxr-xr-x root/root usr/lib/libavfilter.so.8.24.100 -rw-r--r-- root/root usr/lib/libavformat.a -lrwxrwxrwx root/root usr/lib/libavformat.so -> libavformat.so.58.76.100 -lrwxrwxrwx root/root usr/lib/libavformat.so.58 -> libavformat.so.58.76.100 --rwxr-xr-x root/root usr/lib/libavformat.so.58.76.100 --rw-r--r-- root/root usr/lib/libavresample.a -lrwxrwxrwx root/root usr/lib/libavresample.so -> libavresample.so.4.0.0 -lrwxrwxrwx root/root usr/lib/libavresample.so.4 -> libavresample.so.4.0.0 --rwxr-xr-x root/root usr/lib/libavresample.so.4.0.0 +lrwxrwxrwx root/root usr/lib/libavformat.so -> libavformat.so.59.16.100 +lrwxrwxrwx root/root usr/lib/libavformat.so.59 -> libavformat.so.59.16.100 +-rwxr-xr-x root/root usr/lib/libavformat.so.59.16.100 -rw-r--r-- root/root usr/lib/libavutil.a -lrwxrwxrwx root/root usr/lib/libavutil.so -> libavutil.so.56.70.100 -lrwxrwxrwx root/root usr/lib/libavutil.so.56 -> libavutil.so.56.70.100 --rwxr-xr-x root/root usr/lib/libavutil.so.56.70.100 +lrwxrwxrwx root/root usr/lib/libavutil.so -> libavutil.so.57.17.100 +lrwxrwxrwx root/root usr/lib/libavutil.so.57 -> libavutil.so.57.17.100 +-rwxr-xr-x root/root usr/lib/libavutil.so.57.17.100 -rw-r--r-- root/root usr/lib/libpostproc.a -lrwxrwxrwx root/root usr/lib/libpostproc.so -> libpostproc.so.55.9.100 -lrwxrwxrwx root/root usr/lib/libpostproc.so.55 -> libpostproc.so.55.9.100 --rwxr-xr-x root/root usr/lib/libpostproc.so.55.9.100 +lrwxrwxrwx root/root usr/lib/libpostproc.so -> libpostproc.so.56.3.100 +lrwxrwxrwx root/root usr/lib/libpostproc.so.56 -> libpostproc.so.56.3.100 +-rwxr-xr-x root/root usr/lib/libpostproc.so.56.3.100 -rw-r--r-- root/root usr/lib/libswresample.a -lrwxrwxrwx root/root usr/lib/libswresample.so -> libswresample.so.3.9.100 -lrwxrwxrwx root/root usr/lib/libswresample.so.3 -> libswresample.so.3.9.100 --rwxr-xr-x root/root usr/lib/libswresample.so.3.9.100 +lrwxrwxrwx root/root usr/lib/libswresample.so -> libswresample.so.4.3.100 +lrwxrwxrwx root/root usr/lib/libswresample.so.4 -> libswresample.so.4.3.100 +-rwxr-xr-x root/root usr/lib/libswresample.so.4.3.100 -rw-r--r-- root/root usr/lib/libswscale.a -lrwxrwxrwx root/root usr/lib/libswscale.so -> libswscale.so.5.9.100 -lrwxrwxrwx root/root usr/lib/libswscale.so.5 -> libswscale.so.5.9.100 --rwxr-xr-x root/root usr/lib/libswscale.so.5.9.100 +lrwxrwxrwx root/root usr/lib/libswscale.so -> libswscale.so.6.4.100 +lrwxrwxrwx root/root usr/lib/libswscale.so.6 -> libswscale.so.6.4.100 +-rwxr-xr-x root/root usr/lib/libswscale.so.6.4.100 drwxr-xr-x root/root usr/lib/pkgconfig/ -rw-r--r-- root/root usr/lib/pkgconfig/libavcodec.pc -rw-r--r-- root/root usr/lib/pkgconfig/libavdevice.pc -rw-r--r-- root/root usr/lib/pkgconfig/libavfilter.pc -rw-r--r-- root/root usr/lib/pkgconfig/libavformat.pc --rw-r--r-- root/root usr/lib/pkgconfig/libavresample.pc -rw-r--r-- root/root usr/lib/pkgconfig/libavutil.pc -rw-r--r-- root/root usr/lib/pkgconfig/libpostproc.pc -rw-r--r-- root/root usr/lib/pkgconfig/libswresample.pc diff --git a/ffmpeg/.signature b/ffmpeg/.signature index d349dc43d..f8d7cd217 100644 --- a/ffmpeg/.signature +++ b/ffmpeg/.signature @@ -1,7 +1,8 @@ untrusted comment: verify with /etc/ports/opt.pub -RWSE3ohX2g5d/X3jrAnWOI4FJawtpcAMwXK6NXB+yRNK93e/hYuZ0ZOcaJcqDEK/NJU7vxENbN7attAp7OAQHLlaJaxbgRJycws= -SHA256 (Pkgfile) = aaabe961df2932961483370f07b27f2524eb0035892129b15039456319576934 -SHA256 (.footprint) = 1738e69565d5f2a7df346ad944b1476269c9d635e3a8368d55575d77477fea7d -SHA256 (ffmpeg-4.4.1.tar.bz2) = 8fc9f20ac5ed95115a9e285647add0eedd5cc1a98a039ada14c132452f98ac42 +RWSE3ohX2g5d/V/vxDpqQUuzY89HCog47GFqkuVvDlLIy5qATJR8R3TTv0NrVulrsuueqcfRDzDJOxE8XiaGrSDAv+Knp3Vp9gs= +SHA256 (Pkgfile) = 0784ecece44a5384f45714036d17554e87d5e38f73cf4a9ab3d33c4c744a4777 +SHA256 (.footprint) = 06e32249d28bb0ac16dc915a77d20353bed90a70a05410213cebba459fbddd23 +SHA256 (ffmpeg-5.0.tar.bz2) = c0130b8db2c763430fd1c6905288d61bc44ee0548ad5fcd2dfd650b88432bed9 SHA256 (ffmpeg-x264-10bit.sh) = dde9627c41800235fbcfe0f74d2181be96239a82cd2d0d277715dddb57eb9cb3 -SHA256 (CVE-2018-6621.patch) = e3b9aff1fe9aef2d7153d7517f9c349beef27c2859bf1fb01076eeab263a445e +SHA256 (vmaf-model-path.patch) = 8dff51f84a5f7460f8893f0514812f5d2bd668c3276ef7ab7713c99b71d7bd8d +SHA256 (add-av_stream_get_first_dts-for-chromium.patch) = 91973c465f01446a999f278f0c2a3763304994dba1ac35de0e4c72f12f39409e diff --git a/ffmpeg/CVE-2018-6621.patch b/ffmpeg/CVE-2018-6621.patch deleted file mode 100644 index 8c9e4dd0e..000000000 --- a/ffmpeg/CVE-2018-6621.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libavcodec/utvideodec.c 2017-12-11 05:35:09.000000000 +0800 -+++ b/libavcodec/utvideodec.c 2018-02-06 15:54:54.872000000 +0800 -@@ -561,7 +561,7 @@ static int decode_frame(AVCodecContext * - for (j = 0; j < c->slices; j++) { - slice_end = bytestream2_get_le32u(&gb); - if (slice_end < 0 || slice_end < slice_start || -- bytestream2_get_bytes_left(&gb) < slice_end) { -+ bytestream2_get_bytes_left(&gb) < slice_end + 1024LL) { - av_log(avctx, AV_LOG_ERROR, "Incorrect slice size\n"); - return AVERROR_INVALIDDATA; - } diff --git a/ffmpeg/Pkgfile b/ffmpeg/Pkgfile index 955a76a6e..69a0d421c 100644 --- a/ffmpeg/Pkgfile +++ b/ffmpeg/Pkgfile @@ -5,21 +5,27 @@ # Optional: alsa-lib cuda dav1d fdk-aac nv-codec-headers gnutls gsm jack jack-audio-connection-kit lame libass libsdl2 libtheora libva libvdpau libvorbis libvpx libwebp opus pulseaudio x264 x265 name=ffmpeg -version=4.4.1 +version=5.0 release=1 source=(https://ffmpeg.org/releases/$name-$version.tar.bz2 ffmpeg-x264-10bit.sh - CVE-2018-6621.patch) + vmaf-model-path.patch + add-av_stream_get_first_dts-for-chromium.patch) build() { cd $name-$version - #https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6621 - patch -p1 -i $SRC/CVE-2018-6621.patch + patch -p1 -i $SRC/vmaf-model-path.patch + + # https://crbug.com/1251779 + patch -p1 -i $SRC/add-av_stream_get_first_dts-for-chromium.patch + +[[ -e '/usr/bin/clang' && -e '/usr/lib/pkgconfig/cuda.pc' && -e '/usr/share/pkgconfig/ffnvcodec.pc' ]] && \ + PKGMK_FFMPEG+=' --enable-cuda-llvm --enable-nonfree --enable-cuda-nvcc --enable-libnpp' && \ + PKGMK_FFMPEG+=' --extra-cflags=-I/opt/cuda/include --extra-ldflags=-L/opt/cuda/lib64' && PATH="$PATH:/opt/cuda/bin" [ -e '/usr/share/pkgconfig/ffnvcodec.pc' ] && PKGMK_FFMPEG+=' --enable-nvdec --enable-nvenc' [ -e '/usr/include/AMF/core/VulkanAMF.h' ] && PKGMK_FFMPEG+=' --enable-amf' -[ -e '/usr/bin/clang' ] && [ -e '/usr/lib/pkgconfig/cuda.pc' ] && PKGMK_FFMPEG+=' --enable-cuda-llvm' [ -e '/usr/lib/pkgconfig/libwebp.pc' ] && PKGMK_FFMPEG+=' --enable-libwebp' [ -e '/usr/lib/pkgconfig/vdpau.pc' ] && PKGMK_FFMPEG+=' --enable-vdpau' [ -e '/usr/lib/pkgconfig/freetype2.pc' ] && PKGMK_FFMPEG+=' --enable-libfreetype' @@ -55,8 +61,7 @@ build() { --enable-avfilter \ --enable-postproc \ --enable-pthreads \ - --enable-swresample \ - --enable-avresample + --enable-swresample make make DESTDIR=$PKG install install-man diff --git a/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch b/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch new file mode 100644 index 000000000..fb5589800 --- /dev/null +++ b/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch @@ -0,0 +1,44 @@ +From 95aab0fd83619408995720ce53d7a74790580220 Mon Sep 17 00:00:00 2001 +From: "liberato@chromium.org" <liberato@chromium.org> +Date: Wed, 7 Jul 2021 19:01:22 -0700 +Subject: [PATCH] Add av_stream_get_first_dts for Chromium + +[foutrelis: adjust for new FFStream struct replacing AVStreamInternal] +--- + libavformat/avformat.h | 4 ++++ + libavformat/utils.c | 7 +++++++ + 2 files changed, 11 insertions(+) + +diff --git a/libavformat/avformat.h b/libavformat/avformat.h +index cd7b0d941c..b4a6dce885 100644 +--- a/libavformat/avformat.h ++++ b/libavformat/avformat.h +@@ -1010,6 +1010,10 @@ struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); + */ + int64_t av_stream_get_end_pts(const AVStream *st); + ++// Chromium: We use the internal field first_dts vvv ++int64_t av_stream_get_first_dts(const AVStream *st); ++// Chromium: We use the internal field first_dts ^^^ ++ + #define AV_PROGRAM_RUNNING 1 + + /** +diff --git a/libavformat/utils.c b/libavformat/utils.c +index de7580c32d..0ef0fe530e 100644 +--- a/libavformat/utils.c ++++ b/libavformat/utils.c +@@ -121,6 +121,13 @@ int64_t av_stream_get_end_pts(const AVStream *st) + return AV_NOPTS_VALUE; + } + ++// Chromium: We use the internal field first_dts vvv ++int64_t av_stream_get_first_dts(const AVStream *st) ++{ ++ return cffstream(st)->first_dts; ++} ++// Chromium: We use the internal field first_dts ^^^ ++ + struct AVCodecParserContext *av_stream_get_parser(const AVStream *st) + { + return st->internal->parser; diff --git a/ffmpeg/vmaf-model-path.patch b/ffmpeg/vmaf-model-path.patch new file mode 100644 index 000000000..abd65cdf7 --- /dev/null +++ b/ffmpeg/vmaf-model-path.patch @@ -0,0 +1,13 @@ +diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c +index 249e50c720..9b791e19b1 100644 +--- 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/model/vmaf_v0.6.1.pkl"}, 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},