Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
373344a
Add minizip-ng dependency
darbyjohnston Aug 9, 2025
9371969
Restore changes
darbyjohnston Aug 9, 2025
ac724d2
Add file to CMake
darbyjohnston Aug 9, 2025
8959229
Add missing file
darbyjohnston Aug 9, 2025
5250c4d
Update examples
darbyjohnston Aug 9, 2025
bc99f34
Add CMake install dir
darbyjohnston Aug 9, 2025
dfb9051
Refactor Python tests
darbyjohnston Aug 9, 2025
111ce59
Python lint fixes
darbyjohnston Aug 9, 2025
ecf54dc
Test fixes
darbyjohnston Aug 9, 2025
b231fe4
Update minizip-ng version
darbyjohnston Dec 16, 2025
99fceb6
Add zlib-ng submodule
darbyjohnston Dec 16, 2025
e4fb7d0
Turn off fetch libs
darbyjohnston Dec 16, 2025
b5dc7af
Lets try zlib
darbyjohnston Dec 17, 2025
1fa2335
Build fix
darbyjohnston Dec 17, 2025
d2b7f7f
Restore CMake functionality
darbyjohnston Dec 17, 2025
f8ef561
Try using ZLIB
darbyjohnston Dec 17, 2025
0565975
Find minizip
darbyjohnston Dec 17, 2025
f72630e
Refactoring
darbyjohnston Dec 17, 2025
bfb1746
Various fixes
darbyjohnston Dec 18, 2025
b018a48
Build fix
darbyjohnston Dec 18, 2025
6913ee3
Build fix
darbyjohnston Dec 18, 2025
5db9a64
Add error handling
darbyjohnston Dec 18, 2025
46b929c
Revert change
darbyjohnston Dec 18, 2025
c9243d5
Add uriparser dependency
darbyjohnston Dec 18, 2025
922f60b
Override CMake minimum version
darbyjohnston Dec 18, 2025
94b1309
Build fixes
darbyjohnston Dec 18, 2025
1172e27
CMake config fix
darbyjohnston Dec 19, 2025
7bb887b
Lets try uriparser
darbyjohnston Dec 19, 2025
f9978d5
Build fix
darbyjohnston Dec 19, 2025
84541cb
Temporarily disable some tests
darbyjohnston Dec 19, 2025
c33365a
Build fix
darbyjohnston Dec 19, 2025
4921663
Comment out print statements
darbyjohnston Dec 19, 2025
6fc81f6
Temporarily disable some tests
darbyjohnston Dec 19, 2025
4866818
Formatting fixes
darbyjohnston Dec 19, 2025
39805a9
Build fix
darbyjohnston Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@
[submodule "src/deps/Imath"]
path = src/deps/Imath
url = https://github.com/AcademySoftwareFoundation/Imath
[submodule "src/deps/minizip-ng"]
path = src/deps/minizip-ng
url = https://github.com/zlib-ng/minizip-ng.git
[submodule "src/deps/zlib-ng"]
path = src/deps/zlib-ng
url = https://github.com/zlib-ng/zlib-ng.git
[submodule "src/deps/zlib"]
path = src/deps/zlib
url = https://github.com/madler/zlib.git
[submodule "src/deps/uriparser"]
path = src/deps/uriparser
url = https://github.com/uriparser/uriparser.git
31 changes: 30 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ option(OTIO_INSTALL_PYTHON_MODULES "Install OTIO pure Python modules/files" O
option(OTIO_INSTALL_COMMANDLINE_TOOLS "Install the OTIO command line tools" ON)
option(OTIO_FIND_IMATH "Find Imath using find_package" OFF)
option(OTIO_FIND_RAPIDJSON "Find RapidJSON using find_package" OFF)
option(OTIO_FIND_URIPARSER "Find uriparser using find_package" OFF)
option(OTIO_FIND_BUNDLE_LIBS "Find minizip and zlib using find_package" OFF)
set(OTIO_BUNDLE_LIBS
MINIZIP::minizipstatic ZLIB::ZLIBSTATIC
CACHE STRING "Bundle libraries to link against (minizip and zlib)")
set(OTIO_PYTHON_INSTALL_DIR "" CACHE STRING "Python installation dir (such as the site-packages dir)")

# Build options
#
# If you are building OpenTimelineIO as a static library you will need to
# defined OPENTIME_STATIC and OTIO_STATIC. If you use the provided CMake
# define OPENTIME_STATIC and OTIO_STATIC. If you use the provided CMake
# config files these will be automatically defined for you. To use the
# provided config files add `find_package(OpenTimelineIO)` to your
# CMakeLists.txt file.
Expand Down Expand Up @@ -263,6 +268,30 @@ else()
message(STATUS "Using src/deps/rapidjson by default")
endif()

#----- uriparser
if(OTIO_FIND_URIPARSER)
find_package(uriparser CONFIG REQUIRED)
if (uriparser_FOUND)
message(STATUS "Found uriparser at ${uriparser_CONFIG}")
endif()
else()
message(STATUS "Using src/deps/uriparser by default")
endif()

#----- minizip and zlib
if(OTIO_FIND_BUNDLE_LIBS)
find_package(ZLIB CONFIG REQUIRED)
find_package(minizip CONFIG REQUIRED)
if (ZLIB_FOUND)
message(STATUS "Found zlib at ${ZLIB_CONFIG}")
endif()
if (minizip_FOUND)
message(STATUS "Found minizip at ${minizip_CONFIG}")
endif()
else()
message(STATUS "Using src/deps/zlib by default")
endif()

# set up the internally hosted dependencies
add_subdirectory(src/deps)

Expand Down
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/../src
${PYTHON_INCLUDE_DIRS})

