Use Python to interact with Adobe Premiere Pro. Gather data, check and edit your projects.
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...?
Install the Pymiere Link extension for Premiere Pro
pymiere_link.zxp
from this repoWindow > Extensions
you should see Pymiere Link
(clicking on it will do nothing)Install the Python lib
requests
Python lib is installed (pip install requests
)pymiere
folder somewhere accessible to your PythonTry running some basic code:
import pymiere
print(pymiere.objects.app.isDocumentOpen())
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.
For any support, questions or interest please contact me: q.masingarbe@gmail.com
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 the Pymiere Link
extension via the requests lib (http)Pymiere Link
node.js server receive the ExtendScript code and execute it within Premiere Pro contextPymiere Link
will send it back as a JSON encoded response to pymiere
pymiere
will then decode the JSON data to have it back in the python contextOn 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 !
[ ] add a way to simply customize a panel to call python functions
I'd like to thank everybody that contributed to Pymiere by reporting bugs, sending ideas, ...