Getting Started with APIs of DaVinci Resolve and OpenAI
Large Language Models (LLMs) are practical tools for summarizing large volumes of text.
In this two-part show-and-tell conversation between Patrick Inhofer and Igor Riđanović, you’ll learn how to use a bit of Python code to automatically create a YouTube summary of a Resolve timeline using OpenAI GPT.
Connect to Resolve and OpenAI Programmatically
Many apps have APIs, which are frameworks for two or more apps to communicate with one another in an automated fashion.
DaVinci Resolve has had a Lua and Python-based API since V15. OpenAI, the company behind ChatGPT, also has an API that we can use to submit and retrieve content automatically.
In part 1 of this two-part Insight, we will learn how the basic blocks of these two APIs work. You’ll learn how adjusting parameters can change the tone of the OpenAI responses.
We test the OpenAI API by asking GPT-3.5-Turbo to pretend it’s Patrick Inhofer of Mixing Light!
In part 2, we’ll integrate the two APIs using a small amount of Python code that controls the flow of information. We’ll then generate a dialog transcript in Resolve, push it to OpenAI, and retrieve a summary of the current Resolve timeline.
The scripts used in this Insight are available from the link below.
Some Python experience is beneficial. Resolve Studio is preferred. You could also use the free version of Resolve, but you are limited to running the scripts internally. As you’ll see, this is not very practical.
If you’d like to follow and don’t have Python installed, see the link to Joey’s Insight below. Joey walks you through getting Python installed on your system.
What if you don’t know if you have Python installed? In Resolve, go to Workspaces -> Console and click on “Py3” or “Py2.” Resolve will tell you if Python is missing or if it’s not installed where Resolve expects to find it.
Before using OpenAI API, you must set up an account with OpenAI. Using the API does require a credit card, and you need to provide billing details when creating your account.
Key takeaways from this Insight
By the end of this Insight, you should understand how to:
- Make simple calls to DaVinci Resolve API
- Use OpenAI API to access features unavailable using the ChatGPT interface
- Download the Python scripts used this Insight – These are located on GitHub. You can follow this Insight from Cullen Kelly on how to use GitHub.
- Sign up for an OpenAI account
- YouTube: Igor’s Resolve API Scripting intro tutorial
- YouTube: Igor’s How to Run Resolve Scripts tutorial
- YouTube: Igor’s AI and Resolve integration series – Igor demos additional ideas for extended DaVinci Resolve using machine learning libraries.
- Steak Underwater Resolve Scripting Forum
Related Mixing Light Insights
- Using Python and Expanding Resolve’s Functionality – Joey’s ‘Getting Started with Python’ tutorial is mentioned throughout this Insight.
- Creative Coding With DCTL – Cullen Kelly covers some additional setup and tools, like Github, you’ll need to build DCTLs successfully. Many of these tools apply to this workflow.
Questions or Comments? Join the discussion below!
I’ve used the Resolve API since V15 to build solutions ranging from simple marker converter scripts to complex apps and integrations that make software like Colourlab.ai talk to Resolve. No Resolve API question is too small or too complex, and I’d be happy to chat about AI/ML as well.