list(APPEND examples bundle)
list(APPEND examples conform)
list(APPEND examples flatten_video_tracks)
list(APPEND examples summarize_timing)
Expand Down
125 changes: 125 additions & 0 deletions examples/bundle.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project

// Example OTIO program that can create and extract bundles.
//
// Usage:
// * bundle (input.otio) (output.otioz)
// Create an .otioz bundle from an .otio file.
//
// * bundle (input.otio) (output.otiod)
// Create an .otiod bundle from an .otio file.
//
// * bundle (input.otioz) (output)
// Extract an .otioz bundle.

#include "util.h"

#include "opentimelineio/bundle.h"
#include "opentimelineio/fileUtils.h"
#include "opentimelineio/timeline.h"

#include <filesystem>

bool
ends_with(std::string const& s, std::string const& find)
{
size_t const s_size = s.size();
size_t const find_size = find.size();
return find_size < s_size ?
s.substr(s_size - find_size, find_size) == find :
false;
}

int
main(int argc, char** argv)
{
// Command line arguments.
if (argc != 3)
{
std::cout << "Usage:\n";
std::cout << " bundle (input.otio) (output.otioz) - "
<< "Create an .otioz bundle from an .otio file.\n";
std::cout << " bundle (input.otio) (output.otiod) - "
<< "Create an .otiod bundle from an .otio file.\n";
std::cout << " bundle (input.otioz) (output) - "
<< "Extract an .otioz bundle.\n";
return 1;
}
const std::string input = OTIO_NS::to_unix_separators(argv[1]);
const std::string output = OTIO_NS::to_unix_separators(argv[2]);

if (ends_with(input, ".otio") && ends_with(output, ".otioz"))
{
// Create an .otioz bundle from an .otio file.

// Open timeline.
OTIO_NS::ErrorStatus error_status;
OTIO_NS::SerializableObject::Retainer<OTIO_NS::Timeline> timeline(
dynamic_cast<OTIO_NS::Timeline*>(
OTIO_NS::Timeline::from_json_file(input, &error_status)));
if (!timeline || OTIO_NS::is_error(error_status))
{
examples::print_error(error_status);
return 1;
}

// Create .otioz bundle.
OTIO_NS::bundle::WriteOptions options;
options.parent_path =
std::filesystem::u8path(input).parent_path().u8string();
if (!OTIO_NS::bundle::to_otioz(
timeline.value,
output,
options,
&error_status))
{
examples::print_error(error_status);
return 1;
}
}
else if (ends_with(input, ".otioz"))
{
// Extract .otioz bundle.
OTIO_NS::bundle::OtiozReadOptions options;
options.extract_path = output;
OTIO_NS::ErrorStatus error_status;
auto result = OTIO_NS::bundle::from_otioz(input, options, &error_status);
if (OTIO_NS::is_error(error_status))
{
examples::print_error(error_status);
return 1;
}
}
else if (ends_with(input, ".otio") && ends_with(output, ".otiod"))
{
// Create an .otiod bundle from an .otio file.

// Open timeline.
OTIO_NS::ErrorStatus error_status;
OTIO_NS::SerializableObject::Retainer<OTIO_NS::Timeline> timeline(
dynamic_cast<OTIO_NS::Timeline*>(
OTIO_NS::Timeline::from_json_file(input, &error_status)));
if (!timeline || OTIO_NS::is_error(error_status))
{
examples::print_error(error_status);
return 1;
}

// Create .otiod bundle.
OTIO_NS::bundle::WriteOptions options;
options.parent_path =
std::filesystem::u8path(input).parent_path().u8string();
if (!OTIO_NS::bundle::to_otiod(
timeline.value,
output,
options,
&error_status))
{
examples::print_error(error_status);
return 1;
}
}

return 0;
}
7 changes: 4 additions & 3 deletions examples/conform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <opentimelineio/clip.h>
#include <opentimelineio/externalReference.h>
#include <opentimelineio/fileUtils.h>
#include <opentimelineio/timeline.h>

