Updated to version 3.4

This commit is contained in:
Daniel Bermond
2017-10-15 17:29:15 -02:00
parent 9b2fe487d2
commit aa0b46a588
4 changed files with 55 additions and 236 deletions
+11 -13
View File
@@ -1,17 +1,18 @@
# Generated by mksrcinfo v8 # Generated by mksrcinfo v8
# Tue Oct 10 16:31:38 UTC 2017 # Sun Oct 15 19:28:53 UTC 2017
pkgbase = ffmpeg-full pkgbase = ffmpeg-full
pkgdesc = Record, convert and stream audio and video (all possible features including nvenc, qsv and libfdk-aac) pkgdesc = Record, convert and stream audio and video (all possible features including nvenc, qsv and libfdk-aac)
pkgver = 3.3.4 pkgver = 3.4
pkgrel = 2 pkgrel = 1
url = http://www.ffmpeg.org/ url = http://www.ffmpeg.org/
arch = i686 arch = i686
arch = x86_64 arch = x86_64
license = custom: nonfree and unredistributable license = custom: nonfree and unredistributable
makedepends = yasm makedepends = nasm
makedepends = opencl-headers makedepends = opencl-headers
makedepends = blackmagic-decklink-sdk makedepends = blackmagic-decklink-sdk
makedepends = libmfx makedepends = libmfx
makedepends = libvmaf
depends = glibc depends = glibc
depends = alsa-lib depends = alsa-lib
depends = jack depends = jack
@@ -43,9 +44,9 @@ pkgbase = ffmpeg-full
depends = openjpeg2 depends = openjpeg2
depends = opus depends = opus
depends = pulseaudio depends = pulseaudio
depends = librsvg
depends = rubberband depends = rubberband
depends = rtmpdump depends = rtmpdump
depends = schroedinger
depends = smbclient depends = smbclient
depends = snappy depends = snappy
depends = libsoxr depends = libsoxr
@@ -64,11 +65,11 @@ pkgbase = ffmpeg-full
depends = x265 depends = x265
depends = libxcb depends = libxcb
depends = xvidcore depends = xvidcore
depends = libxml2
depends = zimg depends = zimg
depends = zeromq depends = zeromq
depends = zvbi depends = zvbi
depends = xz depends = xz
depends = netcdf
depends = openal depends = openal
depends = opencl-icd-loader depends = opencl-icd-loader
depends = mesa depends = mesa
@@ -85,13 +86,13 @@ pkgbase = ffmpeg-full
depends = flite1 depends = flite1
depends = libilbc depends = libilbc
depends = kvazaar depends = kvazaar
depends = nut-multimedia-git
depends = openh264 depends = openh264
depends = libopenmpt-svn depends = libopenmpt-svn
depends = sndio depends = sndio
depends = shine depends = shine
depends = vo-amrwbenc depends = vo-amrwbenc
depends = xavs depends = xavs
depends = libmysofa
provides = ffmpeg provides = ffmpeg
provides = ffmpeg-full-nvenc provides = ffmpeg-full-nvenc
provides = ffmpeg-nvenc provides = ffmpeg-nvenc
@@ -116,15 +117,12 @@ pkgbase = ffmpeg-full
conflicts = ffmpeg-full-git conflicts = ffmpeg-full-git
conflicts = ffmpeg-semifull-git conflicts = ffmpeg-semifull-git
conflicts = ffmpeg-qsv-git conflicts = ffmpeg-qsv-git
source = https://ffmpeg.org/releases/ffmpeg-3.3.4.tar.xz source = https://ffmpeg.org/releases/ffmpeg-3.4.tar.xz
source = ffmpeg-openjpeg2.2.patch
source = ffmpeg-openjpeg2.3.patch
source = LICENSE source = LICENSE
sha256sums = 98b97e1b908dfeb6aeb6d407e5a5eacdfc253a40c2d195f5867ed2d1d46ea957 sha256sums = aeee06e4d8b18d852c61ebbfe5e1bb7014b1e118e8728c1c2115f91e51bffbef
sha256sums = 490598f78d7879af8ef5b8d7f92ada83d0ee64f9609f6c7b989eb331c2539f68
sha256sums = b69a99b11de840f3a5d8e1ded7d4cc8c22cee7aef0b04df82046c8652ec2d40d
sha256sums = 04a7176400907fd7db0d69116b99de49e582a6e176b3bfb36a03e50a4cb26a36 sha256sums = 04a7176400907fd7db0d69116b99de49e582a6e176b3bfb36a03e50a4cb26a36
depends_x86_64 = cuda depends_x86_64 = cuda
depends_x86_64 = nvidia-utils
optdepends_x86_64 = intel-media-sdk: for Intel QSV support (experimental) optdepends_x86_64 = intel-media-sdk: for Intel QSV support (experimental)
pkgname = ffmpeg-full pkgname = ffmpeg-full
+44 -31
View File
@@ -1,10 +1,14 @@
# Maintainer : Daniel Bermond < yahoo-com: danielbermond > # Maintainer : Daniel Bermond < yahoo-com: danielbermond >
# Contributor: Iacopo Isimbaldi <isiachi@rhye.it> # Contributor: Iacopo Isimbaldi <isiachi@rhye.it>
# NOTE:
# To enable NewTek NDI (libndi), install the package 'ndi-sdk'
# and add '--enable-libndi_newtek' to the configure options.
pkgname=ffmpeg-full pkgname=ffmpeg-full
_srcname=ffmpeg _srcname=ffmpeg
pkgver=3.3.4 pkgver=3.4
pkgrel=2 pkgrel=1
pkgdesc='Record, convert and stream audio and video (all possible features including nvenc, qsv and libfdk-aac)' pkgdesc='Record, convert and stream audio and video (all possible features including nvenc, qsv and libfdk-aac)'
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url='http://www.ffmpeg.org/' url='http://www.ffmpeg.org/'
@@ -16,25 +20,25 @@ depends=(
'libbluray' 'libcaca' 'celt' 'libcdio-paranoia' 'libdc1394' 'libavc1394' 'libbluray' 'libcaca' 'celt' 'libcdio-paranoia' 'libdc1394' 'libavc1394'
'libfdk-aac' 'fontconfig' 'freetype2' 'fribidi' 'libgme' 'gsm' 'libiec61883' 'libfdk-aac' 'fontconfig' 'freetype2' 'fribidi' 'libgme' 'gsm' 'libiec61883'
'libmodplug' 'lame' 'opencore-amr' 'opencv' 'openjpeg2' 'opus' 'pulseaudio' 'libmodplug' 'lame' 'opencore-amr' 'opencv' 'openjpeg2' 'opus' 'pulseaudio'
'rubberband' 'rtmpdump' 'schroedinger' 'smbclient' 'snappy' 'libsoxr' 'speex' 'librsvg' 'rubberband' 'rtmpdump' 'smbclient' 'snappy' 'libsoxr' 'speex'
'libssh' 'tesseract' 'libtheora' 'twolame' 'v4l-utils' 'vid.stab' 'libvorbis' 'libssh' 'tesseract' 'libtheora' 'twolame' 'v4l-utils' 'vid.stab' 'libvorbis'
'libvpx' 'wavpack' 'libwebp' 'libx264.so' 'x265' 'libxcb' 'xvidcore' 'zimg' 'libvpx' 'wavpack' 'libwebp' 'libx264.so' 'x265' 'libxcb' 'xvidcore' 'libxml2'
'zeromq' 'zvbi' 'xz' 'netcdf' 'openal' 'opencl-icd-loader' 'mesa' 'openssl' 'zimg' 'zeromq' 'zvbi' 'xz' 'openal' 'opencl-icd-loader' 'mesa' 'openssl'
'sdl2' 'libx11' 'zlib' 'libomxil-bellagio' 'libva' 'libdrm' 'libvdpau' 'sdl2' 'libx11' 'zlib' 'libomxil-bellagio' 'libva' 'libdrm' 'libvdpau'
# AUR: # AUR:
'chromaprint-fftw' 'libbs2b' 'flite1' 'libilbc' 'kvazaar' 'nut-multimedia-git' 'chromaprint-fftw' 'libbs2b' 'flite1' 'libilbc' 'kvazaar' 'openh264'
'openh264' 'libopenmpt-svn' 'sndio' 'shine' 'vo-amrwbenc' 'xavs' 'libopenmpt-svn' 'sndio' 'shine' 'vo-amrwbenc' 'xavs' 'libmysofa'
) )
depends_x86_64=('cuda') depends_x86_64=('cuda' 'nvidia-utils')
optdepends_x86_64=( optdepends_x86_64=(
# AUR: # AUR:
'intel-media-sdk: for Intel QSV support (experimental)' 'intel-media-sdk: for Intel QSV support (experimental)'
) )
makedepends=( makedepends=(
# official repositories: # official repositories:
'yasm' 'opencl-headers' 'nasm' 'opencl-headers'
# AUR: # AUR:
'blackmagic-decklink-sdk' 'libmfx' 'blackmagic-decklink-sdk' 'libmfx' 'libvmaf'
) )
provides=( provides=(
'ffmpeg' 'ffmpeg-full-nvenc' 'ffmpeg-nvenc' 'ffmpeg-libfdk_aac' 'ffmpeg-decklink' 'ffmpeg' 'ffmpeg-full-nvenc' 'ffmpeg-nvenc' 'ffmpeg-libfdk_aac' 'ffmpeg-decklink'
@@ -47,31 +51,35 @@ conflicts=(
'ffmpeg-git' 'ffmpeg-full-git' 'ffmpeg-semifull-git' 'ffmpeg-qsv-git' 'ffmpeg-git' 'ffmpeg-full-git' 'ffmpeg-semifull-git' 'ffmpeg-qsv-git'
) )
source=("https://ffmpeg.org/releases/ffmpeg-${pkgver}.tar.xz" source=("https://ffmpeg.org/releases/ffmpeg-${pkgver}.tar.xz"
'ffmpeg-openjpeg2.2.patch'
'ffmpeg-openjpeg2.3.patch'
'LICENSE') 'LICENSE')
sha256sums=('98b97e1b908dfeb6aeb6d407e5a5eacdfc253a40c2d195f5867ed2d1d46ea957' sha256sums=('aeee06e4d8b18d852c61ebbfe5e1bb7014b1e118e8728c1c2115f91e51bffbef'
'490598f78d7879af8ef5b8d7f92ada83d0ee64f9609f6c7b989eb331c2539f68'
'b69a99b11de840f3a5d8e1ded7d4cc8c22cee7aef0b04df82046c8652ec2d40d'
'04a7176400907fd7db0d69116b99de49e582a6e176b3bfb36a03e50a4cb26a36') '04a7176400907fd7db0d69116b99de49e582a6e176b3bfb36a03e50a4cb26a36')
prepare() {
cd "${_srcname}-${pkgver}"
patch -Np1 -i "${srcdir}/ffmpeg-openjpeg2.2.patch"
patch -Np1 -i "${srcdir}/ffmpeg-openjpeg2.3.patch"
}
build() { build() {
cd "${_srcname}-${pkgver}" cd "${_srcname}-${pkgver}"
# set x86_64 specific options # set x86_64 specific options
if [ "$CARCH" = 'x86_64' ] if [ "$CARCH" = 'x86_64' ]
then then
_cuda='--enable-cuda' local _cuda='--enable-cuda'
_cuvid='--enable-cuvid' local _cudasdk='--enable-cuda-sdk'
_libnpp='--enable-libnpp' local _cuvid='--enable-cuvid'
_cflags='--extra-cflags=-I/opt/cuda/include' local _libnpp='--enable-libnpp'
_ldflags='--extra-ldflags=-L/opt/cuda/lib64 -Wl,-rpath -Wl,/opt/intel/mediasdk/lib64:/opt/intel/mediasdk/plugins' local _cflags='--extra-cflags=-I/opt/cuda/include'
# '-L/usr/lib/nvidia' (for cuda_sdk) needs to be enabled only on
# systems with nvidia-340xx-utils or nvidia-304xx-utils
if pacman -Qqs '^nvidia-340xx-utils$' | grep -q '^nvidia-340xx-utils$' ||
pacman -Qqs '^nvidia-304xx-utils$' | grep -q '^nvidia-304xx-utils$'
then
local _nvidia_340xx_ldflags='-L/usr/lib/nvidia'
fi
local _ldflags="--extra-ldflags=-L/opt/cuda/lib64 ${_nvidia_340xx_ldflags}"
local _ldflags="${_ldflags} -Wl,-rpath -Wl,/opt/intel/mediasdk/lib64:/opt/intel/mediasdk/plugins"
# strictly specifying nvcc path is needed if package is installing
# cuda for the first time (nvcc path will be in $PATH only after relogin)
sed -i "s@^nvcc_default=.*@nvcc_default='/opt/cuda/bin/nvcc'@" configure
fi fi
msg2 'Running ffmpeg configure script. Please wait...' msg2 'Running ffmpeg configure script. Please wait...'
@@ -90,6 +98,7 @@ build() {
--enable-gray \ --enable-gray \
--enable-avresample \ --enable-avresample \
\ \
--enable-alsa \
--enable-avisynth \ --enable-avisynth \
--enable-bzlib \ --enable-bzlib \
--enable-chromaprint \ --enable-chromaprint \
@@ -98,6 +107,7 @@ build() {
--enable-gmp \ --enable-gmp \
--enable-gnutls \ --enable-gnutls \
--enable-iconv \ --enable-iconv \
--enable-jack \
--enable-ladspa \ --enable-ladspa \
--enable-libass \ --enable-libass \
--enable-libbluray \ --enable-libbluray \
@@ -118,7 +128,6 @@ build() {
--enable-libkvazaar \ --enable-libkvazaar \
--enable-libmodplug \ --enable-libmodplug \
--enable-libmp3lame \ --enable-libmp3lame \
--enable-libnut \
--enable-libopencore-amrnb \ --enable-libopencore-amrnb \
--enable-libopencore-amrwb \ --enable-libopencore-amrwb \
--enable-libopencv \ --enable-libopencv \
@@ -127,9 +136,9 @@ build() {
--enable-libopenmpt \ --enable-libopenmpt \
--enable-libopus \ --enable-libopus \
--enable-libpulse \ --enable-libpulse \
--enable-librsvg \
--enable-librubberband \ --enable-librubberband \
--enable-librtmp \ --enable-librtmp \
--enable-libschroedinger \
--enable-libshine \ --enable-libshine \
--enable-libsmbclient \ --enable-libsmbclient \
--enable-libsnappy \ --enable-libsnappy \
@@ -141,6 +150,7 @@ build() {
--enable-libtwolame \ --enable-libtwolame \
--enable-libv4l2 \ --enable-libv4l2 \
--enable-libvidstab \ --enable-libvidstab \
--enable-libvmaf \
--enable-libvo-amrwbenc \ --enable-libvo-amrwbenc \
--enable-libvorbis \ --enable-libvorbis \
--enable-libvpx \ --enable-libvpx \
@@ -154,30 +164,33 @@ build() {
--enable-libxcb-xfixes \ --enable-libxcb-xfixes \
--enable-libxcb-shape \ --enable-libxcb-shape \
--enable-libxvid \ --enable-libxvid \
--enable-libxml2 \
--enable-libzimg \ --enable-libzimg \
--enable-libzmq \ --enable-libzmq \
--enable-libzvbi \ --enable-libzvbi \
--enable-lzma \ --enable-lzma \
--enable-decklink \ --enable-decklink \
--enable-netcdf \ --enable-libmysofa \
--enable-openal \ --enable-openal \
--enable-opencl \ --enable-opencl \
--enable-opengl \ --enable-opengl \
--enable-openssl \ --enable-openssl \
--enable-sndio \
--enable-sdl2 \ --enable-sdl2 \
--enable-xlib \ --enable-xlib \
--enable-zlib \ --enable-zlib \
\ \
$_cuda \ $_cuda \
$_cudasdk \
$_cuvid \ $_cuvid \
--enable-libdrm \
--enable-libmfx \ --enable-libmfx \
$_libnpp \ $_libnpp \
--enable-nvenc \ --enable-nvenc \
--enable-omx \ --enable-omx \
--enable-omx-rpi \ --enable-omx-rpi \
--enable-vaapi \ --enable-vaapi \
--enable-vdpau \ --enable-vdpau
--enable-videotoolbox
make make
make tools/qt-faststart make tools/qt-faststart
} }
-95
View File
@@ -1,95 +0,0 @@
diff -rupN ffmpeg-3.3.3.orig/configure ffmpeg-3.3.3/configure
--- ffmpeg-3.3.3.orig/configure 2017-07-29 19:49:29.000000000 +0200
+++ ffmpeg-3.3.3/configure 2017-08-15 13:21:28.782566614 +0200
@@ -1875,6 +1875,7 @@ HEADERS_LIST="
machine_ioctl_meteor_h
malloc_h
opencv2_core_core_c_h
+ openjpeg_2_2_openjpeg_h
openjpeg_2_1_openjpeg_h
openjpeg_2_0_openjpeg_h
openjpeg_1_5_openjpeg_h
@@ -5805,7 +5806,9 @@ enabled libopencv && { check_hea
require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
-enabled libopenjpeg && { { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+enabled libopenjpeg && { { check_lib openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+ check_lib openjpeg-2.2/openjpeg.h opj_version -lopenjp2 ||
+ { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
{ check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
{ check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
diff -rupN ffmpeg-3.3.3.orig/libavcodec/libopenjpegdec.c ffmpeg-3.3.3/libavcodec/libopenjpegdec.c
--- ffmpeg-3.3.3.orig/libavcodec/libopenjpegdec.c 2017-07-29 19:49:30.000000000 +0200
+++ ffmpeg-3.3.3/libavcodec/libopenjpegdec.c 2017-08-15 13:21:28.869233484 +0200
@@ -34,7 +34,9 @@
#include "internal.h"
#include "thread.h"
-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
+#if HAVE_OPENJPEG_2_2_OPENJPEG_H
+# include <openjpeg-2.2/openjpeg.h>
+#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
# include <openjpeg-2.1/openjpeg.h>
#elif HAVE_OPENJPEG_2_0_OPENJPEG_H
# include <openjpeg-2.0/openjpeg.h>
@@ -44,7 +46,7 @@
# include <openjpeg.h>
#endif
-#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
+#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
# define OPENJPEG_MAJOR_VERSION 2
# define OPJ(x) OPJ_##x
#else
@@ -429,7 +431,7 @@ static int libopenjpeg_decode_frame(AVCo
opj_stream_set_read_function(stream, stream_read);
opj_stream_set_skip_function(stream, stream_skip);
opj_stream_set_seek_function(stream, stream_seek);
-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
+#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
opj_stream_set_user_data(stream, &reader, NULL);
#elif HAVE_OPENJPEG_2_0_OPENJPEG_H
opj_stream_set_user_data(stream, &reader);
diff -rupN ffmpeg-3.3.3.orig/libavcodec/libopenjpegenc.c ffmpeg-3.3.3/libavcodec/libopenjpegenc.c
--- ffmpeg-3.3.3.orig/libavcodec/libopenjpegenc.c 2017-07-29 19:49:30.000000000 +0200
+++ ffmpeg-3.3.3/libavcodec/libopenjpegenc.c 2017-08-15 13:21:28.869233484 +0200
@@ -32,7 +32,9 @@
#include "avcodec.h"
#include "internal.h"
-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
+#if HAVE_OPENJPEG_2_2_OPENJPEG_H
+# include <openjpeg-2.2/openjpeg.h>
+#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
# include <openjpeg-2.1/openjpeg.h>
#elif HAVE_OPENJPEG_2_0_OPENJPEG_H
# include <openjpeg-2.0/openjpeg.h>
@@ -42,7 +44,7 @@
# include <openjpeg.h>
#endif
-#if HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
+#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
# define OPENJPEG_MAJOR_VERSION 2
# define OPJ(x) OPJ_##x
#else
@@ -305,7 +307,7 @@ static av_cold int libopenjpeg_encode_in
opj_set_default_encoder_parameters(&ctx->enc_params);
-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
+#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
switch (ctx->cinema_mode) {
case OPJ_CINEMA2K_24:
ctx->enc_params.rsiz = OPJ_PROFILE_CINEMA_2K;
@@ -769,7 +771,7 @@ static int libopenjpeg_encode_frame(AVCo
opj_stream_set_write_function(stream, stream_write);
opj_stream_set_skip_function(stream, stream_skip);
opj_stream_set_seek_function(stream, stream_seek);
-#if HAVE_OPENJPEG_2_1_OPENJPEG_H
+#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
opj_stream_set_user_data(stream, &writer, NULL);
#elif HAVE_OPENJPEG_2_0_OPENJPEG_H
opj_stream_set_user_data(stream, &writer);
-97
View File
@@ -1,97 +0,0 @@
diff -Narup a/configure b/configure
--- a/configure 2017-10-10 12:51:06.000000000 -0300
+++ b/configure 2017-10-10 13:11:15.512362438 -0300
@@ -1875,6 +1875,7 @@ HEADERS_LIST="
machine_ioctl_meteor_h
malloc_h
opencv2_core_core_c_h
+ openjpeg_2_3_openjpeg_h
openjpeg_2_2_openjpeg_h
openjpeg_2_1_openjpeg_h
openjpeg_2_0_openjpeg_h
@@ -5806,7 +5807,9 @@ enabled libopencv && { check_hea
require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
-enabled libopenjpeg && { { check_lib openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+enabled libopenjpeg && { { check_lib libopenjpeg openjpeg-2.3/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+ check_lib libopenjpeg openjpeg-2.3/openjpeg.h opj_version -lopenjp2 ||
+ { check_lib libopenjpeg openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
check_lib openjpeg-2.2/openjpeg.h opj_version -lopenjp2 ||
{ check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index 1210123265f..67d47bd6a0a 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/libavcodec/libopenjpegdec.c
@@ -34,7 +34,9 @@
#include "internal.h"
#include "thread.h"
-#if HAVE_OPENJPEG_2_2_OPENJPEG_H
+#if HAVE_OPENJPEG_2_3_OPENJPEG_H
+# include <openjpeg-2.3/openjpeg.h>
+#elif HAVE_OPENJPEG_2_2_OPENJPEG_H
# include <openjpeg-2.2/openjpeg.h>
#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
# include <openjpeg-2.1/openjpeg.h>
@@ -46,7 +48,7 @@
# include <openjpeg.h>
#endif
-#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
+#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
# define OPENJPEG_MAJOR_VERSION 2
# define OPJ(x) OPJ_##x
#else
@@ -431,7 +433,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
opj_stream_set_read_function(stream, stream_read);
opj_stream_set_skip_function(stream, stream_skip);
opj_stream_set_seek_function(stream, stream_seek);
-#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
+#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
opj_stream_set_user_data(stream, &reader, NULL);
#elif HAVE_OPENJPEG_2_0_OPENJPEG_H
opj_stream_set_user_data(stream, &reader);
diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index b67e533d1da..92b4433b047 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -32,7 +32,9 @@
#include "avcodec.h"
#include "internal.h"
-#if HAVE_OPENJPEG_2_2_OPENJPEG_H
+#if HAVE_OPENJPEG_2_3_OPENJPEG_H
+# include <openjpeg-2.3/openjpeg.h>
+#elif HAVE_OPENJPEG_2_2_OPENJPEG_H
# include <openjpeg-2.2/openjpeg.h>
#elif HAVE_OPENJPEG_2_1_OPENJPEG_H
# include <openjpeg-2.1/openjpeg.h>
@@ -44,7 +46,7 @@
# include <openjpeg.h>
#endif
-#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
+#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H
# define OPENJPEG_MAJOR_VERSION 2
# define OPJ(x) OPJ_##x
#else
@@ -307,7 +309,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
opj_set_default_encoder_parameters(&ctx->enc_params);
-#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
+#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
switch (ctx->cinema_mode) {
case OPJ_CINEMA2K_24:
ctx->enc_params.rsiz = OPJ_PROFILE_CINEMA_2K;
@@ -771,7 +773,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
opj_stream_set_write_function(stream, stream_write);
opj_stream_set_skip_function(stream, stream_skip);
opj_stream_set_seek_function(stream, stream_seek);
-#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
+#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H
opj_stream_set_user_data(stream, &writer, NULL);
#elif HAVE_OPENJPEG_2_0_OPENJPEG_H
opj_stream_set_user_data(stream, &writer);