動画の時間処理の仕組み

Time Flow Sketch 1.25 が、読み込んだ動画のどの瞬間を、出力のいつ映すのか

図の曲線は、アプリの描画処理と同じ式で計算して描いています。

一言でいうと

1. 全体の流れ

素材から出力フレームまでの 8 段階の流れ
上段は入力側の設定(読み込みと使用範囲)、下段は出力の 1 コマごとに計算すること。下段は毎コマ、上段のキューブ(読み込んだフレームの束)と使用範囲を参照します。枠の青は読み込み範囲、橙は使用範囲で、以降の図と同じ色です。

2. 3 つの範囲: 素材・読み込み範囲・使用範囲

素材・読み込み範囲・使用範囲の関係と、読み込み範囲の外で絵が止まる様子
上の帯が 3 つの範囲の関係。左下は、計算した時刻が読み込み範囲の外に出たとき実際に映る絵で、端で平らになります。右下は使用範囲を 8–26 秒に広げた例で、出力の最後の 6 秒は 20 秒の絵のまま止まります。

3. モードごとの時間の決まり方

出力には位置 p(0→1 で 1 周)という時計があります。スリットはマップの 1 行(横スリットは 1 列)を p で選びます。サーフェス×レートは画素ごとに独立した時計を持ち、サーフェス×時間は共通の時計から画素ごとに一定量ずれます。起動時は縦スリット×時間マップです。

4 つの組み合わせで、出力の位置と素材の時刻の関係を比べた図
どの実線も橙の帯(使用範囲)の中に収まります((b) の点線は調整しなかった場合)。(b) は一番はみ出す列に合わせて全列を一律に縮めるので、グレーの列も等速より遅くなります。(c) は赤丸(同期点)で全画素がそろいます。
モード明るさの意味出力の各瞬間に映る素材の時刻範囲の外
スリット×時間黒=使用範囲の始め、白=終わり始め + g × 使用範囲の長さ。既定のグラデーションは等速再生出ない。1 周の継ぎ目で終わり→始めへ飛ぶ
スリット×レートその列(横スリットは行)の速さ。黒=黒レート(既定 0=停止)、白=白レート(既定 +1=順再生)、その間は補間。「逆再生あり」なら黒 −1・白 +1 で、グレーが停止速さを上から(横スリットは左から)足し合わせた軌道。出力 1 周の「同期位置」の瞬間に全スリットがそろい(既定は 0=出力の始め)、そこから前後へ進む収まるよう全体をずらすか一律に縮める。回り込まない
サーフェス×レート画素の速さ。黒=黒レート(既定 0=停止)、白=白レート(既定 +1)、その間は補間。「逆再生あり」なら黒 −1・白 +1 で、グレーが停止出力 1 周の「同期位置」と同じ割合の瞬間に、全画素が素材の同期位置にそろい(既定は 0.5=真ん中で真ん中)、そこから各自の速さで進む使用範囲の中で回り込む
サーフェス×時間グレー=そのまま、白/黒=変位量の半分だけ先/前等速で進む時刻から (g − 0.5) × 変位量 秒ずらす使用範囲の中で回り込む
空間マップ(共通)どの列(横スリットは行)を映すか時間は変えない—

4. 3D で見る: 立体グラフ

編集画面の右上の表示切替で「立体グラフ」を選ぶと、出力の絵やマップと並べてこの図が出ます。道具を出したままなら、描きながら同じ図を見られます。トップ画面のマップを横にスワイプしても見られます。右上の「断面」を「ライン」にすると、面を絵ではなく、時間グラフと同じ色の線で示します。図の時刻は、出力の絵を描くのと同じ関数で計算しています。

モードごとの面の形

時間グラフ: 3 章の図の 2D 版

表示切替で選べる「時間グラフ」は、3 章の図と同じ読み方の図を、いまのマップ・モード・パラメータで描きます。

5. 出力の長さ

モードとマップの中身で出力 1 周の長さがどう変わるか
黒丸が再生時間 1×、灰色の棒が 0.25×〜4× の範囲。同じ使用範囲 8 秒でも、モードとマップの中身で 4〜80 秒に変わります。
サーフェス×レートで、再生時間 1× と 2× の軌道を比べた図
上段(1×)では、いちばん急な線が 1 周でちょうど下端から上端へ渡ります。下段(2×)では速さは同じまま 1 周が倍になり、最速の画素は途中で 2 回回り込みます。

6. 読み込みとフレームの間引き

設定の映像の読み込み。解像度、読み込む秒数、フレームの間引き
設定の「映像の読み込み」。解像度と秒数を選ぶと、間引きの有無が「フレーム」に出ます
120fps の素材を 3 コマに 1 枚読んだときのフレームの参照のしかた
上は 120fps の素材を 3 コマに 1 枚だけ読む様子(実効 40fps)。下はそれを速さ 0.25×(時間マップなら再生時間 4×)で見た場合。スリットは最も近い 1 枚を使うので階段状にカクつき、サーフェスは隣の 2 枚を混ぜるので動きは滑らかですが二重像になります。