#include <iostream>
Expand Down Expand Up @@ -111,9 +112,9 @@ int main(int argc, char** argv)
std::cout << "Usage: conform (input) (folder) (output)" << std::endl;
return 1;
}
const std::string input = examples::normalize_path(argv[1]);
const std::string folder = examples::normalize_path(argv[2]);
const std::string output = examples::normalize_path(argv[3]);
const std::string input = otio::to_unix_separators(argv[1]);
const std::string folder = otio::to_unix_separators(argv[2]);
const std::string output = otio::to_unix_separators(argv[3]);

otio::ErrorStatus error_status;
otio::SerializableObject::Retainer<otio::Timeline> timeline(
Expand Down
11 changes: 6 additions & 5 deletions examples/io_perf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <iostream>

#include "opentimelineio/clip.h"
#include "opentimelineio/fileUtils.h"
#include "opentimelineio/typeRegistry.h"
#include "opentimelineio/serialization.h"
#include "opentimelineio/deserialization.h"
Expand Down Expand Up @@ -93,7 +94,7 @@ main(
const std::string tmp_dir_path = (
RUN_STRUCT.FIXED_TMP
? "/var/tmp/ioperftest"
: examples::create_temp_dir()
: otio::create_temp_dir()
);

otio::ErrorStatus err;
Expand Down Expand Up @@ -123,7 +124,7 @@ main(
cl->metadata()["example thing"] = "banana";
chrono_time_point begin = std::chrono::steady_clock::now();
cl->to_json_file(
examples::normalize_path(tmp_dir_path + "/clip.otio"),
otio::to_unix_separators(tmp_dir_path + "/clip.otio"),
&err,
&downgrade_manifest
);
Expand All @@ -140,7 +141,7 @@ main(
otio::SerializableObject::Retainer<otio::Timeline> timeline(
dynamic_cast<otio::Timeline*>(
otio::Timeline::from_json_file(
examples::normalize_path(argv[1]),
otio::to_unix_separators(argv[1]),
&err
)
)
Expand Down Expand Up @@ -205,7 +206,7 @@ main(
{
begin = std::chrono::steady_clock::now();
timeline.value->to_json_file(
examples::normalize_path(tmp_dir_path + "/io_perf_test.otio"),
otio::to_unix_separators(tmp_dir_path + "/io_perf_test.otio"),
&err,
&downgrade_manifest
);
Expand All @@ -218,7 +219,7 @@ main(
{
begin = std::chrono::steady_clock::now();
timeline.value->to_json_file(
examples::normalize_path(
otio::to_unix_separators(
tmp_dir_path
+ "/io_perf_test.nodowngrade.otio"
),
Expand Down
Loading
Loading