1
0
forked from pool/ffmpeg-4

Accepting request 676669 from home:plater

Update 0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch from git
  To fix build with SVT-AV1.

OBS-URL: https://build.opensuse.org/request/show/676669
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/ffmpeg-4?expand=0&rev=43
This commit is contained in:
Dave Plater 2019-02-16 14:13:37 +00:00 committed by Git OBS Bridge
parent 57cf8afc5c
commit 1595b455e4
4 changed files with 41 additions and 32 deletions

View File

@ -1,20 +1,23 @@
From 7951dc4c7e8461da1ca003776ebd318d631ee6cb Mon Sep 17 00:00:00 2001
From 976b0ab59e4eb5242729d960539cb2714c6cba28 Mon Sep 17 00:00:00 2001
From: Daryl Seah <daryl.seah@intel.com>
Date: Fri, 18 Jan 2019 02:11:38 +0000
Subject: [PATCH] Add ability for ffmpeg to run svt-av1
Subject: [PATCH 1/1] Add ability for ffmpeg to run svt-av1
Change-Id: I37ee5414fdd99e0b3f112a6e5ede166f3e48d819
Signed-off-by: Daryl Seah <daryl.seah@intel.com>
Signed-off-by: Jing SUN <jing.a.sun@intel.com>
---
configure | 4 +
libavcodec/Makefile | 1 +
libavcodec/allcodecs.c | 1 +
libavcodec/libsvt_av1.c | 498 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 504 insertions(+)
libavcodec/libsvt_av1.c | 491 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 497 insertions(+)
create mode 100644 libavcodec/libsvt_av1.c
Index: ffmpeg-4.1/configure
===================================================================
--- ffmpeg-4.1.orig/configure
+++ ffmpeg-4.1/configure
diff --git a/configure b/configure
index a70c5f9..5b5238a 100755
--- a/configure
+++ b/configure
@@ -262,6 +262,7 @@ External library support:
--enable-libspeex enable Speex de/encoding via libspeex [no]
--enable-libsrt enable Haivision SRT protocol via libsrt [no]
@ -31,7 +34,7 @@ Index: ffmpeg-4.1/configure
libtensorflow
libtesseract
libtheora
@@ -3124,6 +3126,7 @@ libshine_encoder_select="audio_frame_que
@@ -3125,6 +3127,7 @@ libshine_encoder_select="audio_frame_queue"
libspeex_decoder_deps="libspeex"
libspeex_encoder_deps="libspeex"
libspeex_encoder_select="audio_frame_queue"
@ -39,7 +42,7 @@ Index: ffmpeg-4.1/configure
libtheora_encoder_deps="libtheora"
libtwolame_encoder_deps="libtwolame"
libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
@@ -6134,6 +6137,7 @@ enabled libsoxr && require lib
@@ -6135,6 +6138,7 @@ enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
@ -47,11 +50,11 @@ Index: ffmpeg-4.1/configure
enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
Index: ffmpeg-4.1/libavcodec/Makefile
===================================================================
--- ffmpeg-4.1.orig/libavcodec/Makefile
+++ ffmpeg-4.1/libavcodec/Makefile
@@ -981,6 +981,7 @@ OBJS-$(CONFIG_LIBOPUS_ENCODER)
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3e41497..9b2e663 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -981,6 +981,7 @@ OBJS-$(CONFIG_LIBOPUS_ENCODER) += libopusenc.o libopus.o \
OBJS-$(CONFIG_LIBSHINE_ENCODER) += libshine.o
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
@ -59,10 +62,10 @@ Index: ffmpeg-4.1/libavcodec/Makefile
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
Index: ffmpeg-4.1/libavcodec/allcodecs.c
===================================================================
--- ffmpeg-4.1.orig/libavcodec/allcodecs.c
+++ ffmpeg-4.1/libavcodec/allcodecs.c
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 1b8144a..f7df66c 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -697,6 +697,7 @@ extern AVCodec ff_librsvg_decoder;
extern AVCodec ff_libshine_encoder;
extern AVCodec ff_libspeex_encoder;
@ -71,11 +74,12 @@ Index: ffmpeg-4.1/libavcodec/allcodecs.c
extern AVCodec ff_libtheora_encoder;
extern AVCodec ff_libtwolame_encoder;
extern AVCodec ff_libvo_amrwbenc_encoder;
Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
===================================================================
diff --git a/libavcodec/libsvt_av1.c b/libavcodec/libsvt_av1.c
new file mode 100644
index 0000000..1eba049
--- /dev/null
+++ ffmpeg-4.1/libavcodec/libsvt_av1.c
@@ -0,0 +1,498 @@
+++ b/libavcodec/libsvt_av1.c
@@ -0,0 +1,491 @@
+/*
+* Scalable Video Technology for AV1 encoder library plugin
+*
@ -122,7 +126,6 @@ Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
+ int eos_flag;
+
+ // User options.
+ int vui_info;
+ int hierarchical_level;
+ int la_depth;
+ int enc_mode;
@ -274,9 +277,6 @@ Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
+ param->intra_refresh_type =
+ !!(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP) + 1;
+
+ if (svt_enc->vui_info)
+ param->video_usability_info = svt_enc->vui_info;
+
+ if (svt_enc->la_depth != -1)
+ param->look_ahead_distance = svt_enc->la_depth;
+
@ -477,9 +477,6 @@ Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
+#define OFFSET(x) offsetof(SvtContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "vui", "Enable vui info", OFFSET(vui_info),
+ AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
+
+ { "aud", "Include AUD", OFFSET(aud),
+ AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
+
@ -574,3 +571,6 @@ Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
+ .wrapper_name = "libsvt_av1",
+};
--
1.8.3.1

View File

@ -18,6 +18,7 @@ libopenjpeg # openjpeg
libopus # opus
libschroedinger # schroedinger
libspeex # speex
libsvt_av1 # AV1
libtheora # libtheora
libtwolame # twolame
libvorbis # libvorbis

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Feb 16 12:41:43 UTC 2019 - davejplater@gmail.com
- Update 0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch from git
To fix build with SVT-AV1.
-------------------------------------------------------------------
Sat Feb 16 12:36:08 UTC 2019 - Jan Engelhardt <jengelh@inai.de>

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@ -129,7 +129,7 @@ BuildRequires: libmysofa-devel
%endif
%if %{with svt_av1}
%ifarch x86_64
BuildRequires: SVT-AV1-devel
BuildRequires: pkgconfig(SvtAv1Enc)
%endif
%endif
BuildRequires: nasm
@ -634,8 +634,10 @@ CFLAGS="%optflags" \
%if %{with srt}
--enable-libsrt \
%endif
%if %{with svt_av1}
%ifarch x86_64
--enable-libsvtav1 \
%endif
%endif
--enable-libtheora \
--enable-libtwolame \