### Install Application Executable Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Installs the main application executable to the root of the installation prefix. ```cmake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) ``` -------------------------------- ### Define Installation Directories Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Sets variables for the data and library directories within the installation bundle. ```cmake set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") ``` -------------------------------- ### Installation Configuration Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/CMakeLists.txt Configures installation paths and components for the application, including runtime files, data, libraries, and native assets. This ensures the application can be deployed correctly. ```cmake set(BUILD_BUNDLE_DIR "$") set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Install Bundled Plugin Libraries Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Installs all bundled libraries from plugins to the application's library directory. ```cmake foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) ``` -------------------------------- ### Install Flutter Library Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Installs the main Flutter library file to the application's library directory. ```cmake install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Basic Video Rendering Example Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Demonstrates how to configure and initiate video rendering using various video sources (asset, file, network, memory). It also shows how to write the output directly to a file to avoid RAM overload and how to listen to the progress stream. ```dart var data = VideoRenderData( videoSegments: [ VideoSegment( video: EditorVideo.asset('assets/my-video.mp4'), // video: EditorVideo.file(File('/path/to/video.mp4')), // video: EditorVideo.network('https://example.com/video.mp4'), // video: EditorVideo.memory(videoBytes), ), ], enableAudio: false, startTime: const Duration(seconds: 5), endTime: const Duration(seconds: 20), ); Uint8List result = await ProVideoEditor.instance.renderVideo(data); /// If you're rendering larger videos, it's better to write them directly to a file /// instead of returning them as a Uint8List, as this can overload your RAM. /// /// final directory = await getTemporaryDirectory(); /// String outputPath = '${directory.path}/my_video.mp4'; /// /// await ProVideoEditor.instance.renderVideoToFile('${directory.path}/my_video.mp4', data); /// Listen progress StreamBuilder( stream: ProVideoEditor.instance.progressStream, builder: (context, snapshot) { var progress = snapshot.data?.progress ?? 0; return CircularProgressIndicator(value: animatedValue); } ) ``` -------------------------------- ### Set Install Prefix for Bundled Application Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Configures the installation prefix to create a relocatable bundle in the build directory. ```cmake set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() ``` -------------------------------- ### VideoSegment Constructor Examples Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Shows how to create VideoSegment instances for full videos or trimmed clips. Use EditorVideo.asset, .file, .network, or .memory for video sources. ```dart // Full video VideoSegment(video: EditorVideo.asset('video.mp4')) ``` ```dart // Trimmed video (5s to 10s) VideoSegment( video: EditorVideo.file(File('video.mp4')), startTime: Duration(seconds: 5), endTime: Duration(seconds: 10), ) ``` -------------------------------- ### Project Setup and Versioning Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/CMakeLists.txt Sets the minimum required CMake version and the project name. It's essential for ensuring compatibility with the CMake version used. ```cmake cmake_minimum_required(VERSION 3.14) project(pro_video_editor_example LANGUAGES CXX) ``` ```cmake set(BINARY_NAME "pro_video_editor_example") ``` ```cmake cmake_policy(VERSION 3.14...3.25) ``` -------------------------------- ### Install ICU Data File Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Installs the ICU data file to the application's data directory. ```cmake install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Clean Build Bundle Directory on Install Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Removes the build bundle directory before installation to ensure a clean state. ```cmake install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) ``` -------------------------------- ### Set Install RPATH for Bundled Libraries Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Configures the runtime search path for libraries bundled with the application. ```cmake set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") ``` -------------------------------- ### Install Native Assets Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Copies native assets provided by build.dart from all packages to the application's library directory. ```cmake set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install AOT Library for Non-Debug Builds Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Installs the Ahead-Of-Time (AOT) compiled library only for non-Debug build configurations. ```cmake if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Find and Link External Libraries Source: https://github.com/hm21/pro_video_editor/blob/stable/linux/CMakeLists.txt Finds and links required external libraries (GTK, GStreamer) using PkgConfig. Ensure these libraries are installed on the system. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GST REQUIRED IMPORTED_TARGET gstreamer-1.0) pkg_check_modules(GST_PBUTILS REQUIRED IMPORTED_TARGET gstreamer-pbutils-1.0) target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GST) target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GST_PBUTILS) ``` -------------------------------- ### Get Thumbnails Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Generates a list of thumbnail images from a video at specified timestamps and configurations. ```APIDOC ## Get Thumbnails ### Description Generates a list of thumbnail images from a video based on provided configuration, including timestamps, size, and fit. ### Method GET (conceptual, SDK method call) ### Endpoint `ProVideoEditor.instance.getThumbnails(ThumbnailConfigs configs)` ### Parameters #### Request Body (`ThumbnailConfigs`) - **video** (EditorVideo) - Required - The video source. - **outputFormat** (ThumbnailFormat) - Optional - The format for the output thumbnails (e.g., jpeg). - **timestamps** (List) - Required - A list of timestamps at which to generate thumbnails. - **outputSize** (Size) - Optional - The desired size of the output thumbnails. - **boxFit** (ThumbnailBoxFit) - Optional - How the thumbnail should fit the output size. ### Request Example ```dart List result = await ProVideoEditor.instance.getThumbnails( ThumbnailConfigs( video: EditorVideo.asset('assets/my-video.mp4'), outputFormat: ThumbnailFormat.jpeg, timestamps: const [ Duration(seconds: 10), Duration(seconds: 15), Duration(seconds: 22), ], outputSize: const Size(200, 200), boxFit: ThumbnailBoxFit.cover, ), ); ``` ### Response #### Success Response (200) - **List** - A list of byte arrays, each representing a thumbnail image. ``` -------------------------------- ### Enable Testing Source: https://github.com/hm21/pro_video_editor/blob/stable/windows/CMakeLists.txt Enables testing if the 'include_pro_video_editor_tests' variable is set. This is typically done when building the example to avoid building tests for plugin clients. ```cmake if (${include_${PROJECT_NAME}_tests}) set(TEST_RUNNER "${PROJECT_NAME}_test") enable_testing() # Add the Google Test dependency. include(FetchContent) FetchContent_Declare( googletest URL https://github.com/google/googletest/archive/release-1.11.0.zip ) # Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) # Disable install commands for gtest so it doesn't end up in the bundle. set(INSTALL_GTEST OFF CACHE BOOL "Disable installation of googletest" FORCE) FetchContent_MakeAvailable(googletest) # The plugin's C API is not very useful for unit testing, so build the sources # directly into the test binary rather than using the DLL. add_executable(${TEST_RUNNER} test/pro_video_editor_plugin_test.cpp ${PLUGIN_SOURCES} ) apply_standard_settings(${TEST_RUNNER}) target_include_directories(${TEST_RUNNER} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_link_libraries(${TEST_RUNNER} PRIVATE flutter_wrapper_plugin) target_link_libraries(${TEST_RUNNER} PRIVATE gtest_main gmock) # flutter_wrapper_plugin has link dependencies on the Flutter DLL. add_custom_command(TARGET ${TEST_RUNNER} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FLUTTER_LIBRARY}" $ ) # Enable automatic test discovery. include(GoogleTest) gtest_discover_tests(${TEST_RUNNER}) endif() ``` -------------------------------- ### Configure Flutter Library and Headers Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/flutter/CMakeLists.txt Sets variables for the Flutter library path, ICU data file, project build directory, and AOT library. These are published to the parent scope for use in the install step. ```cmake set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) ``` -------------------------------- ### Get Video Metadata Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Retrieves metadata for a video asset. Ensure the video asset is correctly specified. ```dart VideoMetadata result = await ProVideoEditor.instance.getMetadata( video: EditorVideo.asset('assets/my-video.mp4'), ); ``` -------------------------------- ### Get Video Metadata Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Retrieves metadata for a given video file, such as duration, resolution, and format. ```APIDOC ## Get Video Metadata ### Description Retrieves metadata information for a specified video file. ### Method GET (conceptual, SDK method call) ### Endpoint `ProVideoEditor.instance.getMetadata(EditorVideo video)` ### Parameters #### Request Body (`EditorVideo`) - **video** (EditorVideo) - Required - The video source (file, asset, network, memory). ### Request Example ```dart VideoMetadata result = await ProVideoEditor.instance.getMetadata( video: EditorVideo.asset('assets/my-video.mp4'), ); ``` ### Response #### Success Response (200) - **VideoMetadata** (object) - Contains metadata like duration, resolution, etc. ``` -------------------------------- ### Include Directories and Library Dependencies Source: https://github.com/hm21/pro_video_editor/blob/stable/windows/CMakeLists.txt Configures include directories and links necessary libraries for the plugin. 'flutter', 'flutter_wrapper_plugin', and several Windows Media Foundation libraries are linked. ```cmake target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin Windowscodecs mfplat.lib mfreadwrite.lib mfuuid.lib shlwapi.lib) ``` -------------------------------- ### Configure Cross-Building Sysroot Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Sets up the sysroot and search paths for cross-compilation environments. ```cmake if(FLUTTER_TARGET_PLATFORM_SYSROOT) set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif() ``` -------------------------------- ### Find System Dependencies Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/flutter/CMakeLists.txt Uses PkgConfig to find and check for required system libraries like GTK, GLIB, and GIO. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) ``` -------------------------------- ### Application and Plugin Build Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/CMakeLists.txt Adds the application's runner subdirectory and includes generated plugin build rules. This manages the building and linking of plugins. ```cmake add_subdirectory("runner") ``` ```cmake include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Apply Standard Build Settings Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/runner/CMakeLists.txt Applies a standard set of build settings to the specified target. This can be removed if custom build settings are required. ```cmake apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Project Configuration Source: https://github.com/hm21/pro_video_editor/blob/stable/windows/CMakeLists.txt Defines the project name and the languages it uses. The project name is 'pro_video_editor'. ```cmake set(PROJECT_NAME "pro_video_editor") project(${PROJECT_NAME} LANGUAGES CXX) ``` -------------------------------- ### Apply Standard Build Settings Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/runner/CMakeLists.txt Applies a predefined set of build settings to the application target. This can be removed if custom build settings are required. ```cmake # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Add Plugin Source Files Source: https://github.com/hm21/pro_video_editor/blob/stable/linux/CMakeLists.txt Appends new source files to the PLUGIN_SOURCES list. Ensure all source files for the plugin are included here. ```cmake list(APPEND PLUGIN_SOURCES "pro_video_editor_plugin.cc" "src/video_metadata.cc" "src/thumbnail_generator.cc" ) ``` -------------------------------- ### Define Source Include Directories Source: https://github.com/hm21/pro_video_editor/blob/stable/linux/CMakeLists.txt Specifies interface include directories for the plugin library. Add any plugin-specific dependencies here. ```cmake target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") ``` -------------------------------- ### Project and Minimum CMake Version Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Sets the minimum required CMake version and names the project. ```cmake cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) ``` -------------------------------- ### Link Libraries and Include Directories Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/runner/CMakeLists.txt Adds necessary dependency libraries (flutter, flutter_wrapper_app, dwmapi.lib) and include directories to the application target. Application-specific dependencies should also be added here. ```cmake # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### Find and Check GTK+ 3.0 Package Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Locates and checks for the GTK+ 3.0 system library using PkgConfig. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) ``` -------------------------------- ### Include Generated Plugin CMake Rules Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Includes the CMake rules for building and integrating generated plugins. ```cmake include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Define Bundled Libraries Source: https://github.com/hm21/pro_video_editor/blob/stable/linux/CMakeLists.txt Lists absolute paths to libraries that should be bundled with the plugin. This can include prebuilt libraries or those from external builds. ```cmake set(pro_video_editor_bundled_libraries "" PARENT_SCOPE ) ``` -------------------------------- ### Plugin Source Files Source: https://github.com/hm21/pro_video_editor/blob/stable/windows/CMakeLists.txt Appends source files to the PLUGIN_SOURCES list. Any new source files added to the plugin should be included here. ```cmake list(APPEND PLUGIN_SOURCES "pro_video_editor_plugin.cpp" "pro_video_editor_plugin.h" "src/video_metadata.cpp" "src/video_metadata.h" "src/thumbnail_generator.cpp" "src/thumbnail_generator.h" ) ``` -------------------------------- ### Create Flutter Interface Library Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/flutter/CMakeLists.txt Defines an INTERFACE library target named 'flutter' and sets its include directories and link libraries, including system dependencies found via PkgConfig. ```cmake add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") target_link_libraries(flutter INTERFACE PkgConfig::GTK PkgConfig::GLIB PkgConfig::GIO ) add_dependencies(flutter flutter_assemble) ``` -------------------------------- ### Set Include Directories Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/runner/CMakeLists.txt Specifies the include directories for the application target, allowing source files to find header files. The source directory is added for general access. ```cmake target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### Enable Modern CMake Behaviors Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Explicitly opts into modern CMake behaviors to avoid warnings with recent CMake versions. ```cmake cmake_policy(SET CMP0063 NEW) ``` -------------------------------- ### Profile Build Mode Settings Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/CMakeLists.txt Defines linker and compiler flags for the Profile build mode, often inheriting settings from the Release configuration for consistency. ```cmake set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") ``` -------------------------------- ### Generate Keyframes Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Generates a list of keyframes (thumbnails) from a video. Configure output format, maximum frames, size, and fit. ```dart List result = await ProVideoEditor.instance.getKeyFrames( KeyFramesConfigs( video: EditorVideo.asset('assets/my-video.mp4'), outputFormat: ThumbnailFormat.jpeg, maxOutputFrames: 20, outputSize: const Size(200, 200), boxFit: ThumbnailBoxFit.cover, ), ); ``` -------------------------------- ### Generate Video Thumbnails Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Generates a list of thumbnails from a video asset at specified timestamps and configurations. Customize output format, size, and fit. ```dart List result = await ProVideoEditor.instance.getThumbnails( ThumbnailConfigs( video: EditorVideo.asset('assets/my-video.mp4'), outputFormat: ThumbnailFormat.jpeg, timestamps: const [ Duration(seconds: 10), Duration(seconds: 15), Duration(seconds: 22), ], outputSize: const Size(200, 200), boxFit: ThumbnailBoxFit.cover, ), ); ``` -------------------------------- ### Apply Standard Compilation Settings Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Defines a function to apply common compilation features and options to targets. ```cmake function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) target_compile_options(${TARGET} PRIVATE "<$>:-O3>") target_compile_definitions(${TARGET} PRIVATE "<$>:NDEBUG>") endfunction() ``` -------------------------------- ### Flutter Integration Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/CMakeLists.txt Includes the Flutter managed directory and adds the Flutter subdirectory to the build. This integrates Flutter's build system into the project. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) ``` -------------------------------- ### Add Preprocessor Definitions for Build Version Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/runner/CMakeLists.txt Sets preprocessor definitions for various components of the Flutter version. This allows the application to access version information during compilation. ```cmake # Add preprocessor definitions for the build version. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") ``` -------------------------------- ### Plugin Name Configuration Source: https://github.com/hm21/pro_video_editor/blob/stable/windows/CMakeLists.txt Sets the name of the plugin library. This value must not be changed as it's used when generating builds. ```cmake set(PLUGIN_NAME "pro_video_editor_plugin") ``` -------------------------------- ### Set Runtime Output Directory for Executable Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Places the executable in a specific subdirectory to prevent accidental execution of unbundled copies. ```cmake set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) ``` -------------------------------- ### Enable Unit Tests with Google Test Source: https://github.com/hm21/pro_video_editor/blob/stable/linux/CMakeLists.txt Configures and enables unit tests using Google Test, provided CMake version is 3.11.0 or later and tests are enabled via include_${PROJECT_NAME}_tests. ```cmake if (${include_${PROJECT_NAME}_tests}) if(${CMAKE_VERSION} VERSION_LESS "3.11.0") message("Unit tests require CMake 3.11.0 or later") else() set(TEST_RUNNER "${PROJECT_NAME}_test") enable_testing() include(FetchContent) FetchContent_Declare( googletest URL https://github.com/google/googletest/archive/release-1.11.0.zip ) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) set(INSTALL_GTEST OFF CACHE BOOL "Disable installation of googletest" FORCE) FetchContent_MakeAvailable(googletest) add_executable(${TEST_RUNNER} test/pro_video_editor_plugin_test.cc ${PLUGIN_SOURCES} ) apply_standard_settings(${TEST_RUNNER}) target_include_directories(${TEST_RUNNER} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_link_libraries(${TEST_RUNNER} PRIVATE flutter) target_link_libraries(${TEST_RUNNER} PRIVATE PkgConfig::GTK) target_link_libraries(${TEST_RUNNER} PRIVATE PkgConfig::GST) target_link_libraries(${TEST_RUNNER} PRIVATE PkgConfig::GST_PBUTILS) target_link_libraries(${TEST_RUNNER} PRIVATE gtest_main gmock) include(GoogleTest) gtest_discover_tests(${TEST_RUNNER}) endif() # CMake version check endif() # include_${PROJECT_NAME}_tests ``` -------------------------------- ### Set Video Quality Preset Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Use quality presets for simplified video export configuration. You can override the preset's bitrate if needed. ```dart /// Use quality presets for simplified video export configuration /// Available presets: ultra4K, k4, p1080High, p1080, p720High, p720, p480, low, custom var data = VideoRenderData.withQualityPreset( videoSegments: [ VideoSegment(video: EditorVideo.asset('assets/my-video.mp4')), ], qualityPreset: VideoQualityPreset.p1080, // 1080p at 8 Mbps startTime: const Duration(seconds: 5), endTime: const Duration(seconds: 20), ); Uint8List result = await ProVideoEditor.instance.renderVideo(data); /// Override the preset's bitrate if needed var customData = VideoRenderData.withQualityPreset( videoSegments: [ VideoSegment(video: EditorVideo.asset('assets/my-video.mp4')), ], qualityPreset: VideoQualityPreset.p720, bitrateOverride: 5000000, // 5 Mbps instead of default 3 Mbps ); ``` -------------------------------- ### Custom Command for Flutter Tool Backend Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/flutter/CMakeLists.txt Defines a custom command to execute the Flutter tool backend script. This command generates the Flutter library and headers. A phony target is used to ensure it runs on every build. ```cmake add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/_phony_ COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} VERBATIM ) ``` -------------------------------- ### Enable Test Target Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Sets a flag to enable the test target for the project. ```cmake set(include_pro_video_editor_tests TRUE) ``` -------------------------------- ### Set Binary Name and Application ID Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Defines the executable name and the unique GTK application identifier. ```cmake set(BINARY_NAME "pro_video_editor_example") set(APPLICATION_ID "ch.waio.pro_video_editor") ``` -------------------------------- ### Build Configuration Management Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/CMakeLists.txt Configures build types (Debug, Profile, Release) based on whether the generator is multi-config. This allows developers to select different build modes. ```cmake get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" CACHE STRING "" FORCE) else() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() endif() ``` -------------------------------- ### Unicode Support Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/CMakeLists.txt Adds preprocessor definitions to enable Unicode support in the project, which is crucial for handling international characters. ```cmake add_definitions(-DUNICODE -D_UNICODE) ``` -------------------------------- ### Define Plugin Library Target Source: https://github.com/hm21/pro_video_editor/blob/stable/linux/CMakeLists.txt Creates a shared library target for the plugin. The name must match PLUGIN_NAME. ```cmake add_library(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES} ) ``` -------------------------------- ### Define Plugin Library Target Source: https://github.com/hm21/pro_video_editor/blob/stable/windows/CMakeLists.txt Defines the plugin library target as a SHARED library. The name must match PLUGIN_NAME. Includes C API header and source files along with other plugin sources. ```cmake add_library(${PLUGIN_NAME} SHARED "include/pro_video_editor/pro_video_editor_plugin_c_api.h" "pro_video_editor_plugin_c_api.cpp" ${PLUGIN_SOURCES} ) ``` -------------------------------- ### Standard Compilation Settings Function Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/CMakeLists.txt Applies common compilation features, options, and definitions to a target. This function ensures consistent build settings across different parts of the project. ```cmake function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() ``` -------------------------------- ### Add Preprocessor Definitions Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/runner/CMakeLists.txt Adds preprocessor definitions for the application ID, which is useful for conditional compilation based on the application's unique identifier. ```cmake add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") ``` -------------------------------- ### Add Runner Subdirectory Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Includes the runner subdirectory for application-specific build configurations. ```cmake add_subdirectory("runner") ``` -------------------------------- ### Re-copy Assets Directory on Each Build Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Ensures the assets directory is fully re-copied on each build to prevent stale files. ```cmake set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Streaming Audio Waveform Widget Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Automatically handles progressive waveform updates for long videos using an animated bar display. Provide the configuration and style. ```dart /// The streaming widget handles everything internally - /// just provide the config and it manages the stream subscription, /// chunk accumulation, and animated bar rendering automatically. AudioWaveform.streaming( config: WaveformConfigs( video: EditorVideo.asset('assets/long-video.mp4'), resolution: WaveformResolution.high, ), style: WaveformStyle( height: 80, waveColor: Colors.greenAccent, backgroundColor: Colors.black, ), onComplete: () { print('Waveform generation complete!'); }, ) ``` -------------------------------- ### Link Dependency Libraries Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/runner/CMakeLists.txt Links necessary libraries to the application target. This includes the Flutter engine library and GTK for graphical user interface support. ```cmake target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) ``` -------------------------------- ### Define Application Target Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/runner/CMakeLists.txt Defines the main executable target for the Windows runner. Source files and resources are listed here. Avoid changing the BINARY_NAME directly if you want `flutter run` to continue working. ```cmake cmake_minimum_required(VERSION 3.14) project(runner LANGUAGES CXX) # Define the application target. To change its name, change BINARY_NAME in the # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer # work. # # Any new source files that you add to the application should be added here. add_executable(${BINARY_NAME} WIN32 "flutter_window.cpp" "main.cpp" "utils.cpp" "win32_window.cpp" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" "Runner.rc" "runner.exe.manifest" ) ``` -------------------------------- ### Interactive Audio Waveform with Seek Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Displays an interactive audio waveform that allows users to seek to specific positions. Requires the waveform data and current position. ```dart /// Interactive waveform with seek support AudioWaveform.interactive( waveform: waveform, currentPosition: currentPosition, onSeek: (position) => print('Seek to: $position'), style: WaveformStyle( height: 120, ), ) ``` -------------------------------- ### CMake Policy Source: https://github.com/hm21/pro_video_editor/blob/stable/windows/CMakeLists.txt Explicitly opts into modern CMake behaviors to avoid warnings with recent CMake versions. Covers versions 3.14 through 3.25. ```cmake cmake_policy(VERSION 3.14...3.25) ``` -------------------------------- ### Project and Plugin Naming Source: https://github.com/hm21/pro_video_editor/blob/stable/linux/CMakeLists.txt Defines the project name and the plugin library name. The plugin name must not be changed as it's used by the Flutter build system. ```cmake set(PROJECT_NAME "pro_video_editor") project(${PROJECT_NAME} LANGUAGES CXX) set(PLUGIN_NAME "pro_video_editor_plugin") ``` -------------------------------- ### Render Video Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Renders a video based on the provided VideoRenderData configuration. This includes merging video segments, applying image layers, transformations, color filters, and audio tracks. Progress can be monitored via a stream. ```APIDOC ## Render Video ### Description Renders a video with specified configurations including video segments, image layers, transformations, and audio. It returns the rendered video as Uint8List. Progress updates are available via a stream. ### Method POST (conceptual, SDK method call) ### Endpoint `ProVideoEditor.instance.renderVideo(VideoRenderData task)` ### Parameters #### Request Body (`VideoRenderData`) - **id** (string) - Required - A unique identifier for the task. - **videoSegments** (List) - Required - A list of video segments to be merged. - **imageLayers** (List) - Optional - A list of image layers to be applied. - **outputFormat** (VideoOutputFormat) - Optional - The desired output format (e.g., mp4). - **playbackSpeed** (double) - Optional - The playback speed for the video. - **startTime** (Duration) - Optional - The start time for the entire video rendering. - **endTime** (Duration) - Optional - The end time for the entire video rendering. - **blur** (double) - Optional - The blur intensity (experimental feature). - **bitrate** (int) - Optional - The video bitrate. - **enableAudio** (bool) - Optional - Whether to enable audio in the output. - **audioTracks** (List) - Optional - A list of audio tracks to be included. - **transform** (ExportTransform) - Optional - Transformation to apply to the video. - **colorFilters** (List) - Optional - A list of color filters to apply. ### Request Example ```dart var task = VideoRenderData( id: 'my-special-task', videoSegments: [ VideoSegment(video: EditorVideo.asset('assets/my-video.mp4'), volume: 0.7) ], imageLayers: [ ImageLayer(imageBytes: layerBytes, offset: Offset(100, 50), startTime: Duration(seconds: 2), endTime: Duration(seconds: 8)) ], outputFormat: VideoOutputFormat.mp4, playbackSpeed: 2, startTime: Duration(seconds: 5), endTime: Duration(seconds: 20), blur: 10, bitrate: 5000000, enableAudio: false, audioTracks: [ VideoAudioTrack(path: customAudioPath, volume: 0.3) ], transform: ExportTransform(flipX: true, flipY: true, x: 10, y: 20, width: 300, height: 400, rotateTurns: 3, scaleX: .5, scaleY: .5), colorFilters: [ ColorFilter(matrix: [ 1.0, 0.0, 0.0, 0.0, 50.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ]), ColorFilter(matrix: [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ]) ], ); Uint8List result = await ProVideoEditor.instance.renderVideo(task); ``` -------------------------------- ### Define Executable Target Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/runner/CMakeLists.txt Defines the main executable target for the application, including source files. Ensure BINARY_NAME is consistent with the top-level CMakeLists.txt for `flutter run` to function correctly. ```cmake add_executable(${BINARY_NAME} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) ``` -------------------------------- ### Set Minimum CMake Version Source: https://github.com/hm21/pro_video_editor/blob/stable/windows/CMakeLists.txt Specifies the minimum required version of CMake for the project. Ensure Visual Studio includes CMake 3.14 or later. ```cmake cmake_minimum_required(VERSION 3.14) ``` -------------------------------- ### Define Flutter Library Headers Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/flutter/CMakeLists.txt Appends a list of Flutter library header files to the FLUTTER_LIBRARY_HEADERS variable and then prepends the ephemeral directory path to each header. ```cmake list(APPEND FLUTTER_LIBRARY_HEADERS "fl_basic_message_channel.h" "fl_binary_codec.h" "fl_binary_messenger.h" "fl_dart_project.h" "fl_engine.h" "fl_json_message_codec.h" "fl_json_method_codec.h" "fl_message_codec.h" "fl_method_call.h" "fl_method_channel.h" "fl_method_codec.h" "fl_method_response.h" "fl_plugin_registrar.h" "fl_plugin_registry.h" "fl_standard_message_codec.h" "fl_standard_method_codec.h" "fl_string_codec.h" "fl_value.h" "fl_view.h" "flutter_linux.h" ) list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") ``` -------------------------------- ### Generate and Display Audio Waveform Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Generates audio waveform data from a video asset and displays it using the built-in AudioWaveform widget. Supports different resolutions. ```dart /// Basic waveform generation var config = WaveformConfigs( video: EditorVideo.asset('assets/video.mp4'), resolution: WaveformResolution.medium, // low, medium, high, ultra ); WaveformData waveform = await ProVideoEditor.instance.getWaveform(config); print('Samples: ${waveform.sampleCount}'); print('Duration: ${waveform.duration}ms'); print('Stereo: ${waveform.isStereo}'); /// Use the built-in AudioWaveform widget for display AudioWaveform( waveform: waveform, style: WaveformStyle( height: 100, waveColor: Colors.blue, backgroundColor: Colors.grey.shade900, ) ) ``` -------------------------------- ### Cancel Video Render Operation Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Initiates a video render and provides mechanisms to cancel it. Handles `RenderCanceledException` for clean UI state resets. Cancellation is platform-dependent. ```dart final renderModel = VideoRenderData( videoSegments: [ VideoSegment(video: EditorVideo.asset('assets/sample.mp4')), ], ); final outputPath = '${(await getTemporaryDirectory()).path}/video.mp4'; // Start the render. Keep the model.id so you can cancel it later. final renderFuture = ProVideoEditor.instance.renderVideoToFile( outputPath, renderModel, ); // Option 1: fire-and-forget (example app pattern). unawaited(renderFuture); // Option 2: if you await directly, handle cancellation: try { await renderFuture; } on RenderCanceledException { // User canceled: reset UI state, do not treat as an error. } // ...from a UI callback (Android/iOS/macOS only) if (Platform.isAndroid || Platform.isIOS || Platform.isMacOS) { await ProVideoEditor.instance.cancel(renderModel.id); } ``` -------------------------------- ### Add Flutter Tool Build Dependency Source: https://github.com/hm21/pro_video_editor/blob/stable/example/windows/runner/CMakeLists.txt Ensures that the Flutter tool's assembly process is completed before the application target is built. This is a mandatory step for Flutter projects. ```cmake # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Extract Audio from Video Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Extract audio track from a video, supporting MP3, AAC, and M4A formats with optional trimming. It's recommended to check if the video has an audio track before extraction. ```dart /// Check if video has audio before extraction (recommended) final video = EditorVideo.asset('assets/video.mp4'); bool hasAudio = await ProVideoEditor.instance.hasAudioTrack(video); if (!hasAudio) { print('Video has no audio track'); return; } /// Extract with trimming var config = AudioExtractConfigs( video: video, format: AudioFormat.aac, startTime: Duration(seconds: 10), endTime: Duration(seconds: 30), ); /// Save to file instead of returning as Uint8List final directory = await getTemporaryDirectory(); String outputPath = '${directory.path}/extracted_audio.mp3'; try { await ProVideoEditor.instance.extractAudioToFile(outputPath, config); } on AudioNoTrackException { print('Video has no audio track'); } /// Alternative read the Uint8List directly like below. /// Uint8List audioData = await ProVideoEditor.instance.extractAudio(audioConfig); /// Listen to progress StreamBuilder( stream: ProVideoEditor.instance.progressStreamById(config.id), builder: (context, snapshot) { var progress = snapshot.data?.progress ?? 0; return CircularProgressIndicator(value: progress); } ) ``` -------------------------------- ### Set Default Build Type Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/CMakeLists.txt Sets the default build type to 'Debug' if not already specified, ensuring consistent build modes. ```cmake if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() ``` -------------------------------- ### Manual Streaming Waveform Data Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Manually handle streaming waveform data chunks for advanced control or custom visualization. Configure chunk size for emission frequency. ```dart /// For manual stream handling (advanced usage): var config = WaveformConfigs( video: EditorVideo.asset('assets/long-video.mp4'), resolution: WaveformResolution.high, chunkSize: 100, // Emit every 100 samples ); await for (var chunk in ProVideoEditor.instance.getWaveformStream(config)) { print('Progress: ${(chunk.progress * 100).toStringAsFixed(0)}%'); if (chunk.isComplete) { print('Waveform generation complete!'); } } ``` -------------------------------- ### Define List Prepend Function Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/flutter/CMakeLists.txt A custom CMake function to prepend an element to a list, as 'list(TRANSFORM ... PREPEND ...)' is not available in CMake 3.10. ```cmake function(list_prepend LIST_NAME PREFIX) set(NEW_LIST "") foreach(element ${${LIST_NAME}}) list(APPEND NEW_LIST "${PREFIX}${element}") endforeach(element) set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) endfunction() ``` -------------------------------- ### Set Target Properties for Visibility Source: https://github.com/hm21/pro_video_editor/blob/stable/linux/CMakeLists.txt Hides symbols by default to prevent conflicts between plugins. Explicitly export symbols using FLUTTER_PLUGIN_EXPORT if needed. ```cmake set_target_properties(${PLUGIN_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden) target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) ``` -------------------------------- ### Reverse Video Segment Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Render a video segment backwards by setting `reverseVideo` to true. Other segments maintain their original direction. ```dart /// Render a segment backwards by setting reverseVideo to true. /// Other segments keep their original direction. var data = VideoRenderData( videoSegments: [ VideoSegment( video: EditorVideo.file(File('/path/to/clip.mp4')), reverseVideo: true, ), ], outputFormat: VideoOutputFormat.mp4, ); Uint8List result = await ProVideoEditor.instance.renderVideo(data); ``` -------------------------------- ### Merge Multiple Video Clips Source: https://github.com/hm21/pro_video_editor/blob/stable/README.md Concatenate multiple video clips into a single output video. Each clip can have its own trim settings. Clips are joined in the order they appear in the list. ```dart /// Concatenate multiple video clips into a single output video /// Each clip can have its own trim settings (startTime/endTime) var data = VideoRenderData( videoSegments: [ VideoSegment( video: EditorVideo.file(File('/path/to/video1.mp4')), startTime: Duration(seconds: 0), endTime: Duration(seconds: 5), ), VideoSegment( video: EditorVideo.file(File('/path/to/video2.mp4')), startTime: Duration(seconds: 2), endTime: Duration(seconds: 8), ), VideoSegment( video: EditorVideo.asset('assets/video3.mp4'), // No trim - uses full video duration ), ], outputFormat: VideoOutputFormat.mp4, ); Uint8List result = await ProVideoEditor.instance.renderVideo(data); /// Note: You must use either 'video' (single video) OR 'videoSegments' (multiple videos), /// but not both. The clips will be joined in the order they appear in the list. ``` -------------------------------- ### Custom Target for Flutter Assembly Source: https://github.com/hm21/pro_video_editor/blob/stable/example/linux/flutter/CMakeLists.txt Creates a custom target 'flutter_assemble' that depends on the generated Flutter library and its headers, ensuring they are built before other targets that might use them. ```cmake add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ) ```