You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Merge branch 'develop' into add-features
This commit is contained in:
@@ -40,8 +40,8 @@ For more information, please visit <http://www.openshot.org/>.
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
|
||||
|
||||
################ PROJECT VERSION ####################
|
||||
set(PROJECT_VERSION_FULL "0.2.4-dev1")
|
||||
set(PROJECT_SO_VERSION 18)
|
||||
set(PROJECT_VERSION_FULL "0.2.5-dev1")
|
||||
set(PROJECT_SO_VERSION 19)
|
||||
|
||||
# Remove the dash and anything following, to get the #.#.# version for project()
|
||||
STRING(REGEX REPLACE "\-.*$" "" VERSION_NUM "${PROJECT_VERSION_FULL}")
|
||||
|
||||
@@ -59,6 +59,13 @@
|
||||
# 2019-12-19, FeRD (Frank Dana)
|
||||
# - Rename Lcov outputs, make filtered file canonical, fix cleanup for targets
|
||||
#
|
||||
# 2020-01-19, Bob Apthorpe
|
||||
# - Added gfortran support
|
||||
#
|
||||
# 2020-02-17, FeRD (Frank Dana)
|
||||
# - Make all add_custom_target()s VERBATIM to auto-escape wildcard characters
|
||||
# in EXCLUDEs, and remove manual escaping from gcovr targets
|
||||
#
|
||||
# USAGE:
|
||||
#
|
||||
# 1. Copy this file into your cmake modules path.
|
||||
@@ -122,12 +129,22 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
|
||||
message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
|
||||
endif()
|
||||
elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
|
||||
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang")
|
||||
# Do nothing; exit conditional without error if true
|
||||
elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
||||
# Do nothing; exit conditional without error if true
|
||||
else()
|
||||
message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
|
||||
CACHE INTERNAL "")
|
||||
|
||||
set(CMAKE_Fortran_FLAGS_COVERAGE
|
||||
${COVERAGE_COMPILER_FLAGS}
|
||||
CACHE STRING "Flags used by the Fortran compiler during coverage builds."
|
||||
FORCE )
|
||||
set(CMAKE_CXX_FLAGS_COVERAGE
|
||||
${COVERAGE_COMPILER_FLAGS}
|
||||
CACHE STRING "Flags used by the C++ compiler during coverage builds."
|
||||
@@ -145,6 +162,7 @@ set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
|
||||
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
|
||||
FORCE )
|
||||
mark_as_advanced(
|
||||
CMAKE_Fortran_FLAGS_COVERAGE
|
||||
CMAKE_CXX_FLAGS_COVERAGE
|
||||
CMAKE_C_FLAGS_COVERAGE
|
||||
CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||
@@ -154,7 +172,7 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
|
||||
endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
|
||||
link_libraries(gcov)
|
||||
endif()
|
||||
|
||||
@@ -242,6 +260,7 @@ function(setup_target_for_coverage_lcov)
|
||||
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
DEPENDS ${Coverage_DEPENDENCIES}
|
||||
VERBATIM # Protect arguments to commands
|
||||
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
|
||||
)
|
||||
|
||||
@@ -304,9 +323,8 @@ function(setup_target_for_coverage_gcovr_xml)
|
||||
# Combine excludes to several -e arguments
|
||||
set(GCOVR_EXCLUDE_ARGS "")
|
||||
foreach(EXCLUDE ${GCOVR_EXCLUDES})
|
||||
string(REPLACE "*" "\\*" EXCLUDE_REPLACED ${EXCLUDE})
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE_REPLACED}")
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
||||
endforeach()
|
||||
|
||||
add_custom_target(${Coverage_NAME}
|
||||
@@ -321,6 +339,7 @@ function(setup_target_for_coverage_gcovr_xml)
|
||||
BYPRODUCTS ${Coverage_NAME}.xml
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
DEPENDS ${Coverage_DEPENDENCIES}
|
||||
VERBATIM # Protect arguments to commands
|
||||
COMMENT "Running gcovr to produce Cobertura code coverage report."
|
||||
)
|
||||
|
||||
@@ -376,9 +395,8 @@ function(setup_target_for_coverage_gcovr_html)
|
||||
# Combine excludes to several -e arguments
|
||||
set(GCOVR_EXCLUDE_ARGS "")
|
||||
foreach(EXCLUDE ${GCOVR_EXCLUDES})
|
||||
string(REPLACE "*" "\\*" EXCLUDE_REPLACED ${EXCLUDE})
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE_REPLACED}")
|
||||
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
||||
endforeach()
|
||||
|
||||
add_custom_target(${Coverage_NAME}
|
||||
@@ -393,9 +411,11 @@ function(setup_target_for_coverage_gcovr_html)
|
||||
-r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
|
||||
--object-directory=${PROJECT_BINARY_DIR}
|
||||
-o ${Coverage_NAME}/index.html
|
||||
|
||||
BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
DEPENDS ${Coverage_DEPENDENCIES}
|
||||
VERBATIM # Protect arguments to commands
|
||||
COMMENT "Running gcovr to produce HTML code coverage report."
|
||||
)
|
||||
|
||||
@@ -410,5 +430,6 @@ endfunction() # setup_target_for_coverage_gcovr_html
|
||||
function(append_coverage_compiler_flags)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
|
||||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
|
||||
message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
|
||||
endfunction() # append_coverage_compiler_flags
|
||||
|
||||
@@ -110,9 +110,9 @@ namespace openshot {
|
||||
|
||||
/// Get and Set JSON methods
|
||||
virtual std::string Json() = 0; ///< Generate JSON string of this object
|
||||
virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object
|
||||
virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object
|
||||
virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object
|
||||
virtual void SetJson(const std::string value) = 0; ///< Load JSON string into this object
|
||||
virtual Json::Value JsonValue() = 0; ///< Generate Json::Value for this object
|
||||
virtual void SetJsonValue(const Json::Value root) = 0; ///< Load Json::Value into this object
|
||||
virtual ~CacheBase() = default;
|
||||
|
||||
};
|
||||
|
||||
@@ -129,9 +129,9 @@ namespace openshot {
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -111,9 +111,9 @@ namespace openshot {
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -157,10 +157,10 @@ namespace openshot
|
||||
std::string Name() { return "ChunkReader"; };
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
std::string Json() const override; ///< Generate JSON string of this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
|
||||
/// Open the reader. This is required before you can access frames or data from the reader.
|
||||
void Open();
|
||||
|
||||
@@ -187,18 +187,18 @@ namespace openshot {
|
||||
openshot::ReaderBase* Reader();
|
||||
|
||||
/// Override End() method
|
||||
float End(); ///< Get end position (in seconds) of clip (trim end of video), which can be affected by the time curve.
|
||||
float End() const; ///< Get end position (in seconds) of clip (trim end of video), which can be affected by the time curve.
|
||||
void End(float value) { end = value; } ///< Set end position (in seconds) of clip (trim end of video)
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
std::string Json() const override; ///< Generate JSON string of this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame);
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
|
||||
/// @brief Remove an effect from the clip
|
||||
/// @param effect Remove an effect from the clip.
|
||||
|
||||
@@ -56,10 +56,10 @@ namespace openshot {
|
||||
std::string previous_properties; ///< This string contains the previous JSON properties
|
||||
|
||||
/// Generate JSON for a property
|
||||
Json::Value add_property_json(std::string name, float value, std::string type, std::string memo, Keyframe* keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame);
|
||||
Json::Value add_property_json(std::string name, float value, std::string type, std::string memo, const Keyframe* keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame) const;
|
||||
|
||||
/// Generate JSON choice for a property (dropdown properties)
|
||||
Json::Value add_property_choice_json(std::string name, int value, int selected_value);
|
||||
Json::Value add_property_choice_json(std::string name, int value, int selected_value) const;
|
||||
|
||||
public:
|
||||
|
||||
@@ -73,12 +73,12 @@ namespace openshot {
|
||||
bool operator>= ( ClipBase& a) { return (Position() >= a.Position()); }
|
||||
|
||||
/// Get basic properties
|
||||
std::string Id() { return id; } ///< Get the Id of this clip object
|
||||
float Position() { return position; } ///< Get position on timeline (in seconds)
|
||||
int Layer() { return layer; } ///< Get layer of clip on timeline (lower number is covered by higher numbers)
|
||||
float Start() { return start; } ///< Get start position (in seconds) of clip (trim start of video)
|
||||
float End() { return end; } ///< Get end position (in seconds) of clip (trim end of video)
|
||||
float Duration() { return end - start; } ///< Get the length of this clip (in seconds)
|
||||
std::string Id() const { return id; } ///< Get the Id of this clip object
|
||||
float Position() const { return position; } ///< Get position on timeline (in seconds)
|
||||
int Layer() const { return layer; } ///< Get layer of clip on timeline (lower number is covered by higher numbers)
|
||||
float Start() const { return start; } ///< Get start position (in seconds) of clip (trim start of video)
|
||||
float End() const { return end; } ///< Get end position (in seconds) of clip (trim end of video)
|
||||
float Duration() const { return end - start; } ///< Get the length of this clip (in seconds)
|
||||
|
||||
/// Set basic properties
|
||||
void Id(std::string value) { id = value; } ///> Set the Id of this clip object
|
||||
@@ -88,14 +88,14 @@ namespace openshot {
|
||||
void End(float value) { end = value; } ///< Set end position (in seconds) of clip (trim end of video)
|
||||
|
||||
/// Get and Set JSON methods
|
||||
virtual std::string Json() = 0; ///< Generate JSON string of this object
|
||||
virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object
|
||||
virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object
|
||||
virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object
|
||||
virtual std::string Json() const = 0; ///< Generate JSON string of this object
|
||||
virtual void SetJson(const std::string value) = 0; ///< Load JSON string into this object
|
||||
virtual Json::Value JsonValue() const = 0; ///< Generate Json::Value for this object
|
||||
virtual void SetJsonValue(const Json::Value root) = 0; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
virtual std::string PropertiesJSON(int64_t requested_frame) = 0;
|
||||
virtual std::string PropertiesJSON(int64_t requested_frame) const = 0;
|
||||
|
||||
virtual ~ClipBase() = default;
|
||||
};
|
||||
|
||||
@@ -69,10 +69,10 @@ namespace openshot {
|
||||
static long GetDistance(long R1, long G1, long B1, long R2, long G2, long B2);
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
std::string Json() const; ///< Generate JSON string of this object
|
||||
Json::Value JsonValue() const; ///< Generate Json::Value for this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -66,10 +66,10 @@ namespace openshot {
|
||||
Coordinate(double x, double y);
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
std::string Json() const; ///< Generate JSON string of this object
|
||||
Json::Value JsonValue() const; ///< Generate Json::Value for this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -118,10 +118,10 @@ namespace openshot
|
||||
std::string Name() { return "DecklinkReader"; };
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
std::string Json() const override; ///< Generate JSON string of this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue() const; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
|
||||
/// Open device and video stream - which is called by the constructor automatically
|
||||
void Open();
|
||||
|
||||
@@ -87,10 +87,10 @@ namespace openshot
|
||||
std::string Name() { return "DummyReader"; };
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
std::string Json() const override; ///< Generate JSON string of this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
|
||||
/// Open File - which is called by the constructor automatically
|
||||
void Open();
|
||||
|
||||
@@ -94,14 +94,14 @@ namespace openshot
|
||||
void InitEffectInfo();
|
||||
|
||||
/// Get and Set JSON methods
|
||||
virtual std::string Json() = 0; ///< Generate JSON string of this object
|
||||
virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object
|
||||
virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object
|
||||
virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object
|
||||
Json::Value JsonInfo(); ///< Generate JSON object of meta data / info
|
||||
virtual std::string Json() const = 0; ///< Generate JSON string of this object
|
||||
virtual void SetJson(const std::string value) = 0; ///< Load JSON string into this object
|
||||
virtual Json::Value JsonValue() const = 0; ///< Generate Json::Value for this object
|
||||
virtual void SetJsonValue(const Json::Value root) = 0; ///< Load Json::Value into this object
|
||||
Json::Value JsonInfo() const; ///< Generate JSON object of meta data / info
|
||||
|
||||
/// Get the order that this effect should be executed.
|
||||
int Order() { return order; }
|
||||
int Order() const { return order; }
|
||||
|
||||
/// Set the order that this effect should be executed.
|
||||
void Order(int new_order) { order = new_order; }
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace openshot
|
||||
|
||||
/// JSON methods
|
||||
static std::string Json(); ///< Generate JSON string of this object
|
||||
static Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
static Json::Value JsonValue(); ///< Generate Json::Value for this object
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -76,11 +76,11 @@ namespace openshot {
|
||||
*
|
||||
* @code
|
||||
* // Create a reader for a video
|
||||
* FFmpegReader r("MyAwesomeVideo.webm");
|
||||
* openshot::FFmpegReader r("MyAwesomeVideo.webm");
|
||||
* r.Open(); // Open the reader
|
||||
*
|
||||
* // Get frame number 1 from the video
|
||||
* std::shared_ptr<Frame> f = r.GetFrame(1);
|
||||
* std::shared_ptr<openshot::Frame> f = r.GetFrame(1);
|
||||
*
|
||||
* // Now that we have an openshot::Frame object, lets have some fun!
|
||||
* f->Display(); // Display the frame on the screen
|
||||
@@ -264,10 +264,10 @@ namespace openshot {
|
||||
std::string Name() { return "FFmpegReader"; };
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
std::string Json() const override; ///< Generate JSON string of this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
|
||||
/// Open File - which is called by the constructor automatically
|
||||
void Open();
|
||||
|
||||
@@ -75,15 +75,19 @@ namespace openshot {
|
||||
* @code SIMPLE EXAMPLE
|
||||
*
|
||||
* // Create a reader for a video
|
||||
* FFmpegReader r("MyAwesomeVideo.webm");
|
||||
* r.Open(); // Open thetarget_ reader
|
||||
* openshot::FFmpegReader r("MyAwesomeVideo.webm");
|
||||
* r.Open(); // Open the target reader
|
||||
*
|
||||
* // Create a writer (which will create a WebM video)
|
||||
* FFmpegWriter w("/home/jonathan/NewVideo.webm");
|
||||
* openshot::FFmpegWriter w("/home/jonathan/NewVideo.webm");
|
||||
*
|
||||
* // Set options
|
||||
* w.SetAudioOptions(true, "libvorbis", 44100, 2, ChannelLayout::LAYOUT_STEREO, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000
|
||||
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000); // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
|
||||
*
|
||||
* // Sample Rate: 44100, Channels: 2, Bitrate: 128000
|
||||
* w.SetAudioOptions(true, "libvorbis", 44100, 2, openshot::ChannelLayout::LAYOUT_STEREO, 128000);
|
||||
*
|
||||
* // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
|
||||
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000);
|
||||
*
|
||||
* // Open the writer
|
||||
* w.Open();
|
||||
@@ -102,15 +106,19 @@ namespace openshot {
|
||||
* @code ADVANCED WRITER EXAMPLE
|
||||
*
|
||||
* // Create a reader for a video
|
||||
* FFmpegReader r("MyAwesomeVideo.webm");
|
||||
* openshot::FFmpegReader r("MyAwesomeVideo.webm");
|
||||
* r.Open(); // Open the reader
|
||||
*
|
||||
* // Create a writer (which will create a WebM video)
|
||||
* FFmpegWriter w("/home/jonathan/NewVideo.webm");
|
||||
* openshot::FFmpegWriter w("/home/jonathan/NewVideo.webm");
|
||||
*
|
||||
* // Set options
|
||||
* w.SetAudioOptions(true, "libvorbis", 44100, 2, ChannelLayout::LAYOUT_STEREO, 128000); // Sample Rate: 44100, Channels: 2, Bitrate: 128000
|
||||
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000); // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
|
||||
*
|
||||
* // Sample Rate: 44100, Channels: 2, Bitrate: 128000
|
||||
* w.SetAudioOptions(true, "libvorbis", 44100, 2, openshot::ChannelLayout::LAYOUT_STEREO, 128000);
|
||||
*
|
||||
* // FPS: 24, Size: 720x480, Pixel Ratio: 1/1, Bitrate: 300000
|
||||
* w.SetVideoOptions(true, "libvpx", openshot::Fraction(24,1), 720, 480, openshot::Fraction(1,1), false, false, 300000);
|
||||
*
|
||||
* // Prepare Streams (Optional method that must be called before any SetOption calls)
|
||||
* w.PrepareStreams();
|
||||
@@ -285,8 +293,21 @@ namespace openshot {
|
||||
/// @param channels The number of audio channels needed in this file
|
||||
/// @param channel_layout The 'layout' of audio channels (i.e. mono, stereo, surround, etc...)
|
||||
/// @param bit_rate The audio bit rate used during encoding
|
||||
///
|
||||
/// \note This is an overloaded function.
|
||||
void SetAudioOptions(bool has_audio, std::string codec, int sample_rate, int channels, openshot::ChannelLayout channel_layout, int bit_rate);
|
||||
|
||||
/// @brief Set audio export options.
|
||||
///
|
||||
/// Enables the stream and configures a default 2-channel stereo layout.
|
||||
///
|
||||
/// @param codec The codec used to encode the audio for this file
|
||||
/// @param sample_rate The number of audio samples needed in this file
|
||||
/// @param bit_rate The audio bit rate used during encoding
|
||||
///
|
||||
/// \note This is an overloaded function.
|
||||
void SetAudioOptions(std::string codec, int sample_rate, int bit_rate);
|
||||
|
||||
/// @brief Set the cache size
|
||||
/// @param new_size The number of frames to queue before writing to the file
|
||||
void SetCacheSize(int new_size) { cache_size = new_size; };
|
||||
@@ -301,10 +322,27 @@ namespace openshot {
|
||||
/// @param interlaced Does this video need to be interlaced?
|
||||
/// @param top_field_first Which frame should be used as the top field?
|
||||
/// @param bit_rate The video bit rate used during encoding
|
||||
///
|
||||
/// \note This is an overloaded function.
|
||||
void SetVideoOptions(bool has_video, std::string codec, openshot::Fraction fps, int width, int height, openshot::Fraction pixel_ratio, bool interlaced, bool top_field_first, int bit_rate);
|
||||
|
||||
/// @brief Set video export options.
|
||||
///
|
||||
/// Enables the stream and configures non-interlaced video with a 1:1 pixel aspect ratio.
|
||||
///
|
||||
/// @param codec The codec used to encode the images in this video
|
||||
/// @param width The width in pixels of this video
|
||||
/// @param height The height in pixels of this video
|
||||
/// @param fps The number of frames per second
|
||||
/// @param bit_rate The video bit rate used during encoding
|
||||
///
|
||||
/// \note This is an overloaded function.
|
||||
/// \warning Observe the argument order, which is consistent with the openshot::Timeline constructor, but differs from the other signature.
|
||||
void SetVideoOptions(std::string codec, int width, int height, openshot::Fraction fps, int bit_rate);
|
||||
|
||||
/// @brief Set custom options (some codecs accept additional params). This must be called after the
|
||||
/// PrepareStreams() method, otherwise the streams have not been initialized yet.
|
||||
///
|
||||
/// @param stream The stream (openshot::StreamType) this option should apply to
|
||||
/// @param name The name of the option you want to set (i.e. qmin, qmax, etc...)
|
||||
/// @param value The new value of this option
|
||||
@@ -316,12 +354,16 @@ namespace openshot {
|
||||
|
||||
/// @brief Add a frame to the stack waiting to be encoded.
|
||||
/// @param frame The openshot::Frame object to write to this image
|
||||
///
|
||||
/// \note This is an overloaded function.
|
||||
void WriteFrame(std::shared_ptr<openshot::Frame> frame);
|
||||
|
||||
/// @brief Write a block of frames from a reader
|
||||
/// @param reader A openshot::ReaderBase object which will provide frames to be written
|
||||
/// @param start The starting frame number of the reader
|
||||
/// @param length The number of frames to write
|
||||
///
|
||||
/// \note This is an overloaded function.
|
||||
void WriteFrame(openshot::ReaderBase *reader, int64_t start, int64_t length);
|
||||
|
||||
/// @brief Write the file trailer (after all frames are written). This is called automatically
|
||||
|
||||
@@ -199,10 +199,10 @@ namespace openshot
|
||||
std::string Name() { return "FrameMapper"; };
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
std::string Json() const override; ///< Generate JSON string of this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
|
||||
/// Open the internal reader
|
||||
void Open();
|
||||
|
||||
@@ -106,10 +106,10 @@ namespace openshot
|
||||
std::string Name() { return "ImageReader"; };
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json(); ///< Generate JSON string of this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
std::string Json() const override; ///< Generate JSON string of this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
Json::Value JsonValue() const; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
|
||||
/// Open File - which is called by the constructor automatically
|
||||
void Open();
|
||||
|
||||
@@ -31,6 +31,12 @@
|
||||
#ifndef OPENSHOT_JSON_H
|
||||
#define OPENSHOT_JSON_H
|
||||
|
||||
#include <string>
|
||||
#include "json/json.h"
|
||||
#include "Exceptions.h"
|
||||
|
||||
namespace openshot {
|
||||
const Json::Value stringToJson(const std::string value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -133,9 +133,9 @@ namespace openshot {
|
||||
|
||||
/// Get and Set JSON methods
|
||||
std::string Json() const; ///< Generate JSON string of this object
|
||||
Json::Value JsonValue() const; ///< Generate Json::JsonValue for this object
|
||||
void SetJson(std::string value); ///< Load JSON string into this object
|
||||
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
|
||||
Json::Value JsonValue() const; ///< Generate Json::Value for this object
|
||||
void SetJson(const std::string value); ///< Load JSON string into this object
|
||||
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
|
||||
|
||||
/// Remove a point by matching a coordinate
|
||||
void RemovePoint(Point p);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user