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

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

Community Beginner ,
Jan 12, 2024 Jan 12, 2024

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

 

Rafa5F94_1-1705046192585.png

 

 

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!

TOPICS
SDK
755
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 , Jan 12, 2024 Jan 12, 2024

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,
									
...
Translate
Adobe Employee ,
Jan 12, 2024 Jan 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? 

 

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
Community Beginner ,
Jan 12, 2024 Jan 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

 

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 ,
Jan 12, 2024 Jan 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...???


 

 

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
Community Beginner ,
Jan 12, 2024 Jan 12, 2024
Here's longer beat (sorry I didn't put it in 'code' here, it doesn't work on my Chrome).

var
proj = app.project;
proj.rootItem.createBin("0 Sequences");
var Bin_Sequences = proj.rootItem.children[0];
proj.rootItem.createBin("1 Masters");  
var Bin_Masters = proj.rootItem.children[1];
Projekt_FolderPath = proj.path.slice(0,(proj.path.length-proj.name.length));
var Masters_FolderPath = Projekt_FolderPath + "1 Masters";
var Master_EN_FilePath = Masters_FolderPath + "/master_en.mov";
var FinalRenders_FolderPath = Projekt_FolderPath + "4 Final Renders";
var RenderPresets_FolderPath = Projekt_FolderPath + "_render_presets";
    var RenderPreset_4k_mp4_h264_100mbps_FilePath = RenderPresets_FolderPath + "/4k_mp4_h264_100mbps.epr";
proj.importFiles(Master_EN_FilePath, false, Bin_Masters, false);
var Master_EN_File = proj.rootItem.children[1].children[0];
proj.createNewSequenceFromClips("MasterSequence_EN", Master_EN_File, Bin_Sequences);
proj.sequences[0].setInPoint(0);
proj.sequences[0].setOutPoint(proj.sequences[0].end);

app.encoder.encodeSequence(proj.sequences[0], //sequence
                            FinalRenders_FolderPath + "/" + proj.sequences[0].name + ".mp4"
                            Projekt_FolderPath + "_render_presets/1080_mp4_h264_50mbps.epr"
                            1,
                            0);
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 ,
Jan 12, 2024 Jan 12, 2024

Complicated! 🙂

I notice you have a non-escaped space in Masters_FolderPath ("1 Masters"). That won't 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
Community Beginner ,
Jan 12, 2024 Jan 12, 2024

I see few redundant lines and different preset names in my last post,
sorry about that, I was just shrinking the larger code,

but I just tried only this short beat on already opened project with a sequence, tracks and file:

app.encoder.encodeSequence(app.project.activeSequence,
                            "F:/Wersjonowanie/test/1 Masters/master_en.mov",
                            "F:/Wersjonowanie/test/_render_presets/4k_mp4_h264_100mbps.epr",
                            1,0 );
 
And unfortunatelly it gives me .aac again.
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 ,
Jan 12, 2024 Jan 12, 2024

Since you established that PPro ignores your provided output extension anyway, do you see different behavior if you don't append ".mp4" onto the output path?

I'm grasping at straws here; this call is used by literally dozens (hundreds?) of broadcasters and enterprises every day, so I'm pretty confident it can work. 🙂

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
Community Beginner ,
Jan 12, 2024 Jan 12, 2024

The way I see it, it goes sth like this:

 

1. so this dude want to render something, let's see...

2. okay I know which sequence we're talking about
3. ok, I know what output file he wants,

4. ok, I see the .epr preset, all good

5. from in to out, do not destroy after, all clear

6. opening AME...

7. ok, sequence added to the Queue

8. Wait, something's not right, I have a problem within this .epr thing, don't know what to do, let's set up the first default preset I got in my list and hope he's not gonna see 😄 

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
Community Beginner ,
Jan 12, 2024 Jan 12, 2024

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?

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 ,
Jan 12, 2024 Jan 12, 2024

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"...]

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
Community Beginner ,
Jan 12, 2024 Jan 12, 2024

Hell yeah it's finally working!

Your last sentence made wonders! 

 

I've changed:

 

C:/Users/Rafal/Desktop...   

 

into

 

C:\\Users\\Rafal\\Desktop...

 

Sooo...

outputPath = C:/Users/Rafal/Desktop...

presetPath = C:\\Users\\Rafal\\Desktop...

 

Suuuper weird but hey, it is working now!!!

 

Massive THANKS for your express help Bruce, you are trully a LEGEND! :fire:

Have a lovely weekend!

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 ,
Jan 14, 2024 Jan 14, 2024
LATEST

Glad that helped!

 

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