Is Adobe Media Encoder scriptable with ExtendScript?
Asked Answered
M

6

11

Is Adobe Media Encoder (AME) Scriptable? I've heard people mention it was "officially scriptable" but I can't find any reference to its scriptable object set.

Has anyone had any experience scripting AME?

Mannuela answered 31/1, 2010 at 1:12 Comment(0)
E
4

Adobe media encoder is 'officially' not scriptable but we can use extend script API for scripting AME. Below functions are available through extend script

1.Adding a file to batch

Encode progress

host = App.GetEncoderHost (); 

enc = EHost.CreateEncoderForFormat ( "QuickTime");

flag = Enc.LoadPreset ( "HD 1080i 29.97, H.264, AAC 48 kHz"); 
an if (flag) { 
f = enc.encodeEncodeProgress 
= function (progress) { 
$ .writeln (progress); 
} 
eHost. enc.encode ("/ Users / test / Desktop / 00000.MTS", "/Users/test/Desktop/0.mov"); 
} else { 
alert ("The preset could not be loaded "); 
} 

encode end

ehost = App.GetEncoderHost (); 
enc = EHost.CreateEncoderForFormat ( "QuickTime"); 
flag = Enc.LoadPreset ( "HD 1080i 29.97, H.264, AAC 48 kHz"); 
an if (flag) { 
f = enc.onEncodeFinished 
= function (success) { 
if (success) { 
alert ("Successfully encoding has ended "); 
} Else { 
Alert (" failed to encode "); 
} 
} 
EHost.RunBatch (); 
} Else { 
Alert (" preset could not be read "); 
} 

2.Start batch

eHost = app.getEncoderHost (); 

eHost.runBatch (); 

3.Stop batch

eHost = app.getEncoderHost ();

eHost.stopBatch (); 

4.Pause batch

eHost = app.getEncoderHost (); 

eHost.pauseBatch ();

5.Getting preset formats

EHost = App.GetEncoderHost (); 

List = EHost.GetFormatList (); 

6.getting presets

eHost = app.getEncoderHost (); 

enc = eHost.createEncoderForFormat ("QuickTime"); 

list = enc.getPresetList (); 

and many more...

The closest bits of info I've found are: http://www.openspc2.org/book/MediaEncoderCC/

The latter resource is actually good, if you can read japanese, or at least use the Chrome built-in translate function, then you can see it has resources such as this one:

http://www.openspc2.org/book/MediaEncoderCC/easy/encodeHost/009/index.html

We can perform almost all basic functionalities through script.

Eloisaeloise answered 21/2, 2018 at 13:38 Comment(6)
Thank you very much for this. I figured out that if you want to use custom presets, you have to open up your preset's .epr file, look for the "presetid" tag, and then put that value into the enc.loadPreset() function. For example, in one of my custom h.264 presets (the .epr file located at "%UserProfile%\Documents\Adobe\Adobe Media Encoder\11.0\Presets"), I needed to use this value: i.imgur.com/GhwhuAT.png By the way, these functions only work if you write them in camelcase, they don't work in proper case.Selfabsorbed
The resources you provided are great. However, Adobe is no longer supporting ESTK and is instead pointing developers to use the Microsoft Visual Studio Code ExtendScript debugger. Do you know if it is possible to target AME from that debugger within MS Visual Studio Code?Firebrick
Sorry, i'm using Adobe Extend script tool kt for debugging, we have an option to choose target.Eloisaeloise
@Firebrick yes you canForgive
@Forgive what is the proper string to do that?Firebrick
@Firebrick I'm using the VSCODE extension so it's just a big yellow text button at the bottom of the screen that says 'Select the target application'. When I clicked it I got a popup list that includes media encoder. I was able to add batch items, but the whole point of what I was doing is I wanted to automate different sizes and when I did 'set size' it reset all the batch items. After a VERY frustrating day I just gave up. I did see somewhere (sorry not sure where) a command line where you run the script by running the .exe for media encoder itself.Forgive
M
2

I had a similar question about Soundbooth.. I haven't tried scripting Adobe Media Encoder though, it doesn't show up in the list of applications I could potentially connect to and script with the ExtendScript Toolkit.

