Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Documentation for Python binding for MLT multimedia framework

I am start learning MLT multimedia framework. It's written in C/C++ so its official documentation has tutorials and examples for C/C++ only with few links for Perl binding.

I am looking for some tutorials for Python bindings of MLT, because I want to use MLT with Python. I tried a lot on google but could not find any single documentation page.

basically I have to join few images and videos to make a single video and I have to add audio too in final video. I have to do all this in bulk for lot of videos so I am writing a script in Python. till than I am running MLT's melt command line utility s subprocess of my script. but that command is not very programmable.

like image 909
Alok Avatar asked Feb 14 '14 09:02

Alok


2 Answers

There are a bunch of example python scripts on the MLT Code Examples Page. They're fairly simple but should provide a starting point.

like image 161
Ian Avatar answered Oct 20 '22 05:10

Ian


Basically, you need to learn the C API and extrapolate it to Python. It is easier than it sounds because the C API is object-based and uses reference-counting. The key is to understand that the Python (and other high level language bindings) are generated using SWIG using the mlt++ C++ wrapper. If you compare the C++ header files to the C header files, you can see a fairly direct mapping from one to the other because the C++ API is simply a thin wrapper. Then, compare the mlt Python calls from the examples to the C++ headers to learn how the C++ names convert to Python. Lastly, you can study the code of Flowblade and OpenShot 1.x code to figure out more.

like image 32
Dan Dennedy Avatar answered Oct 20 '22 06:10

Dan Dennedy