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

How to attach proxy with highres on run time with scripting

Explorer ,
Nov 11, 2019 Nov 11, 2019

Hi, i want to replace proxy with highres, i have "pre-generated" proxies  in my project (Note: i'm not using adobe proxy workflow).

I found somewhere below api:

 

 

 

 

 

6.2.25 attachProxy()
projectItem.attachProxy(String newMediaPath, int isHiRes)
Description
Attaches the media at newMediaPath to the project item, as either hi-res or proxy media.
Parameters
The path the the newly-assigned media (as String), and an int indicating whether the new media should be attached as
the proxy (0) or high resolution (1) media.
Returns
Returns 0 if successful

 

 

 

 

 

 Thinking above api might help in my way, i have created folder structures like below one,

 

proxies/

highres/

Let say 
i have file name a.mp4 

proxies/a.mp4   2MB

highres/a.mp4  150MB

Question:
i will drag proxy(2MB) on timeline, do some editing, and wanted to apply same editing on highres(150MB)

Before Export:  i'm trying below code, to apply editing on highres(150MB)

 

 

 

 

 

var highresDirPath = 'highres/'; // a.mp4(150MB)

projectItem.attachProxy(highresDirPath,1);

//export code ...
    .................

 

 

 

Please  help me as i have no clue to do it, Thanks in advance!!

 

 

TOPICS
Export , How to , Import , SDK
2.2K
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 , Nov 25, 2019 Nov 25, 2019

Try disabling the use of proxies before exporting; I think your output will get generated, from hi-res sources.

Translate
Adobe Employee ,
Nov 13, 2019 Nov 13, 2019

i'm not using adobe proxy workflow.

I think that's root of the problem. 🙂

In PPro's ExtendScript API, each projectItem can have a proxy and a full-res path. 

Use attachProxy() to attach your proxies to media already in the project. The '1' param in your code example denotes hi-res; pass '0' for proxy res.

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
Explorer ,
Nov 14, 2019 Nov 14, 2019

I was really waiting for your reply, all of my previous questions was answered by you, so it is obvious(wait).

1.As you know i have 2 Folders namely proxies/  and highres/ .

 

2.In proxies/ folder all the  "proxies files" are generated by my local backend.

3. I will be having 2 copies of same file, But in highres/ folder size will be much more high than in lowres/ folder.

 

4. I will drag file from proxies/ folder and do some Editing.

5. Now i'm expecting the above(step 4) Editing should apply on "highres file"  upon export.

6. what i have produced above code is not working.

7. Please help me with some code (As i stuck for more than 4 days).

8. What i have tried but not working.

 

 

var highresDirPath = 'X:/highres'; 
var projectItem = app.project.rootItem.children[0]; 
projectItem.attachProxy(highresDirPath,1); 

//export code 
var outputPresetPath = '/path/to/setting.epr'; 
var fullPathToFile = '/full/path/to/directory'; 
var outPreset = new File(outputPresetPath); 
var exp_res = app.project.activeSequence.exportAsMediaDirect(fullPathToFile, outPreset.fsName, app.encoder.ENCODE_WORKAREA);

 

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 ,
Nov 14, 2019 Nov 14, 2019

> 6. what i have produced above code is not working.

Could you provide more specifics, about 'not working'? 


If you imported the proxy footage first, your attachProxy() call to attach hi-res media to the same projectItem, looks correct. It's not necessary to have proxy and full-res have the same name. Perhaps you don't have proxy support enabled? Here's code to check.

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
Explorer ,
Nov 14, 2019 Nov 14, 2019

@bbb_999,

i have tried what you said above, ie,

app.setEnableProxies(1);

 

What i thought basically those 2 functions are doing  (or toggling)

app.setEnableProxies(1);

 

Now the problem is:  once i do the Export i don't see editing on proxy file is applied on highres file.

Here is what i'm trying to do before export:

app.setEnableProxies(1);
var highresDirPath = 'X:/highres'; //
var projectItem = app.project.rootItem.children[0];
projectItem.attachProxy(highresDirPath,1);
//Export code ...

My Expectation: i do editing on proxies file, once editing is done, those editing sholud be attached to highres file
 Thanks in advance!!

 

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 ,
Nov 15, 2019 Nov 15, 2019

My Expectation: i do editing on proxies file, once editing is done, those editing sholud be attached to highres file
That's exactly what should be happening. 🙂
In the code example above, if projectItem originally points to a proxy file, attachProxy() looks like it's attaching the full-res correctly. Any rendering performed will use the hi-res. 

If that's not what you're seeing, please provide actual files and (very important!) step-by-step instructions, on how you can reliably reproduce the behavior.

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
Explorer ,
Nov 19, 2019 Nov 19, 2019

@bbb_999,

 

sorry for delayed reply,

I was producing code to explain to you for 2 days

Here is a link to my demo project with installable .zxp file (Dropbox)   https://www.dropbox.com/s/8jr6ls6xo7flbv8/myproject.zip?dl=0

 

Please help me as i don't know anyone who can help me, you are the right person.

thanks in advance!!!

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

This code is very confusing. 

 

If the first projectItem in the root of the project is an .mp4, and you wanted to attach an .mxf hi-res file to that same projectItem, you would do this. 

 

app.setEnableProxies(1);
var first = app.project.rootItem.children[0];
if (first){
	if first.canProxy(){
		first.attachProxy('/Users/bbb/Desktop/example.mxf', 1);
	}
}

 

Now, whenever a clip from first is rendered in a sequence, the full-res will be used. 

 

Does that make sense? Aside from [above], what are your remaining questions? 

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
Explorer ,
Nov 25, 2019 Nov 25, 2019

@bbb_999,

 

I don't know why still i'm unable to attach lowres to highres Despite trying your code,

might be what i'm trying code sequence is wrong.

here is what i have tried:

 

app.setEnableProxies(1);
var first = app.project.rootItem.children[0];
if (first){
	if (first.canProxy()){
		first.attachProxy('/Users/bbb/Desktop/example.mxf', 1);
	}
}


var exp_res = app.project.activeSequence.exportAsMediaDirect(fullPathToFile, outPreset.fsName, app.encoder.ENCODE_WORKAREA) // export workarea code

 

 

In above code "lowres/proxy" is only getting exported , why?

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 ,
Nov 25, 2019 Nov 25, 2019

Try disabling the use of proxies before exporting; I think your output will get generated, from hi-res sources.

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
Explorer ,
Nov 26, 2019 Nov 26, 2019
LATEST

@bbb_999

It is working now by setting 

app.setEnableProxies(1);

to 

app.setEnableProxies(0);


Thanks alot for your help, really happy with your help!! 

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