How to Prevent UI Freezes and Crashes During Bulk Timeline Edits via UXP API?

,

Hi everyone,
I’m building a UXP plugin for Premiere Pro that auto-arranges clips on the timeline (multi-camera auto-switcher). The entry point is an async function that iterates over potentially hundreds of camera segments and places each one on the timeline.

The UXP docs say the API is asynchronous and should not block the host UI. But in practice, Premiere freezes completely for several seconds (sometimes crashes), and all clip placements appear on the timeline all at once only after the freeze ends — the UI never updates incrementally during the loop.

What the code does (simplified):

// Called once per camera segment — may run hundreds of times
async function placeClipOnTimeline({
project, editor, projectItem,
inPointSeconds, outPointSeconds,
startSeconds, videoTrackIndex, audioTrackIndex
}) {
const startTick = TickTime.createWithSeconds(startSeconds);
const inTick    = TickTime.createWithSeconds(inPointSeconds);
const outTick   = TickTime.createWithSeconds(outPointSeconds);

// Step 1: set in/out on the source clip
project.lockedAccess(() => {
project.executeTransaction((compoundAction) => {
compoundAction.addAction(
projectItem.createSetInOutPointsAction(inTick, outTick)
);
}, “Set Source InOut”);
});

// Step 2: overwrite (insert) at the timeline position
project.lockedAccess(() => {
project.executeTransaction((compoundAction) => {
compoundAction.addAction(
editor.createOverwriteItemAction(
projectItem, startTick, videoTrackIndex, audioTrackIndex
)
);
}, “Overwrite Clip”);
});

// Step 3: clear in/out after insertion
project.lockedAccess(() => {
project.executeTransaction((compoundAction) => {
compoundAction.addAction(
projectItem.createClearInOutPointsAction()
);
}, “Clear Source InOut”);
});

// Step 4: re-fetch track to find the inserted clip, then trim it
const track = await sequence.getVideoTrack(videoTrackIndex);
const items = await track.getItems();
const insertedClip = items[items.length - 1];
// … further trim actions via another executeTransaction
}

// Main loop
export async function autoSwitchCamera(cameraSegments) {
for (let i = 0; i < cameraSegments.length; i++) {
await placeClipOnTimeline({ /* params for segment i */ });
}
}

What I observe:

Premiere’s UI becomes completely unresponsive while the loop runs.

The timeline does not update incrementally — no clips appear during the freeze.

Once Premiere unfreezes, all clips appear on the timeline at once.

With 500+ segments, Premiere sometimes crashes entirely.

My questions:

Is project.lockedAccess + project.executeTransaction synchronous/blocking on the host side?

Should all three steps (set in/out → overwrite → clear in/out) be combined into a single executeTransaction so the compound action handles the sequencing internally? Already tried this but it seems like there is a race condition(?)

Is there a recommended way to yield between iterations to keep the UI responsive, or does the host lock prevent repainting regardless?

Are there a way to prevent the crash?

Any insight? would be hugely appreciated. Thanks!

​

See PPro segfault crash during concurrent async locked access patterns - #2 by bbb_999

I also have a plugin that does A LOT of async and locked access pattern work and have encountered this crash bug. The PPro UXP team has been notified and is working to resolve. As a short term solution, I ended up forcing ALL PPro API calls to be serialized, AND I had to reduce the number of locked access patterns as much as possible. This means combining and making my code more efficient. Seems like there is some behind the scenes async PPro API calls being done inside of UXP that we don’t have control over, hence why I had to reduce the number of locked access patterns, to reduce the chances of this race condition.

1 Like

We’re working on that one, right now…

In our case, reducing the number of lockedAccess calls is difficult because the core functionality requires placing hundreds (sometimes thousands) of short clips on the timeline. Are there any additional short-term mitigation strategies you would recommend?

Also, since we are currently in the process of porting our panel from CEP to UXP, we’d like to better understand the timeline for CEP deprecation. The documentation mentions:

“CEP extensions continue to be supported; the plan is to support both CEP and UXP for a calendar year, after which we will remove support for CEP extensibility.”

Could you clarify what “a calendar year” refers to in practice? For example:
Is this counted from Premiere Pro 25.6 release?
Do you have a more concrete timeline for when CEP support will be fully removed?

Appreciate any guidance you can share.

You can reduce the number of locked access pattern calls by grouping many actions into a group of compound actions that all gets executed in the same locked access pattern. It sounds like in your case it may be worth just waiting until the PPro team has the bugfix in place though.

1 Like

This is the ideal approach with UXP Locked Access transactions, if/when possible.

If you can group actions into a single Locked Access transaction, you’ll get infinitely better performance, and the added benefit of being grouped as a single undo item in history.

We’re doing this for removing/deleting hundreds of clips at a time with success.

The limitation comes however if transactions are dependent on previous transactions requiring them to be separate.

I’ve started a separate issue for this one, requesting Return Values for Actions so we can group dependent actions together, instead of only independent actions, without the need for separate transactions:

2 Likes

Hi, thanks for the responses , really appreciate the acknowledgment from the Adobe team.

Just wanted to follow up on the status of this bug. Is there any update on the fix for the freeze/crash issue with repeated lockedAccess + executeTransaction patterns in UXP Premiere Pro plugins? Moreover, Is there a target release version or estimated timeline for when the fix will ship? @bbb_999

I’ll answer this for BBB since I’ve been bugging him about the same thing :sweat_smile:
This is partially fixed in the current ppro beta build. The proper full fix is still in the works. No timelines are allowed to be given.

Thanks for the answer! Could you elaborate on what “partially fixed” means? I’ve tried it on the current beta build but it still crashed.

