diff --git a/multimedia/libopenshot/Makefile b/multimedia/libopenshot/Makefile index f704889364d5..96cae6038d19 100644 --- a/multimedia/libopenshot/Makefile +++ b/multimedia/libopenshot/Makefile @@ -1,75 +1,74 @@ PORTNAME= libopenshot DISTVERSIONPREFIX= v -DISTVERSION= 0.4.0 -PORTREVISION= 4 +DISTVERSION= 0.5.0 CATEGORIES= multimedia PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= tatsuki_makino@hotmail.com COMMENT= OpenShot Video Library WWW= https://www.openshot.org/ LICENSE= BSD3CLAUSE LGPL3+ LICENSE_COMB= multi LICENSE_FILE_BSD3CLAUSE= ${WRKSRC}/LICENSES/BSD-3-Clause.txt LICENSE_FILE_LGPL3+ = ${WRKSRC}/COPYING -BUILD_DEPENDS= swig:devel/swig \ +BUILD_DEPENDS= ${PY_SETUPTOOLS} \ + swig:devel/swig \ ${LOCALBASE}/include/zmq.hpp:net/cppzmq LIB_DEPENDS= libavformat.so:multimedia/ffmpeg \ libbabl-0.1.so:x11/babl \ libjsoncpp.so:devel/jsoncpp \ libopenshot-audio.so:audio/libopenshot-audio \ - libpython${PYTHON_VER}${PYTHON_ABIVER}.so:lang/python${PYTHON_SUFFIX} \ libzmq.so:net/libzmq4 -USES= cmake pkgconfig python:build qt:5 +USES= cmake pkgconfig python qt:5 USE_GITHUB= yes GH_ACCOUNT= OpenShot USE_LDCONFIG= yes USE_PYTHON= flavors USE_QT= core gui widgets buildtools:build qmake:build CMAKE_ON= USE_SYSTEM_JSONCPP DISABLE_BUNDLED_JSONCPP\ USE_HW_ACCEL ENABLE_PYTHON\ CMAKE_DISABLE_FIND_PACKAGE_Catch2 CMAKE_OFF= ENABLE_PARALLEL_CTEST VERBOSE_TESTS ENABLE_COVERAGE\ APPIMAGE_BUILD BUILD_TESTING ENABLE_JAVA ENABLE_TESTS DEBUG_FLAGS?= -g DEBUG_FLAGS+= -D_DEBUG -DJUCE_FORCE_DEBUG=1 PLIST_SUB= VERSION=${DISTVERSION} OPTIONS_DEFINE= DOCS DOXYGEN IMAGEMAGICK OPENCV RESVG RUBY OPTIONS_DEFAULT= IMAGEMAGICK OPENCV OPTIONS_SUB= yes RESVG_DESC?= SVG vector graphics support via resvg DOCS_CMAKE_ON= -DCMAKE_INSTALL_DOCDIR:PATH=${DOCSDIR_REL:Q} DOCS_PORTDOCS= * DOXYGEN_IMPLIES= DOCS DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen DOXYGEN_CMAKE_BOOL= ENABLE_LIB_DOCS DOXYGEN_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_Doxygen IMAGEMAGICK_USES= magick IMAGEMAGICK_CMAKE_BOOL= ENABLE_MAGICK IMAGEMAGICK_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_ImageMagick OPENCV_LIB_DEPENDS= libopencv_core.so:graphics/opencv \ libprotobuf.so:devel/protobuf OPENCV_CMAKE_BOOL= ENABLE_OPENCV OPENCV_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_OpenCV\ CMAKE_DISABLE_FIND_PACKAGE_Protobuf OPENCV_CMAKE_ON= -DOpenCV_DIR:STRING=${LOCALBASE:Q}/cmake/opencv4 RESVG_LIB_DEPENDS= libresvg.so:graphics/resvg-capi RESVG_USE_OFF= QT=svg RESVG_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_Resvg RESVG_CMAKE_ON= -DRESVGDIR:STRING=${LOCALBASE:Q} RUBY_LIB_DEPENDS= libruby${RUBY_SUFFIX}.so:lang/ruby${RUBY_SUFFIX} RUBY_USES= ruby:build RUBY_CMAKE_BOOL= ENABLE_RUBY RUBY_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_Ruby .if !exists(/usr/include/omp.h) USES+= compiler:gcc-c++17-lib .else USES+= compiler:c++17-lang .endif .include diff --git a/multimedia/libopenshot/distinfo b/multimedia/libopenshot/distinfo index 4ccafa0b149f..f759c730774a 100644 --- a/multimedia/libopenshot/distinfo +++ b/multimedia/libopenshot/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1737806544 -SHA256 (OpenShot-libopenshot-v0.4.0_GH0.tar.gz) = be0e760d81275543f7fbbf87863645748c3fe8aa8f4b5b771ff45a5d026bc9cc -SIZE (OpenShot-libopenshot-v0.4.0_GH0.tar.gz) = 26131657 +TIMESTAMP = 1767150000 +SHA256 (OpenShot-libopenshot-v0.5.0_GH0.tar.gz) = 471fcc87e3b7c272a779a59e96d7f2559fadc8188570b2aebc0d2bda96439e7e +SIZE (OpenShot-libopenshot-v0.5.0_GH0.tar.gz) = 27007684 diff --git a/multimedia/libopenshot/files/patch-CMakeLists.txt b/multimedia/libopenshot/files/patch-CMakeLists.txt index 1c523fc742a8..7cda29369a69 100644 --- a/multimedia/libopenshot/files/patch-CMakeLists.txt +++ b/multimedia/libopenshot/files/patch-CMakeLists.txt @@ -1,29 +1,29 @@ --- CMakeLists.txt.orig 2024-12-21 22:27:30 UTC +++ CMakeLists.txt -@@ -130,7 +130,7 @@ add_subdirectory(src) +@@ -130,7 +130,7 @@ endif() ### Process subdirectories ### add_subdirectory(src) -add_subdirectory(examples) +#add_subdirectory(examples) add_subdirectory(bindings) ### @@ -188,6 +188,8 @@ if (ENABLE_LIB_DOCS AND CMAKE_VERSION VERSION_GREATER set(DOXYGEN_INTERACTIVE_SVG YES) set(DOXYGEN_DOT_TRANSPARENT YES) + set(DOXYGEN_DOT_GRAPH_MAX_NODES "100") + doxygen_add_docs(${PROJECT_NAME}-doc ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/doc @@ -208,7 +210,7 @@ if (TARGET ${PROJECT_NAME}-doc) OPTIONAL ) # No error if the docs aren't found if(NOT TARGET doc) - add_custom_target(doc) + add_custom_target(doc ALL) endif() if(TARGET doc) add_dependencies(doc ${PROJECT_NAME}-doc) diff --git a/multimedia/libopenshot/files/patch-src_CMakeLists.txt b/multimedia/libopenshot/files/patch-src_CMakeLists.txt index f50aa9b79f09..212415c64884 100644 --- a/multimedia/libopenshot/files/patch-src_CMakeLists.txt +++ b/multimedia/libopenshot/files/patch-src_CMakeLists.txt @@ -1,29 +1,29 @@ ---- src/CMakeLists.txt.orig 2023-03-27 18:48:43 UTC +--- src/CMakeLists.txt.orig 2025-12-17 05:23:44 UTC +++ src/CMakeLists.txt -@@ -516,6 +516,26 @@ See https://github.com/opencv/opencv/issues/19260]]) +@@ -524,6 +524,26 @@ add_feature_info("OpenCV algorithms" ENABLE_OPENCV "Us endif() # ENABLE_OPENCV add_feature_info("OpenCV algorithms" ENABLE_OPENCV "Use OpenCV algorithms") +# +include(CheckFunctionExists) +include(CheckLibraryExists) + +# EXECINFO +check_function_exists(backtrace FUNCTION_BACKTRACE_FOUND) +if(NOT FUNCTION_BACKTRACE_FOUND) + find_library(EXECINFO_LIBRARY NAMES execinfo) + if(EXECINFO_LIBRARY) + unset(FUNCTION_BACKTRACE_FOUND CACHE) + check_library_exists(${EXECINFO_LIBRARY} backtrace "" FUNCTION_BACKTRACE_FOUND) + endif(EXECINFO_LIBRARY) +endif(NOT FUNCTION_BACKTRACE_FOUND) +if(NOT FUNCTION_BACKTRACE_FOUND) + message(FATAL_ERROR "backtrace - ${FUNCTION_BACKTRACE_FOUND}") +endif(NOT FUNCTION_BACKTRACE_FOUND) +if(EXECINFO_LIBRARY) + target_link_libraries(openshot PRIVATE ${EXECINFO_LIBRARY}) +endif(EXECINFO_LIBRARY) + ############### LINK LIBRARY ################# # Link remaining dependency libraries if(DEFINED PROFILER) diff --git a/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp b/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp index 95b0d6c2f6ce..67db735bbc68 100644 --- a/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp +++ b/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp @@ -1,35 +1,50 @@ ---- src/FFmpegReader.cpp.orig 2022-12-01 22:04:03 UTC +--- src/FFmpegReader.cpp.orig 2025-12-16 05:34:48 UTC +++ src/FFmpegReader.cpp -@@ -130,7 +130,7 @@ static enum AVPixelFormat get_hw_dec_format(AVCodecCon +@@ -137,7 +137,7 @@ static enum AVPixelFormat get_hw_dec_format(AVCodecCon for (p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) { switch (*p) { -#if defined(__linux__) +#if defined(__unix__) // Linux pix formats case AV_PIX_FMT_VAAPI: hw_de_av_pix_fmt_global = AV_PIX_FMT_VAAPI; -@@ -300,7 +300,7 @@ void FFmpegReader::Open() { +@@ -307,7 +307,7 @@ void FFmpegReader::Open() { pCodecCtx->get_format = get_hw_dec_format; if (adapter_num < 3 && adapter_num >=0) { -#if defined(__linux__) +#if defined(__unix__) snprintf(adapter,sizeof(adapter),"/dev/dri/renderD%d", adapter_num+128); adapter_ptr = adapter; i_decoder_hw = openshot::Settings::Instance()->HARDWARE_DECODER; -@@ -363,11 +363,13 @@ void FFmpegReader::Open() { +@@ -370,12 +370,14 @@ void FFmpegReader::Open() { } // Check if it is there and writable -#if defined(__linux__) +#if defined(__unix__) if( adapter_ptr != NULL && access( adapter_ptr, W_OK ) == 0 ) { #elif defined(_WIN32) if( adapter_ptr != NULL ) { #elif defined(__APPLE__) -+ if( adapter_ptr != NULL ) { -+#else if( adapter_ptr != NULL ) { ++#else ++ if( adapter_ptr != NULL ) { #endif ZmqLogger::Instance()->AppendDebugMethod("Decode Device present using device"); + } +@@ -566,8 +568,13 @@ void FFmpegReader::Open() { + AVStream* st = pFormatCtx->streams[i]; + if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { + // Only inspect the first video stream ++#if LIBAVFORMAT_VERSION_MAJOR >= 62 ++ for (int j = 0; j < st->codecpar->nb_coded_side_data; j++) { ++ AVPacketSideData *sd = &st->codecpar->coded_side_data[j]; ++#else + for (int j = 0; j < st->nb_side_data; j++) { + AVPacketSideData *sd = &st->side_data[j]; ++#endif + + // Handle rotation metadata (unchanged) + if (sd->type == AV_PKT_DATA_DISPLAYMATRIX && diff --git a/multimedia/libopenshot/files/patch-src_FFmpegUtilities.h b/multimedia/libopenshot/files/patch-src_FFmpegUtilities.h new file mode 100644 index 000000000000..78fa21d4c432 --- /dev/null +++ b/multimedia/libopenshot/files/patch-src_FFmpegUtilities.h @@ -0,0 +1,11 @@ +--- src/FFmpegUtilities.h.orig 2025-12-16 05:34:48 UTC ++++ src/FFmpegUtilities.h +@@ -307,7 +307,7 @@ inline static void* aligned_malloc(size_t size, size_t + { + #if defined(_WIN32) + return _aligned_malloc(size, alignment); +-#elif defined(__APPLE__) || defined(__linux__) ++#elif defined(__APPLE__) || defined(__unix__) + void* ptr = nullptr; + if (posix_memalign(&ptr, alignment, size) != 0) + return nullptr; diff --git a/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp b/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp index 64e3d4628e0d..a358e00aafc5 100644 --- a/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp +++ b/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp @@ -1,75 +1,88 @@ ---- src/FFmpegWriter.cpp.orig 2024-12-21 22:27:30 UTC +--- src/FFmpegWriter.cpp.orig 2025-12-16 05:34:48 UTC +++ src/FFmpegWriter.cpp -@@ -166,7 +166,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std +@@ -167,7 +167,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std const AVCodec *new_codec; // Check if the codec selected is a hardware accelerated codec #if USE_HW_ACCEL -#if defined(__linux__) +#if defined(__unix__) if (strstr(codec.c_str(), "_vaapi") != NULL) { new_codec = avcodec_find_encoder_by_name(codec.c_str()); hw_en_on = 1; -@@ -216,7 +216,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std +@@ -217,7 +217,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std } #else // unknown OS new_codec = avcodec_find_encoder_by_name(codec.c_str()); -#endif //__linux__/_WIN32/__APPLE__ +#endif //__unix__/_WIN32/__APPLE__ #else // USE_HW_ACCEL new_codec = avcodec_find_encoder_by_name(codec.c_str()); #endif // USE_HW_ACCEL -@@ -563,6 +563,7 @@ void FFmpegWriter::SetOption(StreamType stream, std::s +@@ -558,6 +558,7 @@ void FFmpegWriter::SetOption(StreamType stream, std::s else { av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value),63), 0); } + break; case AV_CODEC_ID_HEVC : c->bit_rate = 0; if (strstr(info.vcodec.c_str(), "svt_hevc") != NULL) { -@@ -571,6 +572,8 @@ void FFmpegWriter::SetOption(StreamType stream, std::s +@@ -566,6 +567,8 @@ void FFmpegWriter::SetOption(StreamType stream, std::s av_opt_set_int(c->priv_data, "forced-idr",1,0); } break; + default: + break; } #endif // FFmpeg 4.0+ } else { -@@ -1434,22 +1437,26 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS +@@ -1423,22 +1426,26 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS adapter_num = openshot::Settings::Instance()->HW_EN_DEVICE_SET; std::clog << "Encoding Device Nr: " << adapter_num << "\n"; if (adapter_num < 3 && adapter_num >=0) { -#if defined(__linux__) +#if defined(__unix__) snprintf(adapter,sizeof(adapter),"/dev/dri/renderD%d", adapter_num+128); // Maybe 127 is better because the first card would be 1?! adapter_ptr = adapter; #elif defined(_WIN32) || defined(__APPLE__) adapter_ptr = NULL; +#else + adapter_ptr = NULL; #endif } else { adapter_ptr = NULL; // Just to be sure } // Check if it is there and writable -#if defined(__linux__) +#if defined(__unix__) if( adapter_ptr != NULL && access( adapter_ptr, W_OK ) == 0 ) { #elif defined(_WIN32) || defined(__APPLE__) if( adapter_ptr != NULL ) { +#else + if( adapter_ptr != NULL ) { #endif ZmqLogger::Instance()->AppendDebugMethod( "Encode Device present using device", -@@ -1511,7 +1518,7 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS +@@ -1500,7 +1507,7 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS switch (video_codec_ctx->codec_id) { case AV_CODEC_ID_H264: video_codec_ctx->max_b_frames = 0; // At least this GPU doesn't support b-frames - video_codec_ctx->profile = FF_PROFILE_H264_BASELINE | FF_PROFILE_H264_CONSTRAINED; + video_codec_ctx->profile = AV_PROFILE_H264_BASELINE | AV_PROFILE_H264_CONSTRAINED; av_opt_set(video_codec_ctx->priv_data, "preset", "slow", 0); av_opt_set(video_codec_ctx->priv_data, "tune", "zerolatency", 0); av_opt_set(video_codec_ctx->priv_data, "vprofile", "baseline", AV_OPT_SEARCH_CHILDREN); +@@ -2390,6 +2397,12 @@ void FFmpegWriter::AddSphericalMetadata(const std::str + map->pitch = static_cast(pitch_deg * (1 << 16)); + map->roll = static_cast(roll_deg * (1 << 16)); + ++# if LIBAVFORMAT_VERSION_MAJOR >= 62 ++ av_packet_side_data_add( ++ &video_st->codecpar->coded_side_data, &video_st->codecpar->nb_coded_side_data, ++ AV_PKT_DATA_SPHERICAL, reinterpret_cast(map), sd_size, 0); ++# else + av_stream_add_side_data(video_st, AV_PKT_DATA_SPHERICAL, reinterpret_cast(map), sd_size); ++# endif + #endif + } diff --git a/multimedia/libopenshot/pkg-plist b/multimedia/libopenshot/pkg-plist index 67e2ed24b92a..d4368d7c962c 100644 --- a/multimedia/libopenshot/pkg-plist +++ b/multimedia/libopenshot/pkg-plist @@ -1,104 +1,113 @@ include/libopenshot/AudioBufferSource.h include/libopenshot/AudioDevices.h include/libopenshot/AudioLocation.h include/libopenshot/AudioReaderSource.h include/libopenshot/AudioResampler.h include/libopenshot/AudioWaveformer.h include/libopenshot/CVObjectDetection.h include/libopenshot/CVStabilization.h include/libopenshot/CVTracker.h include/libopenshot/CacheBase.h include/libopenshot/CacheDisk.h include/libopenshot/CacheMemory.h include/libopenshot/ChannelLayouts.h include/libopenshot/ChunkReader.h include/libopenshot/ChunkWriter.h include/libopenshot/Clip.h include/libopenshot/ClipBase.h include/libopenshot/ClipProcessingJobs.h include/libopenshot/Color.h include/libopenshot/Coordinate.h include/libopenshot/CrashHandler.h include/libopenshot/DummyReader.h include/libopenshot/EffectBase.h include/libopenshot/EffectInfo.h include/libopenshot/Effects.h include/libopenshot/Enums.h include/libopenshot/Exceptions.h include/libopenshot/FFmpegReader.h include/libopenshot/FFmpegUtilities.h include/libopenshot/FFmpegWriter.h include/libopenshot/Fraction.h include/libopenshot/Frame.h include/libopenshot/FrameMapper.h +include/libopenshot/IdGenerator.h include/libopenshot/ImageReader.h include/libopenshot/ImageWriter.h include/libopenshot/Json.h include/libopenshot/KeyFrame.h include/libopenshot/MagickUtilities.h +include/libopenshot/MemoryTrim.h include/libopenshot/OpenCVUtilities.h include/libopenshot/OpenMPUtilities.h include/libopenshot/OpenShot.h include/libopenshot/OpenShotVersion.h include/libopenshot/PlayerBase.h include/libopenshot/Point.h include/libopenshot/ProcessingController.h include/libopenshot/Profiles.h include/libopenshot/Qt/AudioPlaybackThread.h include/libopenshot/Qt/PlayerDemo.h include/libopenshot/Qt/PlayerPrivate.h include/libopenshot/Qt/VideoCacheThread.h include/libopenshot/Qt/VideoPlaybackThread.h include/libopenshot/Qt/VideoRenderWidget.h include/libopenshot/Qt/VideoRenderer.h include/libopenshot/QtHtmlReader.h include/libopenshot/QtImageReader.h include/libopenshot/QtPlayer.h include/libopenshot/QtTextReader.h include/libopenshot/QtUtilities.h include/libopenshot/ReaderBase.h include/libopenshot/RendererBase.h include/libopenshot/Settings.h include/libopenshot/TextReader.h include/libopenshot/Timeline.h include/libopenshot/TimelineBase.h include/libopenshot/TrackedObjectBBox.h include/libopenshot/TrackedObjectBase.h include/libopenshot/WriterBase.h include/libopenshot/ZmqLogger.h include/libopenshot/audio_effects/Compressor.h include/libopenshot/audio_effects/Delay.h include/libopenshot/audio_effects/Distortion.h include/libopenshot/audio_effects/Echo.h include/libopenshot/audio_effects/Expander.h include/libopenshot/audio_effects/Noise.h include/libopenshot/audio_effects/ParametricEQ.h include/libopenshot/audio_effects/Robotization.h include/libopenshot/audio_effects/STFT.h include/libopenshot/audio_effects/Whisperization.h +include/libopenshot/effects/AnalogTape.h include/libopenshot/effects/Bars.h include/libopenshot/effects/Blur.h include/libopenshot/effects/Brightness.h include/libopenshot/effects/Caption.h include/libopenshot/effects/ChromaKey.h +include/libopenshot/effects/ColorMap.h include/libopenshot/effects/ColorShift.h include/libopenshot/effects/Crop.h +include/libopenshot/effects/CropHelpers.h include/libopenshot/effects/Deinterlace.h include/libopenshot/effects/Hue.h +include/libopenshot/effects/LensFlare.h include/libopenshot/effects/Mask.h include/libopenshot/effects/Negate.h include/libopenshot/effects/ObjectDetection.h +include/libopenshot/effects/Outline.h include/libopenshot/effects/Pixelate.h include/libopenshot/effects/Saturation.h +include/libopenshot/effects/Sharpen.h include/libopenshot/effects/Shift.h +include/libopenshot/effects/SphericalProjection.h include/libopenshot/effects/Stabilizer.h include/libopenshot/effects/Tracker.h include/libopenshot/effects/Wave.h include/libopenshot/sort_filter/Hungarian.h include/libopenshot/sort_filter/KalmanTracker.h lib/libopenshot.so lib/libopenshot.so.%%VERSION%% -lib/libopenshot.so.27 +lib/libopenshot.so.28 %%PYTHON_SITELIBDIR%%/_openshot.so %%PYTHON_SITELIBDIR%%/openshot.py %%RUBY%%%%RUBY_VENDORARCHLIBDIR%%/openshot.so