Skip to main content
Participating Frequently
January 12, 2024
Answered

Problem: render via script always takes first preset from the list (.aac)

  • January 12, 2024
  • 1 reply
  • 778 views

Hey folks,

I have this issue with RENDER PRESET when rendering from script:

 

app.encoder.encodeSequence(sequence, outputPath, presetPath, workArea, removeUponCompletion);

 

The presetPath for .epr file is correct,

and even when I want to use ProRes, h264 mp4, AVCHD or whichever,

it somehow always take the first preset from Encoder list which is an .aac preset

 

- How do I know the .epr file path is correct?
When I brake it - the Encoder doesn't even open - there is no error thou.

- I use Visual Studio Code 1.73.1, Premiere Pro 24.1.0 (build 85), AME 24.1.1 (build 2)

 

- The same thing happens when I use app.encoder.encodeFile() and app.encoder.encodeProjectItem().

 

- The same thing happens when I run Encoder first via app.encoder.launchEncoder() and then try to render.

 

- Also I found that the last extension part of my outputPath is useless too, it doesn't matter if I write ".mp4" or ".mov" or whatever, it doesn't use anything after the dot, just uses .aac.

 

I attached a screenshot of my queue

 

 

 

Did I make some rookie mistake or is this a bug? Any workarounds?

 

Sadly without it, the whole automation process is pretty useless 😮

 

Thanks for any help guys!

Correct answer Bruce Bullis

I deleted ".mp4" part and the output is still the same (.aac)

Hm, maybe I will reinstall my AME 24.1.1 or try it on different PC?


I doubt that will help; the script is "working", insofar as it's adding a job to the queue, so installation doesn't seem like the problem. 

I propose radical simplification of the params and folders you're trying to use, to simplify (and eliminate potential points of failure):


 

var seq = app.project.activeSequence;
if (seq){
	var presetPath = "/Users/Rafal/Desktop/any_old_.epr";
	var outputPath = "/Users/Rafal/Desktop/test_output_filename";
	var result = app.project.encodeSequence(seq,
											outputPath,
											presetPath,
											app.encoder.ENCODE_ENTIRE, 
											1);
}

 

 

[If you're on Windows, replace "/Users/Rafal/Desktop" with "C:\\\\Users\\Rafal\\Desktop"...]

1 reply

Bruce Bullis
Legend
January 12, 2024

Hi Rafál, 

 

I've confirmed that app.encoder.encodeSequence() is working correctly in PPro 24.1, and does use the .epr file passed in.

 

The extension you're providing for your output path will be overridden by the actual extension, specified in the .epr file. PProPanel shows how to get the output extension of a given .epr file.

 

>How do I know the .epr file path is correct?

You're providing the .epr file, so you know the path to it, right? 

 

Participating Frequently
January 12, 2024

Hi Bruce!

Thank you for your super fast reply!

Yes, I tried with few .epr files exported from AME,

and I tried with some build-in presets in root AME folder, like:

 

C:/Program Files/Adobe/Adobe Media Encoder 2024/MediaIO/systempresets/3F3F3F3F_4D6F6F56/Apple ProRes 422 LT.epr

Sadly neither works.

 

I though maybe I have wrong path, so I just edited, let's say:

../project/folder/preset.epr

to

 

../project/folder/presettttt.epr

 

 

The first one opened AME and used .aac,

the second one didn't even open AME, nothing happened --

-- that's why I wrote that I think the path is correct and the problem might be somewhere else.

 

Yes, I saw github panel samples and learn few interesting things from there, it's an awesome source 🙂

 

Can I attach you my .epr file so that you can confirm it works for you?

Sorry if that's too much to ask, I just wonder maybe it's some xml bug?

 

If yes, here's the link

 

Bruce Bullis
Legend
January 12, 2024

Your .epr file works fine here. 🙂

var result = app.encoder.encodeSequence(	app.project.activeSequence, 
											'/Users/bbb/Desktop/example', 
											'/Users/bbb/Desktop/4k_mp4_h264_100mbps.epr', 
											app.encoder.ENCODE_ENTIRE, 
											1);



Please post your encodeSequence() call, with full parameters...???