Skip to main content
Inspiring
August 24, 2022
Answered

Scripting AME: onEncodeProgress tracks only last added item in Queue

  • August 24, 2022
  • 1 reply
  • 1441 views

I understand scripting for Adobe Media Encoder is not supported and/but I still try to find a way to boost my workflow and output.

 

With my script (CEP) I add an After Effects comp (Dynamic Link) to the AME Queue. I can start the Queue, and I can get track of the progress of the item. So far everything goes smooth.

 

// works
function addToQueue(myProject, myFormat, myPreset, myGUID, myDestination){
queueItem = app.getFrontend().addDLToBatch(myProject, myFormat, myPreset, myGUID, myDestination);
	queueItem.onEncodeProgress = function(progress){
	// keeps track of progress 0 to 100
	}
}

 

If I run this function multiple times, multiple items are added to the Queue. When I start the Queue I would wish to see the progress per item. But I only get track of the last item. All the previous ones render normally but give 0 as progress, finally the last item gives 0 to 100.

 

When I try this, it adds both items, but only tracks the last added item.

queueItem = app.getFrontend().addDLToBatch(myProject, myFormat, myPreset, myGUID, myDestination);
queueItem.onEncodeProgress = function(progress){
// keeps track of progress of queueItem2, which is 0
}

queueItem2 = app.getFrontend().addDLToBatch(myProject, myFormat, myPreset, myGUID, myDestination);
queueItem2.onEncodeProgress = function(progress){
// keeps track of progress, 0 to 100
}

I might miss a step here, but I don’t see it.

 

It would be really usefull if there is some ID per added item available. Maybe it’s there, but am I overlooking it. Any pointers in the right direction are much appreciated.

 

I mix the info of these source,

http://www.openspc2.org/book/MediaEncoderCC/

https://ame-scripting.docsforadobe.dev/introduction/index.html

Using AE en AME CC 2021 (OSX)

This topic has been closed for replies.
Correct answer SükriyeLudwig

Hi Schüky, thanks a lot for taking time. I will make some clear snippets first thing tomorrow and post it here. Thanks! Erik


Hi Erik, 

 

with our current API, you can have an exporter object that can have some events that tell you when an item is in the process and also updates its progress. Have a look into attached snippet. 
In Addition we have been working on improvement and we will add new events to the encoderHost object which will be available in Beta version 23.1.
So I add the onEncodeTest as text file otherweise I couldn't have attach it.
Feel free to use it as JavaScript file. 🙂

Best,
Schüky

1 reply

ChWard
Community Manager
Community Manager
August 24, 2022

Hi there,

which exact versions of Ae and AME are you using? We have put some work into fixing some scripting bugs, so I would encourage you to test with the latest release aswell.

Best,

Christopher

Inspiring
August 24, 2022

Hi Christopher,

 

Thanks for your quick response, much appreciated.

When writing my previous post I ran AE 18.4.1 and AME 15.4.1

 

So I spent some time updating (from bottom to top actually)

 

AME 22.0 same result as 15.4.1

AME 22.1 same result

AME 22.2 same result, although much faster.

 

but then..

 

AME 22.3.1 not working, even simple alert not working

AME 22.4 not working

AME 22.5 not working

AME 22.6 not working

 

So from 22.3.1 on I can not even get a simple alert(’hello’) to work. Is this as expected or should I find the problem in CEP?

I’m not familiair with running jsx in AME other then as a part of CEP, but I’m running CEP 11 since 18.4 without trouble.

 

Regards,

Erik

ChWard
Community Manager
Community Manager
August 27, 2022

Hi Erik,

thanks a lot for the very heldpul infos. We will start digging into this issue
Best

Christopher