File: ffmpeg.patch

package info (click to toggle)
paraview 5.13.2%2Bdfsg-3.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 544,660 kB
  • sloc: cpp: 3,374,605; ansic: 1,332,409; python: 150,381; xml: 122,166; sql: 65,887; sh: 7,317; javascript: 5,262; yacc: 4,417; java: 3,977; perl: 2,363; lex: 1,929; f90: 1,397; makefile: 170; objc: 153; tcl: 59; pascal: 50; fortran: 29
file content (58 lines) | stat: -rw-r--r-- 2,068 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From 34276346ac379fecbd615322f18de837bd2c9ea2 Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Fri, 28 Jan 2022 10:44:28 -0500
Subject: [PATCH] IO/FFMPEG: support FFmpeg 5.0 API changes

Fixes: #18445
---
 IO/FFMPEG/CMakeLists.txt                | 18 +++++++++++++++--
 IO/FFMPEG/vtkFFMPEGVideoSource.cxx      |  4 ++--
 IO/FFMPEG/vtkFFMPEGWriter.cxx           | 27 +++++++++++++------------
 4 files changed, 35 insertions(+), 17 deletions(-)
 create mode 100644 Documentation/release/dev/ffmpeg-5.0.md

Index: paraview/VTK/IO/FFMPEG/CMakeLists.txt
===================================================================
--- paraview.orig/VTK/IO/FFMPEG/CMakeLists.txt	2024-05-21 23:57:26.275099695 +0200
+++ paraview/VTK/IO/FFMPEG/CMakeLists.txt	2024-05-21 23:57:26.267099616 +0200
@@ -34,6 +34,17 @@
     FFMPEG::swresample)
 endif ()
 
+set(ffmpeg_libraries)
+if (NOT FFMPEG_VERSION VERSION_LESS "5.0")
+  if (NOT FFMPEG_swresample_FOUND)
+    message(FATAL_ERROR
+      "FFMPEG 5.0 requires the `swresample` library.")
+  endif ()
+
+  list(APPEND ffmpeg_libraries
+    FFMPEG::swresample)
+endif ()
+
 vtk_module_add_module(VTK::IOFFMPEG
   CLASSES ${classes})
 vtk_module_link(VTK::IOFFMPEG
Index: paraview/VTK/IO/FFMPEG/vtkFFMPEGWriter.cxx
===================================================================
--- paraview.orig/VTK/IO/FFMPEG/vtkFFMPEGWriter.cxx	2024-05-21 23:57:26.275099695 +0200
+++ paraview/VTK/IO/FFMPEG/vtkFFMPEGWriter.cxx	2024-05-21 23:57:26.267099616 +0200
@@ -399,15 +399,9 @@
     return 0;
   }
 
-  if (this->Writer->GetCompression())
-  {
-    // choose a codec that is easily playable on windows
-    this->avOutputFormat->video_codec = AV_CODEC_ID_MJPEG;
-  }
-  else
-  {
-    this->avOutputFormat->video_codec = AV_CODEC_ID_RAWVIDEO;
-  }
+  enum AVCodecID video_codec = this->Writer->GetCompression()
+    ? AV_CODEC_ID_MJPEG // choose a codec that is easily playable on windows
+    : AV_CODEC_ID_RAWVIDEO;
 
   // assign the format to the context
   this->avFormatContext->oformat = this->avOutputFormat;