News:

--

Main Menu

Avidemux 2.8.2 development

Started by eumagga0x2a, October 02, 2022, 01:42:10 PM

Previous topic - Next topic

Ferdi

#30
I'll give it a try.

I am using Ubuntu 24.04, customized for my own purpose.

edit: Now builds successful again

sl1pkn07

Hi

i get

[ 70%] Built target ADM_ve_x264_other
[ 70%] Building CXX object ADM_videoEncoder/x265/CMakeFiles/ADM_ve_x265_other.dir/ADM_x265.cpp.o
/tmp/makepkg/avidemux-git/src/avidemux/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265.cpp: In member function 'virtual bool x265Encoder::encode(ADMBitstream*)':
/tmp/makepkg/avidemux-git/src/avidemux/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265.cpp:216:66: error: cannot convert 'x265_picture*' to 'x265_picture**' in argument passing
  216 |            er = api->encoder_encode(handle, &nal, &nbNal, NULL, &pic_out);
      |                                                                  ^~~~~~~~
      |                                                                  |
      |                                                                  x265_picture*
/tmp/makepkg/avidemux-git/src/avidemux/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265.cpp:224:66: error: cannot convert 'x265_picture*' to 'x265_picture**' in argument passing
  224 |            er = api->encoder_encode(handle, &nal, &nbNal, &pic, &pic_out);
      |                                                                  ^~~~~~~~
      |                                                                  |
      |                                                                  x265_picture*
