動画の時間処理の仕組み

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

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

一言でいうと

1. 全体の流れ

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

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

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

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

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

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

4. 出力の長さ

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

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

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

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

7. 音と書き出し

8. つまずきやすい点

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


How time processing works

Which moment of your video Time Flow Sketch 1.5 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.

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 mapGrey = normal speed, black = 1 − Rate range, white = 1 + Rate range (above 1, black plays in reverse)A path made by summing speeds from the top (from the left for a horizontal slit), starting at Start pointShifted or scaled down evenly to fit; no wrapping
Surface × rate map (default)That pixel’s speed: black = Black rate (default 0), white = White rate (default 2)Every pixel meets at Anchor at at the anchor moment (Middle by default), 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. 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.

5. Loading and frame skipping

Settings, Video Loading: Resolution, Seconds to load and the Frames line
Settings → Video Loading. The Frames line says whether and why frames will be skipped
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.

6. The input preview and the use range

7. Sound and export

8. Common surprises

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