Skip to main content
Bed30321077z973
Inspiring
February 5, 2024
Question

Performances Question - Code - Same project file -> multiple tracks items VS sub clipping?

  • February 5, 2024
  • 1 reply
  • 656 views

Hello,

I am having trouble adding 1000 times the same project item (with different attributes each time) as track items.

At the same time, adding other hundreds of project items (all different this time), and at the same time doing prints in the console.

(Visual code got a bit unresponsive with telling me 3 times though pop up windows: "visual has.., do you wish to continue, cancel,..etc?")

 

I was wondering, what would be the best practices, to make visual code + Premiere Pro work well and be able to treat the same proj item 1000 times for example while doing other stuff and succeed?

(While I writing this test, the script is still "running"' while nothing happening. And I doubt anything will happen)

 

The code is fine, It was working with 5 items.

Would making 1000 subclips (which I don't know well yet, is it actually creating "new files"?), better than trying to treat the SAME PROJECT ITEM 1000 times?

 

Anyway, What Can I do to "help" and "augment" the performances in general? What are the best practices,  and what I do in general to make my script complete its run, instead of stopping? at the moment it is supposed to insert items into the tracks..

 

I have a powerful GPU card by the way, Okay CPU. Right now while the code is running and NOTHING is happening and After saying "yes continue running" 3 times to visual code, the cpu is at 13% and GPU is at low use.

 

Was Premiere Pro Overwhelmed hence it does not know what to do?

(For the record, the logs show that my code reached the part where the projects items are inserted, and the logs shows that the script run through that "inserting part" many times. Finally when the logs end (supposedfly after 1000 insertion has been passed), .. my premiere pro projectr.. does not "get modified" (no item is added unfortuantely), again, the code worked just fine with 5 items.

 

Thanks,

Best

 

Edit:

I tried a "cancel" it showed a message "Canceled" but it is still struglling stoping the script now:

 

The script is still running (while nothing really happening).

 

Its as if Visual Code, .. broke.

Not sure what to do to prevent this, while keeping being able to treat the project item 1000 times and adding it 1000 times.

(edit2: added performances tag aswell)

This topic has been closed for replies.

1 reply

Bruce Bullis
Community Manager
Community Manager
February 5, 2024

Please describe (from a user's perspective) the workflow, in which your script needs to import thousands of items into the project, then add each of those projectItems(?) to a sequence, thousands of times...?

Bed30321077z973
Inspiring
February 5, 2024
  • User open empty project, or create a new project in premiere pro.
  • User imports manually one projectItem to the mediaLibrary
  • User launch a script
  • Script does computation to that single projectItem in a loop that has 1000 iteration
  • Within the same iteration, computation is followed by insert() project item (the same one) into track,
  • Prints logs saying "adding project item . name into track, at time ..."
  • Iteration ends, a new iteration begins
  • New computation, insert() again, new log
  • And so on, until the loop ends.


What was observed in the logs?

  1. Visual code shows 2-3 times with a pop up window saying that it is unresponsive (taking too long to respond) and asking me if I want to cancel (close the window) or wait for it
  2. Logs continue appearing thourgh these pop up messages, after I say "wait for it/continue running",
  3. After the third pop windows, All logs end up appearing (to the hundreds up to the end) "adding project item . name into track, at time ..."
  4. But the button to stop running the code becomes unresponsive (althought It was able to print a red "canceled" on the logs as seen in the screenshot from the original post)


Observation in Premiere: Nothing, not a single item added.
Note: Items are actually added normally with no probelm, if its a loop of 5 items.

Waiting does not solve the problem, CPU and GPU are not at 100%, again GPU I have is powerful.

 

Extra note: I tried canceling instead of continuing running the script once (when the window pops up asking me what to do), and visual closed its main window, and when I opened it again I had lost my "workspace", its as if its closed.. abnormlly, I had to re find my workspace. (Visual ALWAYS open on your last workspace, but not this time).

 

Bed30321077z973
Inspiring
February 5, 2024

Would that help?

Yes, in that it would show you exactly what line of script code is causing the problem.

Its one single project item though!

Earlier, you said your script was importing thousands of project items. I'm glad to hear that's not the case. 
Creating subclips before creating trackItems is not necessary.


Ok thank you I will try that,

But since the program works with 5 items, I think it's a question of performances, I mean there is not a particular piece of code NOT working whenits only 5 tracks added to the tracks.

 

So either visual or PPRO or both being overwhelmed once i reach a THRESHOLD of commands?

Is there a limit to the API actually? That's one question I should have asked from the beginning!

Maybe That's the problem?

I am at MORE than 1000 commands btw, maybe I might have reached some "limit" put on the API.

 

As for project item(s)

I think my text might have been confusing as I indeed mentioned the word hundrends of 1000 but that was for the track items only.

 

>Creating subclips before creating trackItems is not necessary.

Noted!