Partially fixed = We have addressed some-but-not-all instances of this crash.

No Adobe employee can ever discuss release dates, without also scheduling their own exit interview. :slight_smile:

2 Likes

Hello, I want to follow up this thread, does this issue already fixed on the newest Premiere update (26.3)? Because we already update our Premiere to the latest version but the bug still persist. Thankyou in advance

As you have found, the issue is not yet completely fixed.

Hello, I want to follow up this thread, does this issue already fixed on the newest Premiere update (26.3.2)?

Hello, following up on this thread.

The 26.5.1 release notes include:

Adding hundreds of new clips to a sequence at once could cause a spike in memory usage.

Is that fix related to this issue? We’ve updated Premiere Pro to 26.5.1 and run our plugin again, and it still crashes

Could you confirm whether this crash is covered by that fix, or whether it’s a separate issue still open?

The problem mentioned in the release notes, is unrelated to the issue reported in this forum.

Looking forward to a fix of this issue.

Working with UXP in Premiere feels like a breath of fresh air on how fast it is compared CEP!

Same crash here on Premiere Pro 26.5.3 (macOS 26.3, also seen on macOS 27.0), and we found a repeatable trigger that may help.

Trigger: many small transactions, each followed by a detailed read of the sequence (getTrackItems, then getProjectItem, isOffline, getMediaFilePath, getStartTime, getInPoint and so on for every clip). Each alone survives; interleaved, Premiere crashes.

  • Transactions alone (2,880 set-in/out + overwrite + restore, light reads only): no crash.

  • Reads alone (915,000+ calls, nothing changing): no crash.

  • Interleaved, 300 pieces: crashed 2 of 2 fresh sessions, within seconds to a minute. Without a caption track on the project it did not crash in 4 runs, but every run got null or wrong-typed objects back mid-read.

  • A 500 ms pause before each read did not help (null object at piece 133).

  • Workaround that held: make all the changes first, wait 500 ms, then read once. 13 of 13 runs clean in 5 fresh sessions (11,700 transactions).

Crash reports all fault in the scripting bridge, at a different place each time: dvascripting::Engine3P (napi_get_instance_template inside an ExecuteUndoableTransaction callback; napi_set_element; napi_wrap), dvascripting::Engine (napi_delete_reference), dvascripting::Transient1 (resolving a promise, ConcludeDeferred, V8_Fatal).

Minimal script (needs a project with one video clip and two audio clips named as in FILES; runs as the body of an async function in a UXP panel):

const ppro = require("premierepro");
const N = 300,
    READ_BETWEEN = true;
const FILES = ["CAMERA.mov", "LEFT.wav", "RIGHT.wav"];
const project = await ppro.Project.getActiveProject();
const tt = n => ppro.TickTime.createWithTicks(String(n));
const TPF = 10160640000; // one frame at 25 fps
function tx(label, make) {
    let ok = false;
    project.lockedAccess(() => {
        ok = project.executeTransaction(c => {
            for (const a of make()) c.addAction(a);
        }, label);
    });
    if (!ok) throw Error("transaction refused: " + label);
}
const items = await (await project.getRootItem()).getItems();
const src = FILES.map(name => {
    const raw = items.find(x => x.name === name);
    return {
        raw,
        clip: ppro.ClipProjectItem.cast(raw),
        video: name.endsWith(".mov")
    };
});
const seq = await project.createSequence("REPRO " + Date.now());
const editor = ppro.SequenceEditor.getEditor(seq);
async function readEverything() {
    for (const kind of ["Video", "Audio"]) {
        const count = await seq["get" + kind + "TrackCount"]();
        for (let t = 0; t < count; t++) {
            const track = await seq["get" + kind + "Track"](t);
            for (const x of await track.getTrackItems(ppro.Constants.TrackItemType.CLIP, false)) {
                const pi = await x.getProjectItem();
                const clip = ppro.ClipProjectItem.cast(pi);
                await clip.isSequence();
                await clip.isOffline();
                await clip.getMediaFilePath();
                await pi.getId();
                await x.getSpeed();
                await x.isSpeedReversed();
                await x.getStartTime();
                await x.getEndTime();
                await x.getInPoint();
                await x.getOutPoint();
            }
        }
    }
}
for (let i = 0; i < N; i++) {
    const s = src[i % src.length],
        media = s.video ? ppro.Constants.MediaType.VIDEO : ppro.Constants.MediaType.AUDIO;
    const before = {
        a: await s.clip.getInPoint(media),
        b: await s.clip.getOutPoint(media)
    };
    const inT = (i % 5) * 10 * TPF;
    tx("marks " + i, () => [s.clip.createSetInOutPointsAction(tt(inT), tt(inT + 20 * TPF))]);
    tx("overwrite " + i, () => [editor.createOverwriteItemAction(s.raw, tt(i * 25 * TPF), 0, i % src.length)]);
    tx("restore " + i, () => [s.clip.createSetInOutPointsAction(before.a, before.b)]);
    if (READ_BETWEEN) await readEverything();
}
if (!READ_BETWEEN) await readEverything();
return "done";

Set READ_BETWEEN = false for the workaround. Happy to share the five crash reports.

We’ve been running A/B split testing across our userbase testing a variety of combinations of ways to sidestep this crash bug including your workaround. Your workaround is the same marginal improvement we’ve recorded, but your test sample size is too small and once you scale it up across user machines it stops working. To make this more complicated, it seems that some user’s machines are much more heavily impacted by this race condition.

Otherwise I think this is just a problem that the UXP PPro team needs to resolve on their end and there’s not much we can do.

For reference, we’ve recorded ~750 crashes from this exact bug across our userbase so we have a large enough sample size to separate signal from noise, especially across different machines.