7. 入力映像(プレビュー)と使用範囲の操作

8. 音と書き出し

9. つまずきやすい点

編集画面の各項目の横にある「i」ボタンでも、その項目の説明を確認できます。


How time processing works

Which moment of your video Time Flow Sketch 1.25 shows at each instant of the output

The curves in the figures are computed with the same formulas the app uses to render.

In short

1. The pipeline

Eight stages from the source clip to an output frame
The top row is set up on the input side (loading and the use range); the bottom row is computed for every output frame and reads the frame cube (the loaded frames) and the use range each time. Blue marks the loaded range and orange the use range, here and in every later figure.

2. Three spans: clip, loaded range, use range

How the clip, the loaded range and the use range relate, and how the picture freezes outside the loaded range
Top: how the three spans nest. Bottom left: the frame you actually see when a computed time falls outside the loaded range — it flattens at the edges. Bottom right: with the use range widened to 8–26 s, the last 6 seconds of the output stay on the 20-second frame.

3. How each mode decides the time

The output has a clock, position p, running 0→1 once per loop. A slit mode uses p to pick one row of the map (one column for a horizontal slit). Surface × rate gives every pixel its own clock; surface × time offsets every pixel by a fixed amount from a shared clock. A new session starts on vertical slit × time map.

Output position against clip time for the four combinations
Every solid line stays inside the orange band (the use range); the dashed line in (b) shows what would happen without adjustment. In (b) all columns are scaled down evenly to fit the column that overflows most, so even the grey column runs slower than normal. In (c) every pixel lines up at the red circle (the anchor).
ModeWhat brightness meansClip time shown at each output instantOutside the range
Slit × time mapBlack = start of the use range, white = endstart + g × use-range length. The default gradient plays at normal speed.Never leaves it; jumps from end to start at the loop seam
Slit × rate mapThat column’s (row’s) speed: black = Black rate (default 0, frozen), white = White rate (default +1, forward), interpolated in between. With reverse makes black −1 and white +1, so grey is frozenA path made by summing speeds from the top (from the left for a horizontal slit); every slit meets at the Anchor at moment of the loop (0, the start of the output, by default) and runs forward and back from thereShifted or scaled down evenly to fit; no wrapping
Surface × rate mapThat pixel’s speed: black = Black rate (default 0, frozen), white = White rate (default +1), interpolated in between. With reverse makes black −1 and white +1, so grey is frozenAt the same fraction of the loop as Anchor at, every pixel meets at that point of the clip (0.5 by default: the middle at the middle), then runs at its own speedWraps within the use range
Surface × time mapGrey = unchanged, white/black = half of Shift ahead/behindNormal-speed time offset by (g − 0.5) × Shift secondsWraps within the use range
Space map (any mode)Which column (row for a horizontal slit) to showDoes not change time—

4. Seeing it in 3D: the 3D plot

Pick 3D plot in the editor’s View menu and this plot appears beside the output picture and the map; with the tools out you can watch it while you draw. You can also swipe the map on the main screen sideways to reach it. Switching Section at its top right to Lines draws the surface as lines in the time graph’s colours instead of the picture. The plot computes its times with the same function that renders the output picture.

The shape of the surface in each mode

The time graph: section 3’s figure, live

Time graph, also in the View menu, draws the same kind of figure as section 3 for your current map, mode and parameters.

5. How long the output is

How the length of one output loop depends on the mode and the map
Dots are Duration 1×; grey bars span 0.25×–4×. With the same 8-second use range, the loop can be anywhere from 4 to 80 seconds depending on the mode and what is in the map.
Surface times rate paths at Duration 1x and 2x
Top (1×): the steepest line crosses from bottom to top exactly once per loop. Bottom (2×): speeds are unchanged but the loop is twice as long, so the fastest pixel wraps around twice along the way.

6. Loading and frame skipping

Settings, Video Loading: Resolution, Seconds to load and the Frames line
Settings → Video Loading. The Frames line says whether frames will be skipped; its i gives the reason
How frames are looked up when a 120 fps clip is loaded at 1 frame in 3
Top: loading only 1 of every 3 frames of a 120 fps clip (40 fps effective). Bottom: the same material played at 0.25× (Duration 4× on a time map). Slit modes use the nearest frame, so motion steps and stutters; surface modes blend the two neighbouring frames, so motion is smooth but doubled.

7. The input preview and the use range

8. Sound and export

9. Common surprises

The “i” button next to each setting in the editor explains that setting in the app, too.