Commit Graph
4451 Commits
Author SHA1 Message Date
vangel76 686077a85f Footage cache (#3271): the Project panel's thumbnail key follows the preferences; browser footage budget in the docs
The panel worked a thumbnail's key out again only on a new project revision, footage reload or time, but Switches Affect Nested Comps and real-time shadows change what a comp shows without either: the preferences revision is now part of the check. The docs say the browser's Footage Frame Cache is at most 256 MB for frames and channels together. The panel test changes the preference alone; it fails on the old code.
2026-11-08 18:32:44 +01:00
vangel76 f639582355 Footage cache (#3271): presets, Add Expression on a selection and project imports respect static channel selection
An animation preset applied keys or an expression to a channel selection: its effect groups now go through static_channel_params and a lone property takes the preset's first value (said in a toast and the reply). Add Expression on a selection failed and rolled back as a whole when a channel selection was selected: it is now left out, as Add Keyframe leaves it out (named alone it is still an error). upgrade_effects is #[must_use]; File > Import Project adds what lost its animation to its warnings, a template keeps it quiet (it is read for listings and thumbnails too). Tests for the preset, the selection and the import; each fails on the old code.
2026-11-08 18:32:44 +01:00
vangel76 e1c97b4cd9 Footage cache (#3271): no localizer copy runs into a folder being adopted
Adopting a new folder's copies runs outside the localizer's lock, so the worker could start a copy meanwhile: the scan could delete its temporary or take its copy, counting it twice. The worker starts no copy while a folder is adopted (ended by a guard, also on a panic), the scan leaves the files of a copy already running alone, an adopted entry never replaces one made meanwhile, a copy of an earlier setting is not deleted when the adoption took it, and a failed copy of an earlier setting doesn't mark the file skipped. A test holds a folder's adoption, asks for a file meanwhile and checks no copy starts and it is counted once; it fails on the old code.
2026-11-08 18:32:44 +01:00
vangel76 9b3821ff77 Footage cache (#3271): a failed picture doesn't refuse the other channels; the browser plane cap is the footage budget
A remembered failure refused any later request for 'all channels', but those are every channel but the picture's: a picture too large to read left the file's other channels unread. A failure now refuses a request only when it asks for everything the failed one did. The browser's plane cap is 256 MB, the browser's largest footage budget (frames and planes together). A test fails a picture read and then reads the other channels; it fails on the old code.
2026-11-08 18:32:44 +01:00
vangel76 b0e58fad08 Footage cache (#3271): no expression on a channel selection by any form of Add Expression
prop.setExpression refused only a non-empty text on a property that can't be animated, but a call without text (a toggle) or with enabled: true adds the default expression, and pasting expressions (Copy Expression Only) set them too. Every call that would add, switch on or change an expression on such a property is now refused, switching an old one off or removing it still works, and a pasted expression skips such properties. Tests: both bypass forms are refused (they fail on the old code); an old expression can be switched off and removed but not on again.
2026-11-08 16:49:18 +01:00
vangel76 698628c5c7 Footage cache (#3271): ID Matte's Use Coverage stays animatable, as in After Effects
After Effects 2026 reports ID Matte's Use Coverage as able to vary over time and take an expression (Aux. Channel and 3D Channel Extract's 3D Channel can't), so it is animatable again. ID Matte now reads the coverage channel whether Use Coverage is on or off: what a frame reads still doesn't depend on a value that moves. A test checks the need is the same both ways and which ID Matte parameters are static.
2026-11-08 16:42:13 +01:00
vangel76 60629cb10e Footage cache (#3271): the localizer reads and writes files outside its lock
Setting the localizer adopted a folder's copies (reading the folder and every record, deleting temporaries) while holding the localizer's lock, which every footage read takes to look for a copy; dropping copies over the limit and checking a copy's size did file work under it too. The folder is now read, the free space taken and copies checked and deleted without the lock; the lock only guards the bookkeeping, and a setting changed meanwhile wins.
2026-11-08 16:26:51 +01:00
vangel76 53f59f8742 Footage cache (#3271): a remembered failure is of the file as it was
The plane store remembered failed requests (unreadable, too large) by what they asked for alone: a file replaced on disk without Reload Footage got a new index but kept being refused, so its channels stayed missing and its picture fell back to a whole-file decode every frame. A failure now keeps the index it was made with and only refuses requests of that index; a failure of the new file replaces the old ones. A test fails a broken file, then reads its fixed version under a new index; it fails on the old code.
2026-11-08 16:24:43 +01:00
vangel76 3a63d8e8df Footage cache (#3271): format the merged effects exports 2026-11-08 16:16:31 +01:00
vangel76 cbaa68321c Merge remote-tracking branch 'upstream/main' into footage-cache-3271
# Conflicts:
#	crates/effects/src/lib.rs
2026-11-08 16:16:21 +01:00
vangel76 e04d57ce03 Footage cache (#3271): FootageSource::aux stays every channel; effects doc stays generated
MediaPool::aux (no render asks for it: renders ask for what their effects read) again gives every channel, the picture's too, so the pinned OpenEXR golden hashes stay as they were; 'all channels' without the picture applies to the effects' requests. docs/effects.md is generated: the note on static channel selection lives in docs/footage.md.
2026-11-08 16:09:53 +01:00
vangel76 612419f3c1 Footage cache (#3271): a render's channel reads are called off with the render
The cancellable footage view passed aux and aux_for straight to the source, so a viewer render called off during a channel decode kept decoding. They now go through the render's cancel flag like frame reads (a decode stops between batches; once called off none starts). A test checks a channel read runs under the flag and none starts after; it fails on the old code.
2026-11-08 16:09:52 +01:00
FredApps 07be19d402 Merge pull request #3255 from vangel76/aep-import-puppet-3093
AEP import: Puppet arrives as EffectCraft's Puppet, its meshes and pins are reported
2026-11-08 15:46:00 +01:00
FredApps 7ca249d085 Merge pull request #3120 from vangel76/aep-import-thirdparty
.aep import: map CC Color Neutralizer, EXtractoR and IDentifier
2026-11-08 15:45:08 +01:00
FredApps 5832219d76 Merge pull request #3248 from vangel76/text-layer-name-follow-3233
Text layers: the name follows the text until the user renames the layer
2026-11-08 15:44:58 +01:00
FredApps 362b39038f Merge pull request #3256 from vangel76/clamp-time-stretch-3247
Time stretch: hold a loaded or imported stretch to ±1 % to ±9900 %
2026-11-08 15:44:45 +01:00
vangel76 c3464f640f Footage cache (#3271): channel selection is static, and only the channels picked are read
The parameters that pick which channels or Cryptomatte layer an effect reads (EXtractoR's Red/Green/Blue/Alpha, Cryptomatte's Layer and Layer Name, 3D Channel Extract's 3D Channel, ID Matte's Aux. Channel and Use Coverage, IDentifier's Channel Type) are static, as in After Effects where they have no stopwatch: no keyframes, no expression (prop.addKey, prop.toggleKey, prop.toggleAnimation and prop.setExpression refuse; prop.set changes the value). A document or an import that animated one keeps its first value and says so (a toast on open, a loss on .aep import). With that, what a frame reads is known from the values alone: the 'all channels' fallbacks for moving parameters and for effects that don't declare are gone (every channel effect declares; a test holds them to it), and a layer whose effects read no channels asks for none. Tests: the parameters refuse keys and expressions and the need is exactly the channel picked; a keyed channel selection opens static with its first value and is reported (both fail on the old code); the migration keeps the first key's value.
2026-11-08 13:24:22 +01:00
vangel76 f21b7d2a8f Footage cache (#3271): drop the plane store's unused release 2026-11-08 13:11:30 +01:00
vangel76 89705dc2c2 Footage cache (#3271): the picture's planes are never kept beside the converted picture
The plane store kept the R, G, B, A planes a picture was made of whenever the picture was read with channels for its effects (or with all of them), beside the converted picture in the media pool's frame cache: the same pixels twice. Once the picture is converted, its planes now leave the stored set (in place when nobody else holds it), but for a picture channel an effect names itself (EXtractoR reading R). 'All channels' means every channel but the picture's. A test reads a picture with one channel, with a named picture channel and with all channels, and checks exactly what stays and its bytes; it fails on the old code.
2026-11-08 13:11:16 +01:00
vangel76 d4cb440527 Footage cache (#3271): decoded OpenEXR channels share the Footage Frame Cache with the frames
The plane store had a fixed 1 GB budget of its own, outside the preferences: with a Footage Frame Cache of 10000 MB it still held about 2.5 frames of a 69-channel 1080p file. The plane store and the media pool's frame cache now share the Footage Frame Cache (set_cache_budget sizes both and the memory accountant's footage group), with one least-recently-used order: each use takes a stamp from one shared counter, and over the footage budget the accountant drops the least recently used item, frame or plane set, whichever holder keeps it. Neither side has a share of its own. The common budget no longer adds a separate plane budget; the browser keeps its 512 MB cap on the planes. Tests: a footage budget of 10000 MB sizes the plane store (and resizes it at run time); filling the frame cache drops the oldest plane sets and filling the plane store drops the oldest frames (fails without the shared order: the frames went first); an accountant group shares its budget.
2026-11-08 13:07:30 +01:00
vangel76 ee2551c8e3 Footage cache (#3271): the localizer test resets its copy hook also when it fails
A drop guard takes the copy hook out and turns the localizer off at the end of the test that installs the hook, also when an assertion fails, so a later test doesn't inherit a hook that holds its copies.
2026-11-08 12:20:09 +01:00
vangel76 505489ae72 Footage cache (#3271): docs: the UNC path example has both backslashes 2026-11-08 10:42:32 +01:00
vangel76 83a92c4d1a Footage cache (#3271): the localizer status redraws while busy; the locations field says what it takes
The Disk page's localizer status was drawn only when something else redrew the page, so its queue and the file being copied stood still. While files are queued or copied it is drawn again every half second; idle, not at all. Network Footage Locations shows a hint (and tooltip) that it takes folders or drives separated by ;, translated in the eight catalogs that have the localizer's strings.
2026-11-08 10:42:32 +01:00
vangel76 1aa604789f Footage cache (#3271): the Project panel's thumbnail key follows footage reloads
The panel worked a thumbnail's content key out again only when the project's revision or the time changed, so a Reload Footage or a watched file that changed (the revision stays) kept the old key and the old thumbnail. The footage reload count is now part of the panel's check. A panel test bumps the reload count alone; it fails on the old code.
2026-11-08 10:39:41 +01:00
vangel76 2130d01d4a Footage cache (#3271): the memory accountant trims only preview frames in RAM
PreviewMemory::trim_to counts the frames in RAM but took the next victim among all frames, GPU frames too: dropping one freed nothing it counts and lost a viewer frame. Victims are now taken among the frames an eligibility test accepts, in the same order (other scales first, then by the playhead): frames in RAM for the accountant, all frames for the cache's own budget. A test (with a GPU adapter) keeps the two oldest frames on the GPU; it fails on the old code.
2026-11-08 10:36:12 +01:00
vangel76 74099e32bc Footage cache (#3271): a region of interest asks for rows only where the source reads rows
With a viewer region of interest the renderer asked a PNG still for some rows, which the media pool reads whole anyway, and the layer was left out of the layer cache: its masks and effects ran again on every render. FootageSource::reads_rows tells whether a source reads only the rows asked for (the media pool: an OpenEXR frame whose channels no effect reads); otherwise the renderer asks for the whole frame and the layer stays cached. A test renders a still twice under a region; it fails on the old code (two row reads instead of one whole read).
2026-11-08 10:31:38 +01:00
vangel76 35788373cf Footage cache (#3271): Reload Footage reads a short head of each plane entry
The sweep after Reload Footage read up to 64 KiB of every entry to find its source files; plane entries are many (one per channel and frame) and each lists one small source file. A plane entry's head is now 4 KiB, with the full-file read kept for a longer list. A test counts the bytes read for a large plane entry; it fails on the old code (65536 bytes).
2026-11-08 10:28:16 +01:00
vangel76 086c53093f Footage cache (#3271): a file being copied by the localizer is not queued again
A read asking for a network file while the localizer copied it queued it again, and the file was copied over the network a second time. The file being copied is now remembered with the setting it is copied under; asked for again under the same setting it isn't queued, under a new one it is. A test holds a copy and asks again; it fails on the old code.
2026-11-08 10:24:43 +01:00
vangel76 643c795bbf Footage cache (#3271): a decode thread lets go of its flight before handing the planes over
The decode thread's job held the flight until it ended, and the flight keeps the outcome for its waiters, so on a busy machine the planes just decoded still looked in use and the store dropped another file's instead (the eviction test failed on CI). The job now drops the flight before it sends the outcome. A test holds the decode thread after it sent; it fails with the old order. 300 runs of both eviction tests pass.
2026-11-08 10:23:14 +01:00
vangel76 28e25246c4 Merge remote-tracking branch 'origin/footage-single-decode-3269' into footage-cache-3271
# Conflicts:
#	crates/media/src/pool.rs
2026-11-08 08:24:24 +01:00
vangel76 bc44712173 Footage: a forgotten file makes only its own decodes stale
forget() bumped one generation for the whole pool, so forgetting any file
(every file-watcher change, every add_bytes) left every other file's
decodes in flight uncached and unjoinable, and requests decoded those files
again. The generation is now an epoch: forget() records it per path, and a
decode, flight or kept picture is stale only when its own path was
forgotten after it started. The per-path map is bounded (4096 paths; past
that, everything older counts as stale).

Refs #3269
2026-11-08 08:23:29 +01:00
vangel76 c236f6e977 Footage cache (#3271): forgetting one file keeps other files' plane decodes (test)
The plane store's staleness is per file: a flight lives in its file's entry and forget drops only that file's entry. This test guards that a decode of one file in flight while another file is forgotten is still kept and joined; it fails when forget drops other files' in-flight entries.
2026-11-08 08:20:24 +01:00
vangel76 ce6add8c6c Footage cache (#3271): a plane request after forget decodes anew (test)
The plane store keeps its flight in the file's entry, and forget drops the entry, so a request made after a forget never joins a decode of the old file. This test guards that: it fails when forget keeps an entry with a flight.
2026-11-08 06:41:17 +01:00
vangel76 25af122235 Merge commit '19c9390e' into footage-cache-3271
# Conflicts:
#	crates/media/src/pool.rs
2026-11-08 06:41:17 +01:00
vangel76 19c9390e2d Merge remote-tracking branch 'upstream/main' into footage-single-decode-3269
# Conflicts:
#	crates/media/src/pool.rs
2026-11-08 06:38:39 +01:00
vangel76 6038833359 Footage: a request after forget doesn't join a decode started before it
A request made after its file was forgotten (it changed on disk) while the
file's decode was in flight joined that decode, got the old pixels and kept
them in the frame cache as the new file's. Each flight now carries the
generation it started in; a request only joins a flight of its own
generation and otherwise decodes the file anew.

Refs #3269
2026-11-08 06:31:56 +01:00
vangel76 cfc184e114 Footage cache (#3271): queued plane writes own their planes
Review fixes for the disk plane writes:
- A queued write holds copies of the planes it writes instead of the
  plane store's whole set, so it counts exactly what it holds, the
  memory accountant's trim frees what the queue reports, and it never
  keeps the store from letting a set go.
- A set is queued in writes of at most 256 MB, and only a single plane
  larger than the cache is left out, so a large set (a 4K file of many
  channels) reaches the disk plane by plane instead of being refused
  whole.
- Each plane entry counts as one encode again.
- A plane entry is shuffled straight from the samples' bits, without
  the widened intermediate copies.
2026-11-08 06:21:48 +01:00
vangel76 88fa8ccf15 Footage cache (#3271): the memory accountant frees queued plane sets
A queued plane write shares the plane store's set, which keeps the store
from letting go of it; trimming the disk queue now drops such writes
too, so the store can free the set in the same balance. The reader uses
saturating offsets, and the batch test fails a later batch by position.
2026-11-08 06:10:35 +01:00
vangel76 dfe9aedfe4 Footage cache (#3271): faster OpenEXR reads and disk plane hits
- The reader reads the next batch of chunks while the one before
  decompresses, reads chunks that follow each other in the file in one
  request, starts with a small batch so decoding begins early, places
  the planes in parallel, and converts half samples a slice at a time.
- A plane entry stores a half channel as half floats when every value
  round-trips bit for bit (NaN planes and float data stay f32), with a
  plain byte-plane shuffle; one entry per channel, read in parallel on a
  hit. Old multi-plane entries (format 5) read as misses.
- The planes of one decode go to the disk writer as one job that shares
  the plane store's set instead of a copy per channel; the queue counts
  their bytes once the store lets go of them.
- The plane store loses its unused level, and one eviction loop serves
  the budget and the memory accountant; dropping for bytes keeps
  remembered failures.
2026-11-08 06:01:48 +01:00
vangel76 6f498a09eb #3271: French no-break spaces in localize strings; thumbnail test reads the u128 key 2026-11-08 04:56:26 +01:00
vangel76 c8ccf807e1 #3233: AEP import names an unnamed text layer as a following name is cut, so export and import agree 2026-11-08 04:53:01 +01:00
vangel76 e41d6d9d68 Merge remote-tracking branch 'upstream/main' into text-layer-name-follow-3233 2026-11-08 04:42:27 +01:00
FredAppsandClaude Opus 5.5 3e0c77ca68 Preview: the sound plays on through stalls, the picture drops frames (#2473) (#3279)
* Preview: the sound plays on through stalls, the picture drops frames (#2473)

A preview whose rendering fell behind stopped its sound at the first frame
that wasn't cached and started it again once frames were cached, which
chopped it into bursts. Now the sound plays on: the picture shows the latest
frame rendered up to the sound, and the prefetch and the cache's eviction
order follow the sound's frame rather than the picture's.

The stall backoff from #3272 no longer has anything to do and is removed.
The start of a preview still waits for its first frames (#947).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Preview: a picture behind its sound never shows past the sound's frame

`latest_cached_before` stopped only on the sound's exact frame, which a
picture off the plan's frame step steps over and a sound behind the picture
in a non-looping preview never reaches, so it could return a frame ahead of
the sound. The walk now stops at the first frame that isn't between the
picture and the sound in play order (across the loop's end once the sound
has wrapped). Also brings `Playback::starting`'s doc up to date.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 04:03:31 +01:00
vangel76 d91f5d28fd Footage cache (#3271): stage B review fixes
- A region of interest reads rows only at the top level (no collapsed precomps, no nested
  comps, no adjustment layers); input and footprint keys never keep a rows-only buffer; a rows
  request takes the whole frame from the frame cache when it is there and keeps nothing itself.
- Sequence layers are keyed by their frame (without frame blending or fields), so times within
  a frame share the entry.
- A decode taken over by a decode thread runs under the asker's cancel flag and hints.
- Disk planes: one entry per channel, read back whatever was asked for before; queued planes
  are moved in (counted exactly), written by channel with checked math; the write refused when
  a plane is of another size. Segmentations are compressed on the writer thread.
- Memory accountant: the plane budget is in the sum; the disk queue counts only bytes it alone
  holds and never drops frame writes; one balance at a time, inserts balance at most every
  100 ms, a refilling holder stays protected for 10 s.
- Reload Footage gives thumbnails new keys; thumbnail keys are worked out at most every 0.25 s.
- Localizer: network footage locations (Settings > Disk, e.g. P:\) besides UNC paths; copies
  recorded beside them and adopted after a restart, stale temporaries deleted; the disk cache's
  reserve kept free; by default beside the disk cache's folder, 20 GB; a copy gone meanwhile
  reads the share; status shown translated, with the network locations.
- Tests: hooks hold the queued decode for the claim test; the disk test uses its own paths.
2026-11-08 03:59:09 +01:00
vangel76 1e47afcf9a Merge upstream/main (#3191 merged as 84382487) into footage-cache-3271
The conflicting files are the #3191 branch's own on main; this branch's changes on top of them
are kept.
2026-11-08 03:34:34 +01:00
vangel76 c1534f4502 Footage cache (#3271): stage B self-review fixes
- A region of interest looks up the whole layer's cached buffer first; only a miss reads the
  rows (and keeps nothing).
- The rows margin counts the region's rounding at the layer's own scale; the region test covers
  shrunk and enlarged layers at reduced resolution.
- Layer and plane writes are bounded by the bytes they hold while queued (1 GB).
- The disk cache's drop generation is taken before the file is opened, so planes of a file
  reloaded meanwhile are refused.
- A plane entry of another shape than the planes asked for is a miss before anything is
  decompressed.
- The claim hand-off is one atomic phase (queued, running, claimed): no gap between the claim
  and the queued job.
2026-11-08 03:17:34 +01:00
vangel76 fae48d8114 Footage cache (#3271): the preview frames count in the common memory budget
The RAM preview frames register with the memory accountant at the highest priority (what the
user looks at is freed last); GPU frames keep their own budget.
2026-11-08 03:12:35 +01:00
vangel76 278c4efecc Footage cache (#3271): a region of interest reads only the OpenEXR rows it shows
The renderer maps a top-level region of interest back through a 2D footage layer's transform
to the footage rows it shows, grown by the resampling (wider at a reduced scale) and the
effects' declared margins (effects::pixel_margin: 0 for the per-pixel 3D Channel effects). It
reads the whole frame for 3D layers, motion blur, frame blending, fields, layer styles, effects
that don't declare, and comps that read layers' pixels elsewhere (layer parameters,
expressions); a layer read in part isn't layer-cached. FootageSource::frame_rows hands the rows
to the media pool, which keys the frame by them and reads only those rows (1-line chunks:
exactly those lines), for footage whose channels no effect reads. Pixels in the region are
those of a whole-frame read.
2026-11-08 03:11:53 +01:00
vangel76 043344445f Footage cache (#3271): optional background localizer for network footage
Settings > Disk > Localize Network Footage (off by default), with a folder and a size limit:
OpenEXR files on network shares (UNC paths) are copied one at a time on a background thread,
never on the playback path, under a temporary name and renamed when complete. A copy is read
only while its source has the size and modification time it had when copied and the copy is
complete; entries made of it keep naming the share's file and identity. The least recently
used copies go beyond the limit; Settings > Disk shows what the localizer is doing.
2026-11-08 03:08:10 +01:00
FredAppsandClaude Opus 5.5 ae35ea7d54 Preview: each stall doubles the frames the held sound waits for (#3260) (#3272)
* Preview: each stall doubles the frames the held sound waits for (#3260)

A preview that renders just below real time stopped its sound at the first
uncached frame, then started it again as soon as the silent preview kept up
with `ahead` frames cached. Those ran out within a few frames, so the sound
started and stopped over and over, which plays as distortion (#2473, #3260).

Each stall that stops the sound now doubles the cached frames ahead it waits
for before starting again, up to what fits in the RAM preview. A new preview
starts counting from zero.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Preview: cap the held sound's wait at frames the prefetch can keep cached

Once the doubling reached the RAM preview's `fit`, the held sound waited for
offsets 0..fit, but the prefetch only requests offsets below fit - 1, and
while the silent preview moves on its last requests are still rendering. The
sound then stayed silent almost to the end of the preview even after
rendering recovered.

The backoff now stops at half of the frames the prefetch requests, and never
below the wait before any stall. A new test caches only the frames playback
itself requests, with a RAM preview of `ahead + 2` frames.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 03:06:55 +01:00