make[2]: *** [ADM_videoEncoder/x265/CMakeFiles/ADM_ve_x265_other.dir/build.make:93: ADM_videoEncoder/x265/CMakeFiles/ADM_ve_x265_other.dir/ADM_x265.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6133: ADM_videoEncoder/x265/CMakeFiles/ADM_ve_x265_other.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

from github with system x265 4.0

greetings

eumagga0x2a

Thanks for the heads-up, x265 has changed API in v4.0, will look into it soon (Homebrew has already jumped onto the latest and greatest, RPM Fusion only for Fedora Rawhide).

eumagga0x2a

For now, you may apply the following cmake patch which disables the build of the x265 encoder plugin for versions more recent than 3.6:

diff --git a/cmake/admCheckX265.cmake b/cmake/admCheckX265.cmake
index 2e3f4d9a9..9bff1829a 100644
--- a/cmake/admCheckX265.cmake
+++ b/cmake/admCheckX265.cmake
@@ -14,11 +14,14 @@ MACRO(checkX265)
                                STRING(REGEX MATCH "#define[ ]+X265_BUILD[ ]+([0-9]+)" X265_CONFIG_H "${X265_CONFIG_H}")
                                STRING(REGEX REPLACE ".*[ ]([0-9]+).*" "\\1" x265_version "${X265_CONFIG_H}")
                                MESSAGE(STATUS "  core version: ${x265_version}")
-                              
-                               IF (x265_version LESS 9)
-                                       MESSAGE("WARNING: x265 core version is too old.  At least version 9 is required.")
+                               IF (x265_version LESS 9 OR x265_version GREATER 209)
+                                       IF (x265_version LESS 9)
+                                               MESSAGE("WARNING: x265 core version is too old. At least version 9 is required.")
+                                       ELSE (x265_version LESS 9)
+                                               MESSAGE("WARNING: only x265 core up to version 209 (3.6 release) is supported.")
+                                       ENDIF (x265_version LESS 9)
                                        SET(X265_FOUND 0)
-                               ELSE (x265_version LESS 9)
+                               ELSE (x265_version LESS 9 OR x265_version GREATER 209)
                                         IF(NOT WIN32)
                                                 SET(DL dl)
                                         ELSE(NOT WIN32)
@@ -31,7 +34,7 @@ MACRO(checkX265)
                                                 ADD_DEFINITIONS(${X265_CFLAGS})
                                         ENDIF(MSVC)
                                        FIND_HEADER_AND_LIB(X265 x265.h x265 x265_encoder_open_${x265_version} ${DL})
-                               ENDIF (x265_version LESS 9)
+                               ENDIF (x265_version LESS 9 OR x265_version GREATER 209)
                        ELSE (_X265_FOUND AND _X265_CONFIG_FOUND)
                                MESSAGE(STATUS "  No working version found")
                                SET(X265_FOUND 0)

sl1pkn07

Hi

thanks, but not failed in

CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:260 (message):
  qt6_wrap_cpp: TARGET parameter is empty.  Since the file
  /tmp/makepkg/avidemux-git/src/avidemux/avidemux/qt4/ADM_jobs/src/ADM_jobControl.cpp
  is a source file, the TARGET option must be specified.
Call Stack (most recent call first):
  /usr/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:184 (_qt_internal_wrap_cpp)
  /tmp/makepkg/avidemux-git/src/fakeroot/usr/include/avidemux/2.8/cmake/admQtMacro.cmake:26 (QT6_WRAP_CPP)
  ADM_jobs/src/CMakeLists.txt:26 (ADM_QT_WRAP_CPP)


-- Configuring incomplete, errors occurred!

greetings

sl1pkn07

oh. gigantic typo in the message, i mean "thanks, but now failed in"

sorry. greetings

eumagga0x2a

No problem, the meaning was clear.

Please sync your local git mirror and retry.

sl1pkn07


jlocash

I'm seeing this build failure with the new x265-4.1:

/tmp/build/avidemux2-git/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp:219:51: error: incompatible types in assignment of 'char*' to 'char [256]'
  219 |                              param.rc.statFileName=strdup(logFile);
      |                              ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/tmp/build/avidemux2-git/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp:225:51: error: incompatible types in assignment of 'char*' to 'char [256]'
  225 |                              param.rc.statFileName=strdup(logFile);
      |                              ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~


I resolved it with the following:
diff -Nuarp avidemux2-git.orig/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp avidemux2-git/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp
--- avidemux2-git.orig/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp 2024-11-29 14:16:25.000000000 -0500
+++ avidemux2-git/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp      2024-11-29 15:05:51.174165522 -0500
@@ -216,13 +216,21 @@ bool x265Encoder::setup(void)
                         {
                              param.rc.bStatWrite=1;
                              param.rc.bStatRead=0;
+#if (X265_BUILD < 215)
                              param.rc.statFileName=strdup(logFile);
+#else
+                             snprintf(param.rc.statFileName, X265_MAX_STRING_SIZE, "%s", logFile);
+#endif

                         }else
                         {
                              param.rc.bStatWrite=0;
                              param.rc.bStatRead=1;
+#if (X265_BUILD < 215)
                              param.rc.statFileName=strdup(logFile);
+#else
+                             snprintf(param.rc.statFileName, X265_MAX_STRING_SIZE, "%s", logFile);
+#endif
                              if(!ADM_fileExist(logFile))
                              {
                                    ADM_error("Logfile %s does not exist \n",logFile);

Also note that the API change introduced in x265-4.0 was reverted in 4.1.

eumagga0x2a

Quote from: jlocash on November 29, 2024, 08:35:10 PMI'm seeing this build failure with the new x265-4.1:

Code Select Expand
/tmp/build/avidemux2-git/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp:219:51: error: incompatible types in assignment of 'char*' to 'char [256]'
  219 |                              param.rc.statFileName=strdup(logFile);
      |                              ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/tmp/build/avidemux2-git/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp:225:51: error: incompatible types in assignment of 'char*' to 'char [256]'
  225 |                              param.rc.statFileName=strdup(logFile);
      |                              ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~

Early heads-up very much appreciated.

Quote from: jlocash on November 29, 2024, 08:35:10 PMAlso note that the API change introduced in x265-4.0 was reverted in 4.1.

#if (X265_BUILD > 209) && (X265_BUILD < 213)
in https://github.com/mean00/avidemux2/commit/930d0e998030f78cd68ede0611285f9df8d55935, stolen from libavcodec/libx265.c, takes care of that.

eumagga0x2a

x265 devs were fixing memleaks and turned to allocating only 256 bytes for strings containing file paths? Oh my, this is vastly insufficient unless the library expects just the basename. And even then it may be insufficient and we must catch that and fail early when the filename is too long.