Skip to content

Commit

Permalink
This is DeepDrill 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Jun 25, 2023
1 parent aaf213c commit 19a2c9e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
4 changes: 4 additions & 0 deletions DeepDrill.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,7 @@
50CF8E562694848800887FFC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALLOW_TARGET_PLATFORM_SPECIALIZATION = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
Expand Down Expand Up @@ -1178,15 +1179,18 @@
50CF8E572694848800887FFC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALLOW_TARGET_PLATFORM_SPECIALIZATION = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES;
CODE_SIGN_ENTITLEMENTS = DeepDrill.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 3NG65ZLYW7;
ENABLE_HARDENED_RUNTIME = YES;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_SHADOW = YES;
Expand Down
49 changes: 24 additions & 25 deletions docs/Tutorials/ZoomVideos.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

In this tutorial, you will learn how to create Mandelbrot zoom videos using the DeepDrill toolchain. In particular, you will learn how to compute the following video:

<iframe width="560" height="315" src="https://www.youtube.com/embed/Ayc5bE9nmTA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/M3H2cODlDRc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

Unlike calculating still images, creating a zoom video requires a much more sophisticated workflow. For example, multiple keyframes must be calculated and stitched together in the right way. To simplify the process, video creation has been divided into three phases. In the first phase, `deepmake` is used to create a Makefile and a larger number of input files. In the second phase, the Makefile is executed to compute all keyframe images via seperate invocations to `deepdrill`. In the last phase, `deepzoom` is executed to assemble the final video by calculating intermediate frames.

Expand All @@ -18,22 +18,20 @@ To set up a workflow in this directory, we launch `deepmake` with the following
```
The application first tells you how many files will be created and asks for your permission to proceed:
```
DeepMake 2.0 - (C)opyright Dirk W. Hoffmann
DeepMake 3.0 - (C)opyright Dirk W. Hoffmann
79 files will be created. Do you want to proceed [no]?
182 files will be created.
0 files will be skipped or modified.
Do you want to proceed [y]?
```
After confirming with `yes` or `y`, `deepmake` generates all files:
After confirming by hitting return, `deepmake` generates all necessary files:
```none
DeepMake 2.0 - (C)opyright Dirk W. Hoffmann
79 files will be created. Do you want to proceed [no]? yes
Generating project file: ................................. 0.00 sec
Generating 75 location files: ................................. 0.01 sec
Generating profile: ................................. 0.00 sec
Generating zoomer ini file: ................................. 0.00 sec
Generating 180 ini files: ................................. 0.07 sec
Generating Makefile: ................................. 0.00 sec
Total time: 0.01 sec
Total time: 0.08 sec
```
Let's have a more detailed look at the configuration file. Besides providing the location and iteration parameters, the following key-value pairs are defined:
```INI
Expand All @@ -55,7 +53,7 @@ Let's take a closer look at the files DeepDrill created in the project directory
- `deepzoom.ini`
This file contains several key-value pairs which will be picked up by `deepzoom` to assemble the final video. It plays no role in the creation of the keyframe images.

- `keyframe_0.ini` to 'keyframe_80.ini'
- `keyframe_0.ini` to 'keyframe_180.ini'
These configuration files are used to calculate the keyframes. They are composed out of the configuration files that were passed in as command line arguments when the workflow was set up.

- `Makefile`
Expand All @@ -64,40 +62,41 @@ Let's take a closer look at the files DeepDrill created in the project directory
## Computing all keyframes

For our tutorial project, DeepDrill has created the following Makefile:

```Make
# Generated by DeepDrill 2.0 on Tue Jun 13 18:19:24 2023
# Generated by DeepDrill 3.0
#
# Copyright (C) Dirk W. Hoffmann. www.dirkwhoffmann.de
# Licensed under the GNU General Public License v3

DEEPDRILL = /Users/hoff/tmp/dd/./deepdrill
DEEPZOOM = /Users/hoff/tmp/dd/./deepzoom
MAPS = $(patsubst %.loc,%.map,$(wildcard *_*.loc))
VIDEO = spider.mov
MAPFLAGS = -b -v
MAPS = $(patsubst %.ini,%.map,$(wildcard *_*.ini))
VIDEO = deepzoom.mov

.PHONY: all maps clean

all: maps

maps: $(MAPS)

%.map: %.loc
@$(DEEPDRILL) $(MAPFLAGS) -p spider.prf -o $*.map -o $*.jpg $*.loc > $*.log
%.map: %.ini
@$(DEEPDRILL) -b -v $*.ini -o $*.map -o $*_preview.jpg image.width=320 image.height=200 > $*.log

%.jpg: %.map
@$(DEEPDRILL) -v $*.ini $*.map -o $*.jpg

$(VIDEO): $(IMAGES)
@$(DEEPZOOM) $(MOVFLAGS) spider.prj -o $(VIDEO)
@$(DEEPZOOM) "deepzoom.ini" -o $(VIDEO)

clean:
rm *.mov *.map *.jpg *.log
@rm *.mov *.map *.jpg *.log
```
The Makefile defines two major goals: One is to create the map files from the location files and the other one is to compose the final video. To create all map files, we change to the project directory and run the Make utility:
```shell
cd project
make -j4
```
The `-j` option instructs Make to run multiple jobs in parallel, four jobs in this case. Although this option is not mandatory, its use is strongly recommended as it significantly reduces the overall computation time.
The `-j` option instructs Make to run multiple jobs in parallel, four in this case. Although this option is not mandatory, its use is strongly recommended as it significantly reduces the overall computation time.

Depending on the performance of your machine, it may take a while to calculate all images. DeepDrill informs about the current progress by outputting brief status information:
```none
Expand Down Expand Up @@ -125,6 +124,6 @@ After successful completion, the project directory contains a map file and an im

The final step is to combine all the keyframes into a zoom video by calling `make` with the `spider.mov` target as argument:
```shell
make spider.mov
make deepzoom.mov
```
This target executes a separate tool called `deepzoom` which stiches together all previously computed keyframes. After completion, file `spider.mov` will be created, which contains the final video.
This target executes a separate tool called `deepzoom` which stiches together all previously computed keyframes. After completion, file `deepzoom.mov` will be created, which contains the final video.
3 changes: 2 additions & 1 deletion src/dmake/DeepMake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ DeepMake::run()
auto project = opt.files.outputs.front();
add(project / "Makefile");
add(project / AssetManager::iniFile());
for (isize i = 0; i < opt.video.keyframes; i++) {
for (isize i = 0; i <= opt.video.keyframes; i++) {
add(project / AssetManager::iniFile(i));
}

Expand All @@ -93,6 +93,7 @@ DeepMake::run()

if (s == "y" || s == "yes" || s == "") {

log::cout << log::endl;
Maker(*this, opt).generate();
return;
}
Expand Down

0 comments on commit 19a2c9e

Please sign in to comment.