Skip to content

Commit 59dd8c9

Browse files
committed
ffmpeg 7 -> 8
1 parent f474a9b commit 59dd8c9

File tree

3 files changed

+15
-46
lines changed

3 files changed

+15
-46
lines changed

ae.nimble

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ let x265 = Package(
118118
)
119119
let ffmpeg = Package(
120120
name: "ffmpeg",
121-
sourceUrl: "https://ffmpeg.org/releases/ffmpeg-7.1.1.tar.xz",
122-
sha256: "733984395e0dbbe5c046abda2dc49a5544e7e0e1e2366bba849222ae9e3a03b1",
121+
sourceUrl: "https://ffmpeg.org/releases/ffmpeg-8.0.tar.xz",
122+
sha256: "b2751fccb6cc4c77708113cd78b561059b6fa904b24162fa0be2d60273d27b8e",
123123
)
124124
var packages: seq[Package] = @[]
125125
if not defined(macosx):

patches/ffmpeg.patch

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,8 @@
1-
From d1ed5c06e3edc5f2b5f3664c80121fa55b0baa95 Mon Sep 17 00:00:00 2001
2-
From: Gyan Doshi <[email protected]>
3-
Date: Sat, 22 Feb 2025 10:38:53 +0530
4-
Subject: [PATCH] avcodec/libsvtav1: unbreak build with latest svtav1
5-
6-
SVT-AV1 made a change in their public API in 988e930c but without a
7-
version bump or any other accessible marker, thus breaking ffmpeg build
8-
with current versions of SVT-AV1.
9-
10-
They have finally bumped versions a month later, so check added.
11-
---
12-
libavcodec/libsvtav1.c | 4 ++++
13-
1 file changed, 4 insertions(+)
14-
15-
diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
16-
index 79b28eb4df54681a43bd4e8164784df84378e386..43fe531fde74dc058b63002cd704df5ef2c475f5 100644
17-
--- a/libavcodec/libsvtav1.c
18-
+++ b/libavcodec/libsvtav1.c
19-
@@ -435,7 +435,11 @@ static av_cold int eb_enc_init(AVCodecContext *avctx)
20-
21-
svt_enc->eos_flag = EOS_NOT_REACHED;
22-
23-
+#if SVT_AV1_CHECK_VERSION(3, 0, 0)
24-
+ svt_ret = svt_av1_enc_init_handle(&svt_enc->svt_handle, &svt_enc->enc_params);
25-
+#else
26-
svt_ret = svt_av1_enc_init_handle(&svt_enc->svt_handle, svt_enc, &svt_enc->enc_params);
27-
+#endif
28-
if (svt_ret != EB_ErrorNone) {
29-
return svt_print_error(avctx, svt_ret, "Error initializing encoder handle");
30-
}
31-
32-
331
diff --git a/configure b/configure
34-
index 0609dac4ab..aa65218e15 100755
2+
index 732de59292..136347a0d2 100755
353
--- a/configure
364
+++ b/configure
37-
@@ -1884,8 +1884,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
5+
@@ -1886,8 +1886,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
386
libdvdread
397
librubberband
408
libvidstab
@@ -43,13 +11,12 @@ index 0609dac4ab..aa65218e15 100755
4311
libxavs
4412
libxavs2
4513
libxvid
46-
@@ -1917,6 +1915,8 @@ EXTERNAL_LIBRARY_LIST="
47-
$EXTERNAL_LIBRARY_NONFREE_LIST
48-
$EXTERNAL_LIBRARY_VERSION3_LIST
49-
$EXTERNAL_LIBRARY_GPLV3_LIST
14+
@@ -1900,6 +1898,8 @@ EXTERNAL_LIBRARY_NONFREE_LIST="
15+
"
16+
17+
EXTERNAL_LIBRARY_VERSION3_LIST="
5018
+ libx264
5119
+ libx265
52-
chromaprint
53-
gcrypt
54-
gnutls
55-
20+
gmp
21+
libaribb24
22+
liblensfun

src/av.nim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,10 @@ proc open*(ctx: ptr AVCodecContext) =
369369
ctx.time_base = AVRational(num: 1, den: ctx.sample_rate)
370370
else:
371371
ctx.time_base = AVRational(num: 1, den: AV_TIME_BASE)
372-
if avcodec_open2(ctx, ctx.codec, nil) < 0:
373-
error "Could not open encoder"
372+
let ret = avcodec_open2(ctx, ctx.codec, nil)
373+
if ret < 0:
374+
let codecName = if ctx.codec != nil and ctx.codec.name != nil: $ctx.codec.name else: "unknown"
375+
error &"Could not open encoder '{codecName}': {av_err2str(ret)}"
374376

375377
proc setProfileOrErr*(ctx: ptr AVCodecContext, to: string) =
376378
if ctx.codec == nil:

0 commit comments

Comments
 (0)