Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Replacing footage in sequence with footage from bin while keeping clip effects via API

New Here ,
Jul 03, 2023 Jul 03, 2023

Hi,

 

I'm writing a script to automatically replace the footage inside a Premiere timeline with graded versions of the same footage. Problems arise when multiple instances of the same source file are used in the edit and have recieved different color grades: now the script iterates through the timeline, swapping the footage via changeMediaPath()  but changing the filepath for EVERY instance of the original clip, leaving all of them looking the same in the timeline.

I tried importing all graded footage into a new bin to be able to have multiple file path references for every grade, but there doesn't seem to be a function within the Premiere API to replace footage from within a bin.
I found the correct function for AfterEffects (replaceSource()), but I need something similiar to work for Premiere, while keeping all effect properties, masks, transforms and so on in place.

Is there any way to achieve this?

 

P.S.: A way to copy and paste attributes like it is possible in the GUI but via the API would also work, is there something I missed to do this maybe?

 

TOPICS
Effects and Titles , SDK
612
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Jul 03, 2023 Jul 03, 2023

Doesn't simple replacement work? the projectItem of a trackItem is a read/write field. 🙂


Translate
Adobe Employee ,
Jul 03, 2023 Jul 03, 2023

> Problems arise...


What is the problem? 

What is your selection criteria, for "trackItems for which I want to replace the source media"? 

If you have new rendered media, why not import it as a new projectItem, instead of changing the path (but not the applied footage interpretation) of the previously-existing media?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2023 Jul 03, 2023

Thank you for your quick reply!

The entire timeline has been roughly conformed in Baselight, graded and rendered as seperate, untrimmed files.

The script is supposed to swap the footage of every clip in the timeline to the newly generated graded media.
Since some original clips are used multiple times (shot-reverse-shot-sequences) and are sometimes graded very differently (flashback sequences, recaps), not all trackItems that stem from the same original clip can remain linked to the same single projectItem with the same mediaPath.
If i imported the folder with the graded footage into a new bin, is there a way to make the clips in the sequences simply point to these different new projectItems without losing all current effect attributes etc of the trackItem?

Thank you for your help and I apologize if my terminology is unclear or if I didn't fully grasp your idea!

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 03, 2023 Jul 03, 2023

What tells you which trackItems referring to a given projectItem need to be replaced (with your new media) and which should remain unmodified?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2023 Jul 03, 2023

Currently, my script checks if a projectItem exists within the newly created bin with the same name as the trackItem. If so, I'd like to switch the pointer to the new projectItem, if not -> continue

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 03, 2023 Jul 03, 2023

Confirming: Are you checking the name of the newly-imported media projectItem against the name of each trackItem, OR the name of the projectItem referenced by each trackItem?

 

If the editor has renamed the trackItem, you don't want to replace it? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2023 Jul 03, 2023

The current approach is the former. The editor renaming the trackItem would be an issue at this point, that is a good point.
My script checks for multiple instance of the same name within the trackItems and renames the duplicate trackItems in ascending order ("test_clip_1.mov, "test_clip_2.mov"). Baselight names the multiple grades of the same media in the same way, so there should always be a newly imported projectItem corresponding to every trackItem's name.

I'm still working on the intricacies of the trackItem -> new projectItem matching process, but the main holdup for me currently is the simple redirection of a trackItems reference to a new projectItem, since i'm working on a proof-of-concept for my thesis

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 03, 2023 Jul 03, 2023

Doesn't simple replacement work? the projectItem of a trackItem is a read/write field. 🙂


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2023 Jul 03, 2023
LATEST

I was so hung up with finding some method to call that I never thought of just trying that...
Thank you so much, I think this solves it!

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines