Index: head/multimedia/ffmpeg/Makefile =================================================================== --- head/multimedia/ffmpeg/Makefile (revision 489840) +++ head/multimedia/ffmpeg/Makefile (revision 489841) @@ -1,564 +1,564 @@ # Created by: Martin Matuska # $FreeBSD$ PORTNAME= ffmpeg PORTVERSION= 4.1 -PORTREVISION= 3 +PORTREVISION= 4 PORTEPOCH= 1 CATEGORIES= multimedia audio ipv6 net MASTER_SITES= https://ffmpeg.org/releases/ MAINTAINER= multimedia@FreeBSD.org COMMENT= Realtime audio/video encoder/converter and streaming server LICENSE= GPLv2+ LGPL21+ LICENSE_COMB= multi BUILD_DEPENDS= nasm:devel/nasm \ ${LOCALBASE}/bin/as:devel/binutils HAS_CONFIGURE= yes CONFIGURE_LOG= ffbuild/config.log USES= compiler:c11 cpe gmake localbase:ldflags perl5 \ pkgconfig shebangfix tar:xz USE_LDCONFIG= yes USE_PERL5= build SHEBANG_FILES= doc/texi2pod.pl NOPRECIOUSMAKEVARS= yes # ARCH PORTSCOUT= limit:^4\. OPTIONS_DEFINE= ALSA AMR_NB AMR_WB AOM ASS BEIGNET BS2B CACA CDIO CELT CHROMAPRINT CODEC2 DAV1D DAVS2 DC1394 \ DEBUG DOCS DRM FDK_AAC FLITE FONTCONFIG \ FREETYPE FREI0R FRIBIDI GME GSM ICONV ILBC JACK KLVANC KVAZAAR LADSPA \ LAME LENSFUN LIBBLURAY LIBRSVG2 LIBXML2 LV2 MODPLUG MYSOFA OPENAL OPENCL OPENCV OPENGL \ OPENH264 OPENJPEG OPENMPT OPTIMIZED_CFLAGS OPUS PULSEAUDIO \ RUBBERBAND RTCPU SDL SMB SNAPPY SNDIO SOXR SPEEX SRT SSH TENSORFLOW \ TESSERACT THEORA TWOLAME V4L VAAPI VAPOURSYNTH VDPAU VIDSTAB VORBIS \ VO_AMRWBENC VPX WAVPACK WEBP X264 X265 XAVS2 XCB XVID \ XVIDEO ZIMG ZMQ ZVBI OPTIONS_DEFAULT= FONTCONFIG FREETYPE FREI0R GMP GNUTLS ICONV \ OPENCV OPTIMIZED_CFLAGS OPUS RTCPU THEORA V4L VAAPI VDPAU \ VORBIS VPX X264 X265 XCB XVID .if !exists(${.CURDIR:H:H}/multimedia/davs2) # https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/5985a1bf7233 OPTIONS_EXCLUDE+= DAVS2 .endif .if !exists(${.CURDIR:H:H}/multimedia/xavs2) # https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/85a921f4618 OPTIONS_EXCLUDE+= XAVS2 .endif .if !exists(${.CURDIR:H:H}/multimedia/klvanc) # https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/8732dfa9954 OPTIONS_EXCLUDE+= KLVANC .endif .if !exists(${.CURDIR:H:H}/net/srt) # https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/a2fc8dbae853 OPTIONS_EXCLUDE+= SRT .endif .if !exists(${.CURDIR:H:H}/science/tensorflow) # https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/d8c0bbb0aa4 OPTIONS_EXCLUDE+= TENSORFLOW .endif OPTIONS_RADIO= RTMP SSL OPTIONS_RADIO_RTMP= GCRYPT GMP LIBRTMP OPTIONS_RADIO_SSL= GNUTLS MBEDTLS OPENSSL OPTIONS_GROUP= LICENSE OPTIONS_GROUP_LICENSE= GPL3 NONFREE OPTIONS_DEFINE_amd64= BEIGNET MMX SSE OPTIONS_DEFINE_armv6= VFP NEON OPTIONS_DEFINE_i386= BEIGNET MMX SSE OPTIONS_DEFAULT_amd64= MMX SSE OPTIONS_DEFAULT_i386= MMX SSE ASS_DESC= Subtitles rendering via libass AOM_DESC= AV1 video encoding/decoding via libaom BEIGNET_DESC= DRM/VAAPI to OpenCL mapping for i965 + Beignet BS2B_DESC= Bauer Stereophonic-to-Binaural filter CHROMAPRINT_DESC= Audio fingerprinting with chromaprint CODEC2_DESC= Codec 2 audio encoding/decoding via libcodec2 DAV1D_DESC= AV1 video decoding via libdav1d DAVS2_DESC= AVS2 decoding via libdavs2 DC1394_DESC= IIDC-1394 grabbing using libdc1394 DRM_DESC= KMS grabbing using libdrm FDK_AAC_DESC= AAC audio encoding via Fraunhofer FDK FLITE_DESC= Voice synthesis support via libflite GME_DESC= Game Music Emu demuxer GPL3_DESC= Allow (L)GPL version 3 code(cs) ILBC_DESC= Internet Low Bit Rate codec KLVANC_DESC= Kernel Labs VANC processing KVAZAAR_DESC= H.265 video codec support via Kvazaar LICENSE_DESC= Licensing options LV2_DESC= LV2 audio filtering MYSOFA_DESC= SOFAlizer binaural filter NEON_DESC= Media Processing Engine instructions NONFREE_DESC= Allow use of nonfree code OPENMPT_DESC= Decoding tracked files via libopenmpt OPENH264_DESC= H.264 video codec support via OpenH264 RUBBERBAND_DESC=Time-stretching and pitch-shifting with librubberband RTCPU_DESC= Detect CPU capabilities at runtime RTMP_DESC= RTMP(T)E protocol support SRT_DESC= Haivision SRT protocol via libsrt 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 VAPOURSYNTH_DESC= VapourSynth demuxer VFP_DESC= Vector Floating Point instructions VIDSTAB_DESC= Video stabilization filter XAVS2_DESC= AVS2 encoding via libxavs2 XCB_DESC= X11 grabbing using XCB ZIMG_DESC= "z" library video scaling filter ZMQ_DESC= Message passing via libzmq${ZMQ_VERSION} ZVBI_DESC= Teletext support via libzvbi OPTIONS_SUB= yes # alsa ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_CONFIGURE_ENABLE= alsa # Opencore AMR NB AMR_NB_LIB_DEPENDS= libopencore-amrnb.so:audio/opencore-amr AMR_NB_CONFIGURE_ENABLE= libopencore-amrnb AMR_NB_IMPLIES= GPL3 # Opencore AMR WB AMR_WB_LIB_DEPENDS= libopencore-amrwb.so:audio/opencore-amr AMR_WB_CONFIGURE_ENABLE= libopencore-amrwb AMR_WB_IMPLIES= GPL3 # aom AOM_LIB_DEPENDS= libaom.so:multimedia/aom AOM_CONFIGURE_ENABLE= libaom # ass ASS_LIB_DEPENDS= libass.so:multimedia/libass ASS_CONFIGURE_ENABLE= libass # beignet BEIGNET_BUILD_DEPENDS= ${LOCALBASE}/include/CL/cl_intel.h:lang/beignet BEIGNET_IMPLIES= DRM OPENCL VAAPI # bs2b BS2B_LIB_DEPENDS= libbs2b.so:audio/libbs2b BS2B_CONFIGURE_ENABLE= libbs2b # caca CACA_LIB_DEPENDS= libcaca.so:graphics/libcaca CACA_CONFIGURE_ENABLE= libcaca # cdio CDIO_LIB_DEPENDS= libcdio_paranoia.so:sysutils/libcdio-paranoia CDIO_CONFIGURE_ENABLE= libcdio # celt CELT_LIB_DEPENDS= libcelt0.so:audio/celt CELT_CONFIGURE_ENABLE= libcelt # chromaprint CHROMAPRINT_BROKEN= Dependency loop CHROMAPRINT_LIB_DEPENDS= libchromaprint.so:audio/chromaprint CHROMAPRINT_CONFIGURE_ENABLE= chromaprint # codec2 CODEC2_LIB_DEPENDS= libcodec2.so:audio/codec2 CODEC2_CONFIGURE_ENABLE= libcodec2 # dav1d DAV1D_LIB_DEPENDS= libdav1d.so:multimedia/dav1d DAV1D_CONFIGURE_ENABLE= libdav1d # davs2 DAVS2_LIB_DEPENDS= libdavs2.so:multimedia/davs2 DAVS2_CONFIGURE_ENABLE= libdavs2 # dc1394 DC1394_LIB_DEPENDS= libdc1394.so:multimedia/libdc1394 DC1394_CONFIGURE_ENABLE= libdc1394 # debugging DEBUG_CONFIGURE_ON= --disable-stripping DEBUG_CONFIGURE_OFF= --disable-debug # docs DOCS_BUILD_DEPENDS= texi2html:textproc/texi2html DOCS_CONFIGURE_ENABLE= htmlpages # drm DRM_LIB_DEPENDS= libdrm.so:graphics/libdrm DRM_CONFIGURE_ENABLE= libdrm # fdk_aac FDK_AAC_LIB_DEPENDS= libfdk-aac.so:audio/fdk-aac FDK_AAC_CONFIGURE_ENABLE= libfdk-aac FDK_AAC_IMPLIES= NONFREE # flite FLITE_LIB_DEPENDS= libflite.so:audio/flite FLITE_CONFIGURE_ENABLE= libflite # fontconfig FONTCONFIG_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig FONTCONFIG_CONFIGURE_ENABLE= fontconfig # freetype FREETYPE_LIB_DEPENDS= libfreetype.so:print/freetype2 FREETYPE_CONFIGURE_ENABLE= libfreetype # frei0r FREI0R_BUILD_DEPENDS= ${LOCALBASE}/include/frei0r.h:graphics/frei0r FREI0R_CONFIGURE_ENABLE= frei0r # fribidi FRIBIDI_LIB_DEPENDS= libfribidi.so:converters/fribidi FRIBIDI_CONFIGURE_ENABLE= libfribidi # gcrypt GCRYPT_LIB_DEPENDS= libgcrypt.so:security/libgcrypt GCRYPT_CONFIGURE_ENABLE= gcrypt # gnutls GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls GNUTLS_CONFIGURE_ENABLE= gnutls # gme GME_LIB_DEPENDS= libgme.so:audio/libgme GME_CONFIGURE_ENABLE= libgme # gmp GMP_LIB_DEPENDS= libgmp.so:math/gmp GMP_CONFIGURE_ENABLE= gmp GMP_IMPLIES= GPL3 # gsm GSM_LIB_DEPENDS= libgsm.so:audio/gsm GSM_CONFIGURE_ENABLE= libgsm # iconv ICONV_USES= iconv ICONV_CONFIGURE_ENABLE= iconv # ilbc ILBC_LIB_DEPENDS= libilbc.so:net/libilbc ILBC_CONFIGURE_ENABLE= libilbc # jack JACK_LIB_DEPENDS= libjack.so:audio/jack JACK_CONFIGURE_ENABLE= libjack # klvanc KLVANC_LIB_DEPENDS= libklvanc.so:multimedia/libklvanc KLVANC_CONFIGURE_ENABLE= libklvanc # kvazaar KVAZAAR_LIB_DEPENDS= libkvazaar.so:multimedia/kvazaar KVAZAAR_CONFIGURE_ENABLE= libkvazaar # ladspa LADSPA_BUILD_DEPENDS= ${LOCALBASE}/include/ladspa.h:audio/ladspa LADSPA_RUN_DEPENDS= ${LOCALBASE}/lib/ladspa/amp.so:audio/ladspa LADSPA_CONFIGURE_ENABLE= ladspa # lame LAME_LIB_DEPENDS= libmp3lame.so:audio/lame LAME_CONFIGURE_ENABLE= libmp3lame # lensfun LENSFUN_LIB_DEPENDS= liblensfun.so:graphics/lensfun LENSFUN_CONFIGURE_ENABLE= liblensfun # libbluray LIBBLURAY_LIB_DEPENDS= libbluray.so:multimedia/libbluray LIBBLURAY_CONFIGURE_ENABLE= libbluray # librsvg LIBRSVG2_LIB_DEPENDS= librsvg-2.so:graphics/librsvg2 LIBRSVG2_CONFIGURE_ENABLE= librsvg # libxml LIBXML2_LIB_DEPENDS= libxml2.so:textproc/libxml2 LIBXML2_CONFIGURE_ENABLE= libxml2 # lv2 LV2_BUILD_DEPENDS= lv2>0:audio/lv2 LV2_LIB_DEPENDS= liblilv-0.so:audio/lilv LV2_CONFIGURE_ENABLE= lv2 # libv4l V4L_BUILD_DEPENDS= v4l_compat>0:multimedia/v4l_compat V4L_LIB_DEPENDS= libv4l2.so:multimedia/libv4l V4L_CONFIGURE_ENABLE= libv4l2 V4L_CONFIGURE_OFF= --disable-indev=v4l2 \ --disable-outdev=v4l2 # mbedtls MBEDTLS_LIB_DEPENDS= libmbedtls.so:security/mbedtls MBEDTLS_CONFIGURE_ENABLE= mbedtls # mmx support MMX_CONFIGURE_ENABLE= mmx # modplug MODPLUG_LIB_DEPENDS= libmodplug.so:audio/libmodplug MODPLUG_CONFIGURE_ENABLE= libmodplug # mysofa MYSOFA_LIB_DEPENDS= libmysofa.so:audio/libmysofa MYSOFA_CONFIGURE_ENABLE= libmysofa # OpenAL OPENAL_LIB_DEPENDS= libopenal.so:audio/openal-soft OPENAL_CONFIGURE_ENABLE= openal # opencl OPENCL_BUILD_DEPENDS= ${LOCALBASE}/include/CL/opencl.h:devel/opencl OPENCL_LIB_DEPENDS= libOpenCL.so:devel/ocl-icd OPENCL_CONFIGURE_ENABLE= opencl # opencv OPENCV_LIB_DEPENDS= libopencv_imgproc.so:graphics/opencv-core OPENCV_CONFIGURE_ENABLE= libopencv # opengl OPENGL_USE= GL=gl OPENGL_CONFIGURE_ENABLE= opengl # openh264 OPENH264_LIB_DEPENDS= libopenh264.so:multimedia/openh264 OPENH264_CONFIGURE_ENABLE= libopenh264 # openjpeg OPENJPEG_LIB_DEPENDS= libopenjp2.so:graphics/openjpeg OPENJPEG_CONFIGURE_ENABLE= libopenjpeg # openmpt OPENMPT_LIB_DEPENDS= libopenmpt.so:audio/libopenmpt OPENMPT_CONFIGURE_ENABLE= libopenmpt # openssl/libtls OPENSSL_USES= ssl OPENSSL_CONFIGURE_ENABLE= ${"${SSL_DEFAULT:Mlibressl*}"!="":?libtls:openssl} OPENSSL_IMPLIES= NONFREE # optimizations OPTIMIZED_CFLAGS_CONFIGURE_ENABLE= optimizations # opus OPUS_LIB_DEPENDS= libopus.so:audio/opus OPUS_CONFIGURE_ENABLE= libopus # pulseaudio PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_CONFIGURE_ENABLE= libpulse # rubberband RUBBERBAND_LIB_DEPENDS= librubberband.so:audio/rubberband RUBBERBAND_CONFIGURE_ENABLE= librubberband # rtcpu RTCPU_CONFIGURE_ENABLE= runtime-cpudetect # rtmp LIBRTMP_LIB_DEPENDS= librtmp.so:multimedia/librtmp LIBRTMP_CONFIGURE_ENABLE= librtmp # sdl SDL_USE= SDL=sdl2 SDL_CONFIGURE_ENABLE= sdl2 # smbclient SMB_USES= samba:lib SMB_CONFIGURE_ENABLE= libsmbclient SMB_IMPLIES= GPL3 # snappy SNAPPY_LIB_DEPENDS= libsnappy.so:archivers/snappy SNAPPY_CONFIGURE_ENABLE= libsnappy # sndio SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio SNDIO_CONFIGURE_ENABLE= sndio # soxr SOXR_LIB_DEPENDS= libsoxr.so:audio/libsoxr SOXR_CONFIGURE_ENABLE= libsoxr # speex SPEEX_LIB_DEPENDS= libspeex.so:audio/speex SPEEX_CONFIGURE_ENABLE= libspeex # sse support SSE_CONFIGURE_ENABLE= sse SSE_IMPLIES= MMX # ssh SSH_LIB_DEPENDS= libssh.so:security/libssh SSH_CONFIGURE_ENABLE= libssh # srt SRT_LIB_DEPENDS= libsrt.so:net/srt SRT_CONFIGURE_ENABLE= libsrt # tensorflow TENSORFLOW_LIB_DEPENDS= libtensorflow.so:science/tensorflow TENSORFLOW_CONFIGURE_ENABLE= libtensorflow # tesseract TESSERACT_LIB_DEPENDS= libtesseract.so:graphics/tesseract TESSERACT_CONFIGURE_ENABLE= libtesseract # theora THEORA_LIB_DEPENDS= libtheora.so:multimedia/libtheora THEORA_CONFIGURE_ENABLE= libtheora # twolame TWOLAME_LIB_DEPENDS= libtwolame.so:audio/twolame TWOLAME_CONFIGURE_ENABLE= libtwolame # vaapi VAAPI_LIB_DEPENDS= libva.so:multimedia/libva VAAPI_CONFIGURE_ENABLE= vaapi # vapoursynth VAPOURSYNTH_LIB_DEPENDS= libvapoursynth-script.so:multimedia/vapoursynth VAPOURSYNTH_CONFIGURE_ENABLE= vapoursynth # vdpau VDPAU_LIB_DEPENDS= libvdpau.so:multimedia/libvdpau VDPAU_CONFIGURE_ENABLE= vdpau # armv6/armv7 VFP_CONFIGURE_ENABLE= vfp NEON_CONFIGURE_ENABLE= neon .if ! ${CFLAGS:M-march*} NEON_CONFIGURE_ON= --cpu=armv7-a .endif # vo-amrwbenc VO_AMRWBENC_LIB_DEPENDS= libvo-amrwbenc.so:audio/vo-amrwbenc VO_AMRWBENC_CONFIGURE_ENABLE= libvo-amrwbenc VO_AMRWBENC_IMPLIES= GPL3 # vid.stab VIDSTAB_LIB_DEPENDS= libvidstab.so:multimedia/vid.stab VIDSTAB_CONFIGURE_ENABLE= libvidstab # vorbis VORBIS_LIB_DEPENDS= libvorbisenc.so:audio/libvorbis VORBIS_CONFIGURE_ENABLE= libvorbis # vp8 VPX_LIB_DEPENDS= libvpx.so:multimedia/libvpx VPX_CONFIGURE_ENABLE= libvpx # wavpack WAVPACK_LIB_DEPENDS= libwavpack.so:audio/wavpack WAVPACK_CONFIGURE_ENABLE= libwavpack # webp WEBP_LIB_DEPENDS= libwebp.so:graphics/webp WEBP_CONFIGURE_ENABLE= libwebp # x264 X264_LIB_DEPENDS= libx264.so:multimedia/libx264 X264_CONFIGURE_ENABLE= libx264 # x265 X265_LIB_DEPENDS= libx265.so:multimedia/x265 X265_CONFIGURE_ENABLE= libx265 # xavs2 XAVS2_LIB_DEPENDS= libxavs2.so:multimedia/xavs2 XAVS2_CONFIGURE_ENABLE= libxavs2 # xcb XCB_USE= XORG=xcb XCB_CONFIGURE_ENABLE= libxcb # xvid XVID_LIB_DEPENDS= libxvidcore.so:multimedia/xvid XVID_CONFIGURE_ENABLE= libxvid # xv XVIDEO_USE= XORG=xv XVIDEO_CONFIGURE_OFF= --disable-outdev=xv # zimg ZIMG_LIB_DEPENDS= libzimg.so:graphics/sekrit-twc-zimg ZIMG_CONFIGURE_ENABLE= libzimg # zmq ZMQ_LIB_DEPENDS= libzmq.so:net/libzmq${ZMQ_VERSION} ZMQ_CONFIGURE_ENABLE= libzmq ZMQ_VERSION?= 4 # zvbi ZVBI_LIB_DEPENDS= libzvbi.so:devel/libzvbi ZVBI_CONFIGURE_ENABLE= libzvbi # License knobs GPL3_CONFIGURE_ENABLE= version3 GPL3_VARS= LICENSE="GPLv3+ LGPL3+" LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING.GPLv3 LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING.LGPLv3 NONFREE_CONFIGURE_ENABLE=nonfree NONFREE_VARS= RESTRICTED="enabling OPENSSL or FDK_AAC restricts redistribution" INSTALL_TARGET= install-progs install-doc install-data \ install-libs install-headers install-examples DATADIR= ${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX} DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX} CONFIGURE_ENV+= COMPILER_PATH=${LOCALBASE}/bin MAKE_ENV+= COMPILER_PATH=${LOCALBASE}/bin V=1 CONFIGURE_ARGS+=--prefix="${PREFIX}" \ --mandir="${PREFIX}/man" \ --datadir="${DATADIR}" \ --pkgconfigdir="${PREFIX}/libdata/pkgconfig" \ --enable-shared \ --enable-pic \ --enable-gpl \ --enable-postproc \ --enable-avfilter \ --enable-avresample \ --enable-pthreads \ --cc="${CC}" CONFIGURE_ENV_aarch64_clang= ASFLAGS=-no-integrated-as CONFIGURE_ENV_armv6_clang= ASFLAGS=-no-integrated-as CONFIGURE_ENV_armv7_clang= ASFLAGS=-no-integrated-as CONFIGURE_ARGS_FreeBSD_10_armv6=--disable-fast-unaligned DOC_FILES= Changelog CREDITS INSTALL.md LICENSE.md MAINTAINERS \ README.md RELEASE_NOTES # under doc subdirectory DOC_DOCFILES= APIchanges *.txt PORTDOCS= * # Custom helpers. FOO_${ARCH} style from bsd.port.mk CONFIGURE_ENV+= ${CONFIGURE_ENV_${ARCH}_${CHOSEN_COMPILER_TYPE}} CONFIGURE_ARGS+=${CONFIGURE_ARGS_${OPSYS}_${OSREL:R}_${ARCH}} post-patch: # {C,LD}FLAGS safeness @${REINPLACE_CMD} -E \ -e 's|require_pkg_config opencv|require_pkg_config opencv-core|g' \ ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} post-install: (cd ${WRKSRC} && ${COPYTREE_SHARE} \ "${DOC_FILES}" ${STAGEDIR}${DOCSDIR}) (cd ${WRKSRC}/doc && ${COPYTREE_SHARE} \ "${DOC_DOCFILES}" ${STAGEDIR}${DOCSDIR}) .include Index: head/multimedia/ffmpeg/files/patch-aom =================================================================== --- head/multimedia/ffmpeg/files/patch-aom (nonexistent) +++ head/multimedia/ffmpeg/files/patch-aom (revision 489841) @@ -0,0 +1,180 @@ +https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/b2ea757f68 +https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/d12d4d4515 +https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/b87063c06d +https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/2ddaaaf595 + +--- doc/encoders.texi.orig 2018-11-05 23:22:25 UTC ++++ doc/encoders.texi +@@ -1370,6 +1370,118 @@ makes it possible to store non-rgb pix_fmts. + + @end table + ++@section libaom-av1 ++ ++libaom AV1 encoder wrapper. ++ ++Requires the presence of the libaom headers and library during ++configuration. You need to explicitly configure the build with ++@code{--enable-libaom}. ++ ++@subsection Options ++ ++The wrapper supports the following standard libavcodec options: ++ ++@table @option ++ ++@item b ++Set bitrate target in bits/second. By default this will use ++variable-bitrate mode. If @option{maxrate} and @option{minrate} are ++also set to the same value then it will use constant-bitrate mode, ++otherwise if @option{crf} is set as well then it will use ++constrained-quality mode. ++ ++@item g keyint_min ++Set key frame placement. The GOP size sets the maximum distance between ++key frames; if zero the output stream will be intra-only. The minimum ++distance is ignored unless it is the same as the GOP size, in which case ++key frames will always appear at a fixed interval. Not set by default, ++so without this option the library has completely free choice about ++where to place key frames. ++ ++@item qmin qmax ++Set minimum/maximum quantisation values. Valid range is from 0 to 63 ++(warning: this does not match the quantiser values actually used by AV1 ++- divide by four to map real quantiser values to this range). Defaults ++to min/max (no constraint). ++ ++@item minrate maxrate bufsize rc_init_occupancy ++Set rate control buffering parameters. Not used if not set - defaults ++to unconstrained variable bitrate. ++ ++@item threads ++Set the number of threads to use while encoding. This may require the ++@option{tiles} or @option{row-mt} options to also be set to actually ++use the specified number of threads fully. Defaults to the number of ++hardware threads supported by the host machine. ++ ++@item profile ++Set the encoding profile. Defaults to using the profile which matches ++the bit depth and chroma subsampling of the input. ++ ++@end table ++ ++The wrapper also has some specific options: ++ ++@table @option ++ ++@item cpu-used ++Set the quality/encoding speed tradeoff. Valid range is from 0 to 8, ++higher numbers indicating greater speed and lower quality. The default ++value is 1, which will be slow and high quality. ++ ++@item auto-alt-ref ++Enable use of alternate reference frames. Defaults to the internal ++default of the library. ++ ++@item lag-in-frames ++Set the maximum number of frames which the encoder may keep in flight ++at any one time for lookahead purposes. Defaults to the internal ++default of the library. ++ ++@item error-resilience ++Enable error resilience features: ++@table @option ++@item default ++Improve resilience against losses of whole frames. ++@end table ++Not enabled by default. ++ ++@item crf ++Set the quality/size tradeoff for constant-quality (no bitrate target) ++and constrained-quality (with maximum bitrate target) modes. Valid ++range is 0 to 63, higher numbers indicating lower quality and smaller ++output size. Only used if set; by default only the bitrate target is ++used. ++ ++@item static-thresh ++Set a change threshold on blocks below which they will be skipped by ++the encoder. Defined in arbitrary units as a nonnegative integer, ++defaulting to zero (no blocks are skipped). ++ ++@item drop-threshold ++Set a threshold for dropping frames when close to rate control bounds. ++Defined as a percentage of the target buffer - when the rate control ++buffer falls below this percentage, frames will be dropped until it ++has refilled above the threshold. Defaults to zero (no frames are ++dropped). ++ ++@item tiles ++Set the number of tiles to encode the input video with, as colums x ++rows. Larger numbers allow greater parallelism in both encoding and ++decoding, but may decrease coding efficiency. Defaults to the minimum ++number of tiles required by the size of the input video (this is 1x1 ++(that is, a single tile) for sizes up to and including 4K). ++ ++@item tile-columns tile-rows ++Set the number of tiles as log2 of the number of tile rows and columns. ++Provided for compatibility with libvpx/VP9. ++ ++@item row-mt (Requires libaom >= 1.0.0-759-g90a15f4f2) ++Enable row based multi-threading. Disabled by default. ++ ++@end table ++ + @section libkvazaar + + Kvazaar H.265/HEVC encoder. +--- libavcodec/libaomenc.c.orig 2018-11-05 23:22:26 UTC ++++ libavcodec/libaomenc.c +@@ -79,6 +79,7 @@ typedef struct AOMEncoderContext { + int tile_cols_log2, tile_rows_log2; + aom_superblock_size_t superblock_size; + int uniform_tiles; ++ int row_mt; + } AOMContext; + + static const char *const ctlidstr[] = { +@@ -93,6 +94,9 @@ static const char *const ctlidstr[] = { + [AV1E_SET_SUPERBLOCK_SIZE] = "AV1E_SET_SUPERBLOCK_SIZE", + [AV1E_SET_TILE_COLUMNS] = "AV1E_SET_TILE_COLUMNS", + [AV1E_SET_TILE_ROWS] = "AV1E_SET_TILE_ROWS", ++#ifdef AOM_CTRL_AV1E_SET_ROW_MT ++ [AV1E_SET_ROW_MT] = "AV1E_SET_ROW_MT", ++#endif + }; + + static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) +@@ -505,7 +509,8 @@ static av_cold int aom_init(AVCodecContext *avctx, + enccfg.g_h = avctx->height; + enccfg.g_timebase.num = avctx->time_base.num; + enccfg.g_timebase.den = avctx->time_base.den; +- enccfg.g_threads = avctx->thread_count ? avctx->thread_count : av_cpu_count(); ++ enccfg.g_threads = ++ FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 64); + + if (ctx->lag_in_frames >= 0) + enccfg.g_lag_in_frames = ctx->lag_in_frames; +@@ -650,6 +655,10 @@ static av_cold int aom_init(AVCodecContext *avctx, + codecctl_int(avctx, AV1E_SET_TILE_ROWS, ctx->tile_rows_log2); + } + ++#ifdef AOM_CTRL_AV1E_SET_ROW_MT ++ codecctl_int(avctx, AV1E_SET_ROW_MT, ctx->row_mt); ++#endif ++ + // provide dummy value to initialize wrapper, values will be updated each _encode() + aom_img_wrap(&ctx->rawimg, img_fmt, avctx->width, avctx->height, 1, + (unsigned char*)1); +@@ -984,10 +993,12 @@ static const AVOption options[] = { + { "tiles", "Tile columns x rows", OFFSET(tile_cols), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, VE }, + { "tile-columns", "Log2 of number of tile columns to use", OFFSET(tile_cols_log2), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE}, + { "tile-rows", "Log2 of number of tile rows to use", OFFSET(tile_rows_log2), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE}, ++ { "row-mt", "Enable row based multi-threading", OFFSET(row_mt), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, VE}, + { NULL } + }; + + static const AVCodecDefault defaults[] = { ++ { "b", "256*1000" }, + { "qmin", "-1" }, + { "qmax", "-1" }, + { "g", "-1" }, Property changes on: head/multimedia/ffmpeg/files/patch-aom ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/multimedia/ffmpeg/files/patch-dav1d =================================================================== --- head/multimedia/ffmpeg/files/patch-dav1d (revision 489840) +++ head/multimedia/ffmpeg/files/patch-dav1d (revision 489841) @@ -1,325 +1,331 @@ https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/beaa350e24 https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/752659327d https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/cc25529420 https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/53ca505acc https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/3cd275bcde https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/0fca2f60da https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/e695b0beba https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/0e833f615b +https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/10931a0661 --- configure.orig 2018-11-05 23:22:33 UTC +++ configure @@ -226,6 +226,7 @@ External library support: --enable-libcelt enable CELT decoding via libcelt [no] --enable-libcdio enable audio CD grabbing with libcdio [no] --enable-libcodec2 enable codec2 en/decoding using libcodec2 [no] + --enable-libdav1d enable AV1 decoding via libdav1d [no] --enable-libdavs2 enable AVS2 decoding via libdavs2 [no] --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [no] @@ -1712,6 +1713,7 @@ EXTERNAL_LIBRARY_LIST=" libcaca libcelt libcodec2 + libdav1d libdc1394 libdrm libflite @@ -3090,6 +3092,7 @@ libaom_av1_encoder_select="extract_extradata_bsf" libcelt_decoder_deps="libcelt" libcodec2_decoder_deps="libcodec2" libcodec2_encoder_deps="libcodec2" +libdav1d_decoder_deps="libdav1d" libdavs2_decoder_deps="libdavs2" libfdk_aac_decoder_deps="libfdk_aac" libfdk_aac_encoder_deps="libfdk_aac" @@ -6068,6 +6071,7 @@ enabled libcelt && require libcelt celt/celt die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2 +enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.0.1" "dav1d/dav1d.h" dav1d_version enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.5.115" davs2.h davs2_decoder_open enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion --- doc/general.texi.orig 2018-11-05 23:22:25 UTC +++ doc/general.texi @@ -758,8 +758,8 @@ following image formats are supported: @item Autodesk Animator Flic video @tab @tab X @item Autodesk RLE @tab @tab X @tab fourcc: AASC -@item AV1 @tab @tab E - @tab Supported through external library libaom +@item AV1 @tab E @tab E + @tab Supported through external libraries libaom and libdav1d @item Avid 1:1 10-bit RGB Packer @tab X @tab X @tab fourcc: AVrp @item AVS (Audio Video Standard) video @tab @tab X --- libavcodec/Makefile.orig 2018-11-05 23:22:25 UTC +++ libavcodec/Makefile @@ -956,6 +956,7 @@ OBJS-$(CONFIG_LIBAOM_AV1_ENCODER) += libaomenc OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o OBJS-$(CONFIG_LIBCODEC2_DECODER) += libcodec2.o codec2utils.o OBJS-$(CONFIG_LIBCODEC2_ENCODER) += libcodec2.o codec2utils.o +OBJS-$(CONFIG_LIBDAV1D_DECODER) += libdav1d.o OBJS-$(CONFIG_LIBDAVS2_DECODER) += libdavs2.o OBJS-$(CONFIG_LIBFDK_AAC_DECODER) += libfdk-aacdec.o OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o --- libavcodec/allcodecs.c.orig 2018-11-05 23:22:25 UTC +++ libavcodec/allcodecs.c @@ -676,6 +676,7 @@ extern AVCodec ff_libaom_av1_encoder; extern AVCodec ff_libcelt_decoder; extern AVCodec ff_libcodec2_encoder; extern AVCodec ff_libcodec2_decoder; +extern AVCodec ff_libdav1d_decoder; extern AVCodec ff_libdavs2_decoder; extern AVCodec ff_libfdk_aac_encoder; extern AVCodec ff_libfdk_aac_decoder; --- libavcodec/libdav1d.c.orig 2018-12-16 07:22:28 UTC +++ libavcodec/libdav1d.c -@@ -0,0 +1,246 @@ +@@ -0,0 +1,251 @@ +/* + * Copyright (c) 2018 Ronald S. Bultje + * Copyright (c) 2018 James Almer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include "libavutil/avassert.h" +#include "libavutil/opt.h" + +#include "avcodec.h" +#include "decode.h" +#include "internal.h" + +typedef struct Libdav1dContext { + AVClass *class; + Dav1dContext *c; + + Dav1dData data; + int tile_threads; + int apply_grain; +} Libdav1dContext; + +static av_cold int libdav1d_init(AVCodecContext *c) +{ + Libdav1dContext *dav1d = c->priv_data; + Dav1dSettings s; + int res; + + av_log(c, AV_LOG_INFO, "libdav1d %s\n", dav1d_version()); + + dav1d_default_settings(&s); + s.n_tile_threads = dav1d->tile_threads; + s.apply_grain = dav1d->apply_grain; + s.n_frame_threads = FFMIN(c->thread_count ? c->thread_count : av_cpu_count(), DAV1D_MAX_FRAME_THREADS); + + res = dav1d_open(&dav1d->c, &s); + if (res < 0) + return AVERROR(ENOMEM); + + return 0; +} + +static void libdav1d_flush(AVCodecContext *c) +{ + Libdav1dContext *dav1d = c->priv_data; + + dav1d_data_unref(&dav1d->data); + dav1d_flush(dav1d->c); +} + +static void libdav1d_data_free(const uint8_t *data, void *opaque) { + AVBufferRef *buf = opaque; + + av_buffer_unref(&buf); +} + +static void libdav1d_frame_free(void *opaque, uint8_t *data) { -+ Dav1dPicture p = { 0 }; ++ Dav1dPicture *p = opaque; + -+ p.ref = opaque; -+ p.data[0] = (void *) 0x1; // this has to be non-NULL -+ dav1d_picture_unref(&p); ++ dav1d_picture_unref(p); ++ av_free(p); +} + +static const enum AVPixelFormat pix_fmt[][3] = { + [DAV1D_PIXEL_LAYOUT_I400] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12 }, + [DAV1D_PIXEL_LAYOUT_I420] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12 }, + [DAV1D_PIXEL_LAYOUT_I422] = { AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12 }, + [DAV1D_PIXEL_LAYOUT_I444] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12 }, +}; + +static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) +{ + Libdav1dContext *dav1d = c->priv_data; + Dav1dData *data = &dav1d->data; -+ Dav1dPicture p = { 0 }; ++ Dav1dPicture *p; + int res; + + if (!data->sz) { + AVPacket pkt = { 0 }; + + res = ff_decode_get_packet(c, &pkt); + if (res < 0 && res != AVERROR_EOF) + return res; + + if (pkt.size) { + res = dav1d_data_wrap(data, pkt.data, pkt.size, libdav1d_data_free, pkt.buf); + if (res < 0) { + av_packet_unref(&pkt); + return res; + } + + data->m.timestamp = pkt.pts; + data->m.offset = pkt.pos; + data->m.duration = pkt.duration; + + pkt.buf = NULL; + av_packet_unref(&pkt); + } + } + + res = dav1d_send_data(dav1d->c, data); + if (res < 0) { + if (res == -EINVAL) + res = AVERROR_INVALIDDATA; + if (res != -EAGAIN) + return res; + } + -+ res = dav1d_get_picture(dav1d->c, &p); ++ p = av_mallocz(sizeof(*p)); ++ if (!p) ++ return AVERROR(ENOMEM); ++ ++ res = dav1d_get_picture(dav1d->c, p); + if (res < 0) { + if (res == -EINVAL) + res = AVERROR_INVALIDDATA; + else if (res == -EAGAIN && c->internal->draining) + res = AVERROR_EOF; + ++ av_free(p); + return res; + } + -+ av_assert0(p.data[0] != NULL); ++ av_assert0(p->data[0] != NULL); + + frame->buf[0] = av_buffer_create(NULL, 0, libdav1d_frame_free, -+ p.ref, AV_BUFFER_FLAG_READONLY); ++ p, AV_BUFFER_FLAG_READONLY); + if (!frame->buf[0]) { -+ dav1d_picture_unref(&p); ++ dav1d_picture_unref(p); ++ av_free(p); + return AVERROR(ENOMEM); + } + -+ frame->data[0] = p.data[0]; -+ frame->data[1] = p.data[1]; -+ frame->data[2] = p.data[2]; -+ frame->linesize[0] = p.stride[0]; -+ frame->linesize[1] = p.stride[1]; -+ frame->linesize[2] = p.stride[1]; ++ frame->data[0] = p->data[0]; ++ frame->data[1] = p->data[1]; ++ frame->data[2] = p->data[2]; ++ frame->linesize[0] = p->stride[0]; ++ frame->linesize[1] = p->stride[1]; ++ frame->linesize[2] = p->stride[1]; + -+ c->profile = p.seq_hdr->profile; -+ frame->format = c->pix_fmt = pix_fmt[p.p.layout][p.seq_hdr->hbd]; -+ frame->width = p.p.w; -+ frame->height = p.p.h; -+ if (c->width != p.p.w || c->height != p.p.h) { -+ res = ff_set_dimensions(c, p.p.w, p.p.h); ++ c->profile = p->seq_hdr->profile; ++ frame->format = c->pix_fmt = pix_fmt[p->p.layout][p->seq_hdr->hbd]; ++ frame->width = p->p.w; ++ frame->height = p->p.h; ++ if (c->width != p->p.w || c->height != p->p.h) { ++ res = ff_set_dimensions(c, p->p.w, p->p.h); + if (res < 0) + return res; + } + -+ switch (p.seq_hdr->chr) { ++ switch (p->seq_hdr->chr) { + case DAV1D_CHR_VERTICAL: + frame->chroma_location = c->chroma_sample_location = AVCHROMA_LOC_LEFT; + break; + case DAV1D_CHR_COLOCATED: + frame->chroma_location = c->chroma_sample_location = AVCHROMA_LOC_TOPLEFT; + break; + } -+ frame->colorspace = c->colorspace = (enum AVColorSpace) p.seq_hdr->mtrx; -+ frame->color_primaries = c->color_primaries = (enum AVColorPrimaries) p.seq_hdr->pri; -+ frame->color_trc = c->color_trc = (enum AVColorTransferCharacteristic) p.seq_hdr->trc; -+ frame->color_range = c->color_range = p.seq_hdr->color_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; ++ frame->colorspace = c->colorspace = (enum AVColorSpace) p->seq_hdr->mtrx; ++ frame->color_primaries = c->color_primaries = (enum AVColorPrimaries) p->seq_hdr->pri; ++ frame->color_trc = c->color_trc = (enum AVColorTransferCharacteristic) p->seq_hdr->trc; ++ frame->color_range = c->color_range = p->seq_hdr->color_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; + + // match timestamps and packet size -+ frame->pts = frame->best_effort_timestamp = p.m.timestamp; ++ frame->pts = frame->best_effort_timestamp = p->m.timestamp; +#if FF_API_PKT_PTS +FF_DISABLE_DEPRECATION_WARNINGS -+ frame->pkt_pts = p.m.timestamp; ++ frame->pkt_pts = p->m.timestamp; +FF_ENABLE_DEPRECATION_WARNINGS +#endif -+ frame->pkt_dts = p.m.timestamp; -+ frame->pkt_pos = p.m.offset; -+ frame->pkt_size = p.m.size; -+ frame->pkt_duration = p.m.duration; -+ frame->key_frame = p.frame_hdr->frame_type == DAV1D_FRAME_TYPE_KEY; ++ frame->pkt_dts = p->m.timestamp; ++ frame->pkt_pos = p->m.offset; ++ frame->pkt_size = p->m.size; ++ frame->pkt_duration = p->m.duration; ++ frame->key_frame = p->frame_hdr->frame_type == DAV1D_FRAME_TYPE_KEY; + -+ switch (p.frame_hdr->frame_type) { ++ switch (p->frame_hdr->frame_type) { + case DAV1D_FRAME_TYPE_KEY: + case DAV1D_FRAME_TYPE_INTRA: + frame->pict_type = AV_PICTURE_TYPE_I; + break; + case DAV1D_FRAME_TYPE_INTER: + frame->pict_type = AV_PICTURE_TYPE_P; + break; + case DAV1D_FRAME_TYPE_SWITCH: + frame->pict_type = AV_PICTURE_TYPE_SP; + break; + default: + return AVERROR_INVALIDDATA; + } + + return 0; +} + +static av_cold int libdav1d_close(AVCodecContext *c) +{ + Libdav1dContext *dav1d = c->priv_data; + + dav1d_data_unref(&dav1d->data); + dav1d_close(&dav1d->c); + + return 0; +} + +#define OFFSET(x) offsetof(Libdav1dContext, x) +#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM +static const AVOption libdav1d_options[] = { + { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, DAV1D_MAX_TILE_THREADS, VD }, + { "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VD }, + { NULL } +}; + +static const AVClass libdav1d_class = { + .class_name = "libdav1d decoder", + .item_name = av_default_item_name, + .option = libdav1d_options, + .version = LIBAVUTIL_VERSION_INT, +}; + +AVCodec ff_libdav1d_decoder = { + .name = "libdav1d", + .long_name = NULL_IF_CONFIG_SMALL("dav1d AV1 decoder by VideoLAN"), + .type = AVMEDIA_TYPE_VIDEO, + .id = AV_CODEC_ID_AV1, + .priv_data_size = sizeof(Libdav1dContext), + .init = libdav1d_init, + .close = libdav1d_close, + .flush = libdav1d_flush, + .receive_frame = libdav1d_receive_frame, + .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SETS_PKT_DTS, + .priv_class = &libdav1d_class, + .wrapper_name = "libdav1d", +};