summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Kharitonov2016-07-20 14:48:11 +0500
committerDmitry Kharitonov2016-07-20 14:48:11 +0500
commita4aa7ff508521f39789e12986be4e766f6995f52 (patch)
tree05a6ac670cae19a4505cb3fe889f0011e774eba0
parent6339d95d3c1a2e52168b7dee4a2f3c7f7a5d0959 (diff)
downloadaur-a4aa7ff508521f39789e12986be4e766f6995f52.tar.gz
Added the patch to fix compiling with openh264 1.6; forced rebuild against x265 2.0
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD9
-rw-r--r--openh264-1.6-fix.patch160
3 files changed, 172 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 13ab40a38b9b..12b4cf0ee7ec 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Sun Jul 17 09:58:23 UTC 2016
+# Wed Jul 20 09:46:36 UTC 2016
pkgbase = ffmpeg-full-nvenc
pkgdesc = Record, convert, and stream audio and video (all codecs including Nvidia NVENC)
pkgver = 3.1.1
- pkgrel = 5
+ pkgrel = 6
epoch = 1
url = http://ffmpeg.org/
arch = i686
@@ -111,9 +111,11 @@ pkgbase = ffmpeg-full-nvenc
conflicts = ffmpeg-full-extra
source = http://ffmpeg.org/releases/ffmpeg-3.1.1.tar.bz2
source = http://ffmpeg.org/releases/ffmpeg-3.1.1.tar.bz2.asc
+ source = openh264-1.6-fix.patch
source = UNREDISTRIBUTABLE.txt
sha256sums = a5bca50a90a37b983eaa17c483a387189175f37ca678ae7e51d43e7610b4b3b4
sha256sums = SKIP
+ sha256sums = 5120e4ff1399d454f9232f5d379d2f20930f2d89915b9d332a6594b2be830778
sha256sums = e0c1b126862072a71e18b9580a6b01afc76a54aa6e642d2c413ba0ac9d3010c4
depends_x86_64 = cuda
optdepends_x86_64 = intel-media-sdk: for Intel QSV support (Experimental! See PKGBUILD of that package for additional info)
diff --git a/PKGBUILD b/PKGBUILD
index a26e2bc1ccfd..bba265960623 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,7 +17,7 @@
pkgname=ffmpeg-full-nvenc
_pkgbasename=ffmpeg
pkgver=3.1.1
-pkgrel=5
+pkgrel=6
epoch=1
pkgdesc="Record, convert, and stream audio and video (all codecs including Nvidia NVENC)"
arch=('i686' 'x86_64')
@@ -45,12 +45,19 @@ provides=('libavcodec.so' 'libavdevice.so' 'libavfilter.so' 'libavformat.so'
'libavresample.so' 'libavutil.so' 'libpostproc.so' 'libswresample.so'
'libswscale.so' 'ffmpeg' 'qt-faststart')
source=(http://ffmpeg.org/releases/$_pkgbasename-$pkgver.tar.bz2{,.asc}
+ 'openh264-1.6-fix.patch'
'UNREDISTRIBUTABLE.txt')
validpgpkeys=('FCF986EA15E6E293A5644F10B4322F04D67658D8')
sha256sums=('a5bca50a90a37b983eaa17c483a387189175f37ca678ae7e51d43e7610b4b3b4'
'SKIP'
+ '5120e4ff1399d454f9232f5d379d2f20930f2d89915b9d332a6594b2be830778'
'e0c1b126862072a71e18b9580a6b01afc76a54aa6e642d2c413ba0ac9d3010c4')
+prepare() {
+ cd "$_pkgbasename-$pkgver"
+ git apply ../openh264-1.6-fix.patch
+}
+
build() {
cd $_pkgbasename-$pkgver
diff --git a/openh264-1.6-fix.patch b/openh264-1.6-fix.patch
new file mode 100644
index 000000000000..7237454cd013
--- /dev/null
+++ b/openh264-1.6-fix.patch
@@ -0,0 +1,160 @@
+---
+ configure | 2 +-
+ doc/encoders.texi | 25 ++++++++++++++---------
+ libavcodec/libopenh264enc.c | 48 ++++++++++++++++++++++-----------------------
+ libavcodec/version.h | 2 +-
+ 4 files changed, 42 insertions(+), 35 deletions(-)
+
+diff --git a/configure b/configure
+index f28aa8f..4bffd0f 100755
+--- a/configure
++++ b/configure
+@@ -5569,7 +5569,7 @@ enabled libopencv && { check_header opencv2/core/core_c.h &&
+ { use_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
+ 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 libopenh264 && require_pkg_config "openh264 >= 1.6" wels/codec_api.h WelsGetCodecVersion
+ enabled libopenjpeg && { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
+ check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
+ check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
+diff --git a/doc/encoders.texi b/doc/encoders.texi
+index f38cad3..dfab007 100644
+--- a/doc/encoders.texi
++++ b/doc/encoders.texi
+@@ -1393,16 +1393,18 @@ Set slice mode. Can assume one of the follwing possible values:
+
+ @table @samp
+ @item fixed
+-a fixed number of slices
+-@item rowmb
+-one slice per row of macroblocks
+-@item auto
+-automatic number of slices according to number of threads
+-@item dyn
+-dynamic slicing
++use a fixed numer of slices, depending on the value of
++@option{slices}. If set to 0, the number of slices is automatically
++selected.
++@item raster
++use a fixed number of macro-blocks per slice. The number of MBs is set
++through @option{slice_mbs}.
++@item sizelimited
++set slicing according to size. The slice size is set through
++@option{max_nal_size}.
+ @end table
+
+-Default value is @samp{auto}.
++Default value is @samp{fixed}.
+
+ @item loopfilter
+ Enable loop filter, if set to 1 (automatically enabled). To disable
+@@ -1414,7 +1416,12 @@ Set profile restrictions. If set to the value of @samp{main} enable
+ CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
+
+ @item max_nal_size
+-Set maximum NAL size in bytes.
++Set maximum nal size in bytes. This is only used when
++@option{slice_mode} is set to @samp{sizelimited}.
++
++@item slice_mbs
++Set number of MBs per slice. This is only used when
++@option{slice_mode} is set to @samp{raster}.
+
+ @item allow_skip_frames
+ Allow skipping frames to hit the target bitrate if set to 1.
+diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
+index 6850568..0c1b1b8 100644
+--- a/libavcodec/libopenh264enc.c
++++ b/libavcodec/libopenh264enc.c
+@@ -39,6 +39,7 @@ typedef struct SVCContext {
+ int loopfilter;
+ char *profile;
+ int max_nal_size;
++ int slice_mbs;
+ int skip_frames;
+ int skipped;
+ int cabac;
+@@ -51,14 +52,14 @@ typedef struct SVCContext {
+ #define OFFSET(x) offsetof(SVCContext, x)
+ #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+ static const AVOption options[] = {
+- { "slice_mode", "set slice mode", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE, "slice_mode" },
+- { "fixed", "a fixed number of slices", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" },
+- { "rowmb", "one slice per row of macroblocks", 0, AV_OPT_TYPE_CONST, { .i64 = SM_ROWMB_SLICE }, 0, 0, VE, "slice_mode" },
+- { "auto", "automatic number of slices according to number of threads", 0, AV_OPT_TYPE_CONST, { .i64 = SM_AUTO_SLICE }, 0, 0, VE, "slice_mode" },
+- { "dyn", "Dynamic slicing", 0, AV_OPT_TYPE_CONST, { .i64 = SM_DYN_SLICE }, 0, 0, VE, "slice_mode" },
++ { "slice_mode", "set slice mode", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_FIXEDSLCNUM_SLICE }, SM_FIXEDSLCNUM_SLICE, SM_RESERVED, VE, "slice_mode" },
++ { "fixed", "set a fixed number of slices, depending on slices option", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" },
++ { "raster", "set a fixed number of MB per slice, depending on slice_mb option", 0, AV_OPT_TYPE_CONST, { .i64 = SM_RASTER_SLICE }, 0, 0, VE, "slice_mode" },
++ { "sizelimited", "set slice according to size", 0, AV_OPT_TYPE_CONST, { .i64 = SM_SIZELIMITED_SLICE }, 0, 0, VE, "slice_mode" },
+ { "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
+ { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VE },
+- { "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
++ { "slice_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
++ { "slice_mbs", "set number of MBs per slice", OFFSET(slice_mbs), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+ { "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
+ { "cabac", "Enable cabac", OFFSET(cabac), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+ { NULL }
+@@ -184,29 +185,28 @@ FF_ENABLE_DEPRECATION_WARNINGS
+ param.sSpatialLayers[0].iSpatialBitrate = param.iTargetBitrate;
+ param.sSpatialLayers[0].iMaxSpatialBitrate = param.iMaxBitrate;
+
+- if ((avctx->slices > 1) && (s->max_nal_size)){
+- av_log(avctx,AV_LOG_ERROR,"Invalid combination -slices %d and -max_nal_size %d.\n",avctx->slices,s->max_nal_size);
+- goto fail;
+- }
+-
+- if (avctx->slices > 1)
+- s->slice_mode = SM_FIXEDSLCNUM_SLICE;
+-
+- if (s->max_nal_size)
+- s->slice_mode = SM_DYN_SLICE;
+-
+- param.sSpatialLayers[0].sSliceCfg.uiSliceMode = s->slice_mode;
+- param.sSpatialLayers[0].sSliceCfg.sSliceArgument.uiSliceNum = avctx->slices;
++ param.sSpatialLayers[0].sSliceArgument.uiSliceMode = s->slice_mode;
+
+- if (s->slice_mode == SM_DYN_SLICE) {
+- if (s->max_nal_size){
++ if (s->slice_mode == SM_FIXEDSLCNUM_SLICE) {
++ param.sSpatialLayers[0].sSliceArgument.uiSliceNum = avctx->slices;
++ } else if (s->slice_mode == SM_RASTER_SLICE) {
++ if (s->slice_mbs) {
++ param.sSpatialLayers[0].sSliceArgument.uiSliceMbNum[0] = s->slice_mbs;
++ } else {
++ av_log(avctx, AV_LOG_ERROR, "The value slice_mbs must be set to use slice_mode raster\n");
++ goto fail;
++ }
++ } else if (s->slice_mode == SM_SIZELIMITED_SLICE) {
++ if (s->max_nal_size) {
+ param.uiMaxNalSize = s->max_nal_size;
+- param.sSpatialLayers[0].sSliceCfg.sSliceArgument.uiSliceSizeConstraint = s->max_nal_size;
++ param.sSpatialLayers[0].sSliceArgument.uiSliceSizeConstraint = s->max_nal_size;
+ } else {
+- av_log(avctx, AV_LOG_ERROR, "Invalid -max_nal_size, "
+- "specify a valid max_nal_size to use -slice_mode dyn\n");
++ av_log(avctx, AV_LOG_ERROR, "The value max_nal_size must be set to use slice_mode sizelimited\n");
+ goto fail;
+ }
++ } else {
++ av_log(avctx, AV_LOG_ERROR, "Unknown or invalid selected slice mode %d\n", s->slice_mode);
++ goto fail;
+ }
+
+ if ((*s->encoder)->InitializeExt(s->encoder, &param) != cmResultSuccess) {
+diff --git a/libavcodec/version.h b/libavcodec/version.h
+index 95f4551..5df3ab2 100644
+--- a/libavcodec/version.h
++++ b/libavcodec/version.h
+@@ -29,7 +29,7 @@
+
+ #define LIBAVCODEC_VERSION_MAJOR 57
+ #define LIBAVCODEC_VERSION_MINOR 48
+-#define LIBAVCODEC_VERSION_MICRO 101
++#define LIBAVCODEC_VERSION_MICRO 102
+
+ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
+ LIBAVCODEC_VERSION_MINOR, \
+--
+1.9.1 \ No newline at end of file