diff --git a/multimedia/libopenshot/Makefile b/multimedia/libopenshot/Makefile index 63a0e53bb50e..0c7389dcbfbd 100644 --- a/multimedia/libopenshot/Makefile +++ b/multimedia/libopenshot/Makefile @@ -1,75 +1,74 @@ PORTNAME= libopenshot DISTVERSIONPREFIX= v -DISTVERSION= 0.5.0 -PORTREVISION= 1 +DISTVERSION= 0.6.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= ${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 \ libzmq.so:net/libzmq4 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 f759c730774a..119c17ee1d18 100644 --- a/multimedia/libopenshot/distinfo +++ b/multimedia/libopenshot/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1767150000 -SHA256 (OpenShot-libopenshot-v0.5.0_GH0.tar.gz) = 471fcc87e3b7c272a779a59e96d7f2559fadc8188570b2aebc0d2bda96439e7e -SIZE (OpenShot-libopenshot-v0.5.0_GH0.tar.gz) = 27007684 +TIMESTAMP = 1774234800 +SHA256 (OpenShot-libopenshot-v0.6.0_GH0.tar.gz) = 01c6510c92d7ec430f013cdaff3e65063fee4c1e4461fa1e87fcf80a892dddee +SIZE (OpenShot-libopenshot-v0.6.0_GH0.tar.gz) = 27055244 diff --git a/multimedia/libopenshot/files/patch-bindings_python_CMakeLists.txt b/multimedia/libopenshot/files/patch-bindings_python_CMakeLists.txt new file mode 100644 index 000000000000..99df36c003ea --- /dev/null +++ b/multimedia/libopenshot/files/patch-bindings_python_CMakeLists.txt @@ -0,0 +1,11 @@ +--- bindings/python/CMakeLists.txt.orig 2026-03-20 19:34:28 UTC ++++ bindings/python/CMakeLists.txt +@@ -117,7 +117,7 @@ if (NOT DEFINED PYTHON_MODULE_PATH) + if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${PYTHON_MODULE_PATH}") + ### Calculate the python module path (prefer sysconfig, fallback to distutils for compatibility) + execute_process( +- COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; p=sysconfig.get_path('platlib', scheme='posix_prefix'); p=p[5:] if p.startswith('/usr/') else p.lstrip('/'); print(p)" ++ COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; p=sysconfig.get_path('platlib', scheme='posix_prefix'); d = sysconfig.get_path('data', scheme='posix_prefix'); p = p[len(d):].lstrip('/') if p.startswith(d) else p.lstrip('/'); print(p)" + OUTPUT_VARIABLE PYTHON_MODULE_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() diff --git a/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp b/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp index 67db735bbc68..216a07c120e5 100644 --- a/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp +++ b/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp @@ -1,50 +1,50 @@ ---- src/FFmpegReader.cpp.orig 2025-12-16 05:34:48 UTC +--- src/FFmpegReader.cpp.orig 2026-03-20 19:34:28 UTC +++ src/FFmpegReader.cpp -@@ -137,7 +137,7 @@ static enum AVPixelFormat get_hw_dec_format(AVCodecCon +@@ -171,7 +171,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; -@@ -307,7 +307,7 @@ void FFmpegReader::Open() { + if (selected == 1) { +@@ -358,7 +358,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; -@@ -370,12 +370,14 @@ void FFmpegReader::Open() { +@@ -421,12 +421,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 ) { #endif ZmqLogger::Instance()->AppendDebugMethod("Decode Device present using device"); } -@@ -566,8 +568,13 @@ void FFmpegReader::Open() { +@@ -682,8 +684,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_FFmpegWriter.cpp b/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp index a358e00aafc5..5f905d9dbe24 100644 --- a/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp +++ b/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp @@ -1,88 +1,91 @@ ---- src/FFmpegWriter.cpp.orig 2025-12-16 05:34:48 UTC +--- src/FFmpegWriter.cpp.orig 2026-03-20 19:34:28 UTC +++ src/FFmpegWriter.cpp -@@ -167,7 +167,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std +@@ -168,7 +168,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; -@@ -217,7 +217,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std +@@ -218,7 +218,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 -@@ -558,6 +558,7 @@ void FFmpegWriter::SetOption(StreamType stream, std::s +@@ -564,6 +564,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) { -@@ -566,6 +567,8 @@ void FFmpegWriter::SetOption(StreamType stream, std::s +@@ -572,6 +573,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 { -@@ -1423,22 +1426,26 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS +@@ -1429,22 +1432,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", -@@ -1500,7 +1507,7 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS +@@ -1510,7 +1517,11 @@ 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; ++#if LIBAVFORMAT_VERSION_MAJOR >= 61 + video_codec_ctx->profile = AV_PROFILE_H264_BASELINE | AV_PROFILE_H264_CONSTRAINED; ++#else + video_codec_ctx->profile = FF_PROFILE_H264_BASELINE | FF_PROFILE_H264_CONSTRAINED; ++#endif 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 +@@ -2400,6 +2411,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 d4368d7c962c..3cb1f388361b 100644 --- a/multimedia/libopenshot/pkg-plist +++ b/multimedia/libopenshot/pkg-plist @@ -1,113 +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.28 +lib/libopenshot.so.29 %%PYTHON_SITELIBDIR%%/_openshot.so %%PYTHON_SITELIBDIR%%/openshot.py %%RUBY%%%%RUBY_VENDORARCHLIBDIR%%/openshot.so