Pymiere : Python for Premiere Pro
Use Python to interact with Adobe Premiere Pro. Gather data, check and edit your projects.
Why using Pymiere?
Pymiere comes from a consideration, has a Pipeline TD in a 3D/VFX studio, that we add no easy/good way to plug Premiere Pro into our workflow.
Of course, if you want to programmatically create a Premiere file, you can simply use an XML file (see Open Timeline IO to XML). But that require exporting and importing files, potentially loosing some data and no quick visual feedback.
That's where pymiere comes in handy:
Want to check if some shots have new versions available? Maybe automatically place them on a new track?
Want to create interactive tools for your editor using Qt, Shotgun API, custom libs...?
Installation
-
Install the Pymiere Link extension for Premiere Pro
- Download
pymiere_link.zxp
from this repo - Install using the Extension Manager Command Line tool (note that the
Adobe Extension Manager
UI is deprecated)- Download and unzip the folder somewhere
- Navigate to the folder in Command line or Power shell
- type
.\ExManCmd.exe /install D:\path_to_extension\pymiere_link.zxp
- Alternatively install using ZXP installer or Anastasiy Extension Manager
- To check that it is correctly installed, start Premiere, under
Window > Extensions
you should seePymiere Link
(clicking on it will do nothing)
- Download
-
Install the Python lib
- make sure the
requests
Python lib is installed (pip install requests
) - put the
pymiere
folder somewhere accessible to your Python
- make sure the
-
Try running some basic code:
import pymiere
print(pymiere.objects.app.isDocumentOpen())
Documentation
Quick start
Open or create a Premiere project containing a sequence with at least a clip. You can now execute the demo.py
which will demonstrate some basic code. You can also look into the pymiere/wrappers.py
file to see some more code example.
Pymiere is at its core a wrapper for Adobe ExtendScript (Adobe flavored javascript for manipulating data in their software).
Most of the help for ExtendScript will therefore apply to pymiere.
pymiere.objects
is your Python entry point to access all Premiere objects and functions. As pymiere offer code completion and type hint in modern IDE, it is easy to navigate/use the objects. Some also have docstrings.
Note: You have to have Premiere Pro running for pymiere to work. If your script needs to know if Premiere Pro is running or start it, some functions are available in pymiere/exe_utils.py
for that.
Useful links
- Official doc for Premiere Pro objects
- Unofficial doc for Premiere Pro objects
- Advanced Premiere Pro Extendscript usage
Versions
- support Python 2 & 3
- Tested with Adobe Premiere Pro version 13.0 (2019) and version 11.0 (2017). I highly recommend the 2019 version because some functionality are not available in the previous versions. It should work for version 2017+ though.
- Tested on Windows (10)
Contact
For any support, questions or interest please contact me: q.masingarbe@gmail.com
Internal working
Here is how pymiere works:
pymiere
converts the python action (getting a property, executing a function...) to ExtendScript code (ExtendScript is Abode flavored javascript used to access and manipulate programmatically their software)pymiere
sends the ExtendScript code to thePymiere Link
extension via the requests lib (http)Pymiere Link
node.js server receive the ExtendScript code and execute it within Premiere Pro context- If some value is returned
Pymiere Link
will send it back as a JSON encoded response topymiere
pymiere
will then decode the JSON data to have it back in the python context
On top of that, the lib also include a mirror of all Premiere Pro ExtendScript objects in Python so that modern IDE are able to autocomplete and add hint while coding. These objects mirrors were autogenerated from the Extendscript objects reflection interface. I did a detailed article about this workflow !
Futur improvements
- separate the generic part handling communication between python and ExtendScript from the specific code for Premiere Pro, enabling its use in other applications (Photoshop, Encoder...)
- add more examples & more wrappers functions
- add support for Premiere events
- add more documentation, docstrings...
- build one Python mirror of ExtendScript objects by Premiere version, as each version adds new objects/functions/properties
- add a way to simply customize a panel to call python functions
Thanks
I'd like to thank everybody that contributed to Pymiere by reporting bugs, sending ideas, ...
- Isaac brown (https://github.com/ikebenbrown)
- Roy Nieterau (https://github.com/BigRoy)