So there are 3 possibilities that I see for getting mlt to work with Ruby.
- Run melted and build a ruby client for it. I actually partially built one that I would share with you if you are interested
- Use FFI and connect directly to “mlt.h.” This is the direction I would have headed in if I was still using mlt.
- Compile the Ruby SWIG bindings, fire up pry (pry was instrumental in being to do anything with the mlt bindings for me) and play around.
If you are messing around in the repl, you can send arguments of the wrong type to methods and the error generally tells you what kind of argument it wants. With pry
you can also
ls
classes and objects to see the methods available on them (awesome!).
Here are the lines that expose the SWIG API to the C++ API. So the Ruby classes you can use when you require “mlt”
. ex. Producer.new
https://github.com/mltframework/mlt/blob/master/src/swig/mlt.i#L34
Here are the C++ files that are being referenced
https://github.com/mltframework/mlt/tree/master/src/mlt%2B%2B
And here are the C files with the actual implementation. They are pretty easy to read (for the most part) even if you have no C experience. self
is trying to use a kind of OOP style in C. It is very similar to how you create Python classes.
https://github.com/mltframework/mlt/tree/master/src/framework