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

Set proxy and full-res while importing

Explorer ,
Nov 21, 2018 Nov 21, 2018

Copy link to clipboard

Copied

I am working on importing video from a panel. I have links to full-res video and also a proxy. I would like to download the proxy first and import into project, so that the user can start working on it while the full-res is still being downloaded.

Is there a way to achieve this from panel code?

  1. I was hoping that the importFiles call takes a proxy path in addition to the full-res. But probably it doesn't?
  2. Only way I can think of is to call importFiles with the proxy path, then when full-res is available, I should call changeMediaPath to point to the full-res, then again call attachProxy to set the proxy? Will this work and is there a way to avoid this manual juggling?
  3. How do I keep track of the files I imported in terms of item references in the project, so that I can call changeMediaPath or attachProxy on the correct item? Sample code seems to take the first item always. Does importFiles return some kind of reference to be used later?

Thanks,

Andaleeb

TOPICS
SDK

Views

1.3K

Translate

Translate

Report

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 , Nov 21, 2018 Nov 21, 2018

1. Correct, importFiles() takes only one path.

2. The changeMediaPath() method is from the time before PPro supported proxies. Instead, PProPanel shows how to attach a proxy path to an existing projectItem.

Note: The path used to create a projectItem, is presumed to be full-res. When you call attachProxy(), you can attach the new path as either full-res, or proxy; the original path will be used as proxy / full-res (whichever the newly-added path, isn't).

3. As demonstrated in PProPanel, you can u

...

Votes

Translate

Translate
Adobe Employee ,
Nov 21, 2018 Nov 21, 2018

Copy link to clipboard

Copied

1. Correct, importFiles() takes only one path.

2. The changeMediaPath() method is from the time before PPro supported proxies. Instead, PProPanel shows how to attach a proxy path to an existing projectItem.

Note: The path used to create a projectItem, is presumed to be full-res. When you call attachProxy(), you can attach the new path as either full-res, or proxy; the original path will be used as proxy / full-res (whichever the newly-added path, isn't).

3. As demonstrated in PProPanel, you can use app.project.getInsertionBin() to find out where the files you're importing will land. If you count the projectItems in that bin before and after your import, you'll have a list of newly-added projectItems.

Votes

Translate

Translate

Report

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
Explorer ,
Nov 21, 2018 Nov 21, 2018

Copy link to clipboard

Copied

Thanks Bruce. I tried the way you described:

  1. First I call importFiles with the proxy.
  2. Later when full-res is avaiable, I call attachProxy with the second parameter set to 1, so that it sets it as full-res, and the previous media is automatically set as proxy.

I found that the second step does not always take effect in our case for some files (though the call returns true). I am guessing that Premiere runs some checks before setting the highres like whether it matches some properties/format of the previously set file in step 1, which our proxy is not meeting. Can you shed some light in this regard like what is expected in the proxy? We generate the proxy ourselves so maybe we can tweak some transcoder params to make it work. But we need to know what is expected by Premiere.

Thanks,

Andaleeb

Votes

Translate

Translate

Report

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
Explorer ,
Nov 22, 2018 Nov 22, 2018

Copy link to clipboard

Copied

We have mismatch in the number of audio channels between full-res and proxy, which may have caused the problem above.

Votes

Translate

Translate

Report

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 ,
Nov 22, 2018 Nov 22, 2018

Copy link to clipboard

Copied

That would prevent it from working, yes.

Votes

Translate

Translate

Report

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
Community Beginner ,
Jun 15, 2020 Jun 15, 2020

Copy link to clipboard

Copied

Is there any documentation or API refferences for this? As as far as i've found theres just this one function with no coments and the rest is left to guess work.

Votes

Translate

Translate

Report

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
Engaged ,
Jun 15, 2020 Jun 15, 2020

Copy link to clipboard

Copied

In case you haven't seen it, here's a link to that function in the Premiere Pro ExtendScript-based API docs

https://premiere-scripting-guide.readthedocs.io/4%20-%20Project%20Item%20object/projectItem.html#att...

Votes

Translate

Translate

Report

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
Community Beginner ,
Jun 15, 2020 Jun 15, 2020

Copy link to clipboard

Copied

Thanks! is there anywhere that discribes how the proxies may differ? As number of audio channels seem to cause issue. are there any other factors?

Votes

Translate

Translate

Report

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
Explorer ,
Apr 27, 2021 Apr 27, 2021

Copy link to clipboard

Copied

LATEST

Updating this old thread with a detailed explanation of how I made it work, to help others who are asking about similar situations.

 

1. Since Premiere does not have a way to import a file directly as a proxy, I needed to first import the proxy "as highres", with the importFiles API: 
  app.project.importFiles(
    proxyFilePath,
    1,
    app.project.rootItem,
    0
  );


2. Immediately after the import, I identified and captured the reference to the newly added clip, which I found to be the last clip added to the bin:
  var insertedClip = app.project.rootItem.children[app.project.rootItem.children.numItems - 1]

 

3. Then I set the proxy path of the clip to the path I imported it from, so that Premiere knows to show it as proxy:
  insertedClip.attachProxy(proxyFilePath, 0);

 

4. Then I clear the full-res path of the clip by setting it to an empty string, since this clip does not really have a full-res media available yet. Please note that I have seen that this resetting of the full-res path is not be reflected in the Premiere bin UI immediately - you may need to reopen the project to see it. But the code updates the internal state correctly.
  insertedClip.attachProxy("", 1);

 

5. Now I have the proxy media correctly set up for the imported clip in the bin. Next, when I have the full-res file of the clip available, I will need to set the full-res path on the clip by calling changeMedia on the clip (I don't remember exactly, but I think attachProxy with the second parameter set to 1 did not work in this case):
  clipToSetFullResOn.changeMediaPath(fullResPath, true);

 

Now, the question is, how do I find the clipToSetFullResOn above in step 5? How do I know which child in app.project.rootItem.children corresponds to the insertedClip referred before at step 2-4? For this, some kind of bookkeeping is needed to tag the clip at the earlier steps, and then look for that tag by looping through all the clips at step 5. In my case, I needed this tag to be persistent, to be able to work across Premiere sessions, so I tagged it by setting an external ID for the clip with insertedClip.setProjectMetadata(). This associates the ID with the clip, and saves it persistently with the prproj file. Later, I went through all the clips, called getProjectMetadata() on each, and checked which one corresponds to my previously set ID, to ultimately find the right clip(s) to set the full-res path. Of course, setting/getting project metadata involves the use of some serialization/deserialization with XMPMeta.

 

Note: the proxy and the full-res needs to have the same number of audio channels. Apart from this, I do not know of any other properties that must match. It works even if the dimensions are different. But of course the more the proxies look and feel the same as the full-res, the more the user will be able to rely on the preview being the same as the final rendered result.

 

Hope this explanation helps.

 

- Syed Andaleeb Roomy

Votes

Translate

Translate

Report

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