Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjohnston committed Sep 16, 2024
1 parent d99b1f7 commit 1f2b6c7
Show file tree
Hide file tree
Showing 15 changed files with 930 additions and 191 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(
HOMEPAGE_URL "https://github.com/darbyjohnston/toucan"
LANGUAGES CXX C)

set(toucan_VIEWER ON CACHE BOOL "Build viewer application")
set(toucan_VIEW ON CACHE BOOL "Build viewer application")

list(PREPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

Expand Down Expand Up @@ -51,7 +51,7 @@ find_package(OpenColorIO)
find_package(OpenImageIO)
find_package(OTIO)
find_package(OpenFX)
if(toucan_VIEWER)
if(toucan_VIEW)
find_package(dtk)
endif()

Expand Down
66 changes: 54 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@
Toucan
======

Toucan is a project for experimenting with rendering timelines. The project
currently consists of a command line program that can render timelines into
image sequences.

Features:
* Composite multiple video tracks with effects and transitions
* [OpenColorIO](https://github.com/AcademySoftwareFoundation/OpenColorIO) transforms applied to individual clips and tracks
* [OpenFX](https://github.com/AcademySoftwareFoundation/openfx) based plugin system for image generators, effects, and transitions
* [OpenImageIO](https://github.com/AcademySoftwareFoundation/OpenImageIO) image I/O and processing

Image Effects
=============
Toucan is an experimental project for rendering timelines. The project
currently consists of:
* C++ library for rendering timelines
* OpenFX image effect plugins
* Command line renderer
* Interactive viewer
* Example .otio files

OpenFX Image Effect Plugins
===========================
* Generators: Checkers, Fill, Gradient, Noise
* Drawing: Box, Line, Text
* Filters: Blur, Color Map, Invert, Power, Saturate, Unsharp Mask
Expand Down Expand Up @@ -80,6 +78,31 @@ Multiple effects on clips, tracks, and stacks:

![Multiple Effects Graph](images/MultipleEffectsGraph.svg)

FFmpeg
======
The toucan command line renderer can output raw frames to standard out.
These frames can be piped to FFmpeg for encoding as a movie file.
Example command line:
```
toucan-render Transition.otio - -raw rgba | ffmpeg -y -f rawvideo -pix_fmt rgba -s 1280x720 -r 24 -i pipe: output.mov
```
Notes:
* The `-` tells `toucan-render` to use standard out instead of an output file.
* The `-raw` option specifies the pixel format of the frames. This should match
the `-pix_fmt` option given to `ffmpeg`. One exception to this is that the
`toucan-render` options do not specify the endian, the endian of the current machine
is used. So for example the option `-raw rgbaf16` might match the `ffmpeg` option
`-pix_fmt rgbaf16le`.
* The `-y` flag tells `ffmpeg` to overwrite the output file.
* The `-f` flag tells `ffmpeg` the input is raw video frames.
* The `-pix_fmt` option specifies the input pixel format as described above.
* The `-size` options specifies the size of the input frames. The `toucan-render` can
print the image size of a timeline with the `-print_size` option.
* The `-r` option specfies the frame rate. The `toucan-render` can print the rate
of a timeline with the `-print_rate` option.
* The `-i pipe:` option tells `ffmpeg` to use standard input.
* Finally, `output.mov` specifies the output movie file.

Building
========

Expand All @@ -93,6 +116,13 @@ Run the super build:
```
sh toucan/SuperBuild.sh Release
```
Run the viewer application:
```
export LD_LIBRARY_PATH=$PWD/install-Release/lib:$LD_LIBRARY_PATH
```
```
install-Release/bin/toucan-view toucan/data/Transition.otio
```

Building on macOS
-----------------
Expand All @@ -104,6 +134,10 @@ Run the super build:
```
sh toucan/SuperBuild.sh Release
```
Run the viewer application:
```
install-Release/bin/toucan-view toucan/data/Transition.otio
```

Building on Windows
-------------------
Expand All @@ -115,3 +149,11 @@ Run the super build:
```
toucan\SuperBuild.bat Release
```
Run the viewer application:
```
set PATH=%CD%\install-Release\bin;%PATH%
```
```
install-Release\bin\toucan-view.exe toucan\data\Transition.otio
```

2 changes: 2 additions & 0 deletions SuperBuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ cmake --build superbuild-%BUILD_TYPE% -j 4 --config %BUILD_TYPE%

cmake -S toucan -B build-%BUILD_TYPE% -DCMAKE_INSTALL_PREFIX=%CD%\install-%BUILD_TYPE% -DCMAKE_PREFIX_PATH=%CD%\install-%BUILD_TYPE% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
cmake --build build-%BUILD_TYPE% -j 4 --config %BUILD_TYPE%
cmake --build build-$BUILD_TYPE --target INSTALL

2 changes: 2 additions & 0 deletions SuperBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ cmake --build superbuild-$BUILD_TYPE -j 4 --config $BUILD_TYPE

cmake -S toucan -B build-$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$PWD/install-$BUILD_TYPE -DCMAKE_PREFIX_PATH=$PWD/install-$BUILD_TYPE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
cmake --build build-$BUILD_TYPE -j 4 --config $BUILD_TYPE
cmake --build build-$BUILD_TYPE --target install

2 changes: 1 addition & 1 deletion bin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_subdirectory(toucan-render)
if(toucan_VIEWER)
if(toucan_VIEW)
add_subdirectory(toucan-view)
endif()
Loading

0 comments on commit 1f2b6c7

Please sign in to comment.