I did find this article that might come in handy if you're on a Windows. I guess using something similar written in AppleScript could do the job on a OSX. I haven't tried it, but this Sikuli thing looks nice, maybe it could help with the job.

Adobe Media Encoder doesn't seem to be scriptable. I was wondering, for batch converting, could you use ffmpeg ? There seem to be a few scripts out there for that, if you google for ffmpeg batch flv.

HTH, George

Mcnelly answered 31/1, 2010 at 1:47 Comment(3)
Thanks! That artcile is for the Flash media encoder and the technique was basically to shove keystroke events at it. I was hoping for something a little more robust! :-)Mannuela
I tried to open the app from Terminal, not much help, just reading something about memory leaks :) <2961879040> <ProcessCoordinationClient> <5> Attempting to launch processcoordinationsserver <2961879040> <ProcessCoordinationClient> <5> /Applications/Adobe Media Encoder CS4/processcoordinationserver.app 2010-01-31 02:24:40.474 Adobe Media Encoder CS4[3543:9607] *** _NSAutoreleaseNoPool(): Object 0x2f3cd5e0 of class NSThread autoreleased with no pool in place - just leaking Stack: (0x93aaa73f 0x939b6e32 0x939bcb94 0x64e928b 0x651f2e6 0x3ac670 0x443d4a 0x42ff7e 0x3a9fb9 0x90a09095 0x90a08f52)Mcnelly
Just had a quick look on the adobe website. there is no forum for AME, and it is also missing from the [devnet scripting][1] page. I've downloaded and scanned briefly the After Effects scripting manual and found nothing about sending files to AME yet. [1]:adobe.com/devnet/scriptingMcnelly
A
2

Year 2021

Yes, AME is scriptable in ExtendScript. AME API doc can be found at https://ame-scripting.docsforadobe.dev/index.html. The API methods can be invoked locally inside AME or remotely through BridgeTalk.

  1. addCompToBatch and other alternatives in the API doc seem to be safe to use. This is working:
    app.getFrontend().addCompToBatch(project, preset, destination);

The method requires project to be structured so that 1 and only 1 comp is at the root of the project.

  1. encoder.encode – references of which can be found in Web, supposed to support encode progress callbacks - is not available in AME 2020 and 2021. As a result, this is not working:
    var encoder = app.getEncoderHost().createEncoderForFormat(encoderFormat);
    var res = encoder.loadPreset(encoderPreset);
    if(res){
        encoder.encode(project, destination);  //  error: encode is not a function
    }

The method seems to have been removed in AME 2017.1, according to the post reporting the issue https://community.adobe.com/t5/adobe-media-encoder-discussions/media-encoder-automation-system-with-using-extendscript/td-p/9344018

Altigraph answered 16/9, 2021 at 6:46 Comment(0)
Y
1

The official stance at the moment is "no", but if you open the Adobe Extend Script Toolkit, and set the target app to Media Encoder, you will see in the Data Browser that a few objects and methods are already exposed in the app object, like app.getFrontend(), app.getEncoderHost() etc. There is no official documentation though, and no support, so you are free to experiment with them at your own risk.

You can use the ExtendScript reflection interface like this:

a = app.getFrontend()
a.reflect.properties
a.reflect.methods
a.reflect.find("addItemToBatch").description

But as far as I can see, no meaningful information can be found this way beyond list of methods and properties.

More about the ExtendScript reflect interface can be found in the JavaScript Tools Guide CC document.

Yl answered 15/1, 2015 at 15:45 Comment(0)
W
0

Doesn't seem to be. There're some reference to it being somewhat scriptable via using FCP XML yet it's not "scriptable" in its accepted form.

Wiser answered 3/4, 2014 at 2:38 Comment(0)
D
0

Edit, it looks like they finally got their finger out and made ME scriptable: https://mcmap.net/q/1006039/-is-adobe-media-encoder-scriptable-with-extendscript

I got here after it came second in the duckduckgo results for "extendscript adobe media encoder". First was a post on the Adobe forums where an adobe staffer wrote:

Scripting in Adobe Media Encoder is not a supported feature.

and, just to give the finger to anyone seeking to develop solutions for adobe users using adobe's platform:

Also, this is a user-to-user forum, not an official channel for support from Adobe personnel.

I think the answer is "Adobe says no"

Directional answered 25/5, 2017 at 12:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.