0

In order to get the length of a clip in the MLT framework, I need to configure the mlt profile to 24fps like my clip. So I tried to do (python binding):

In [1]: import mlt

In [2]: mlt.Factory.init()
Out[2]: <mlt.Repository; proxy of <Swig Object of type 'Mlt::Repository *' at 0x7fffe6b78570> >

In [4]: profile = mlt.Profile()

In [5]: myprod = mlt.Producer(profile, "myfile.mp4")

In [6]: profile4 = mlt.Profile.from_producer(profile, myprod)

In [7]: profile4.fps()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [7], in <cell line: 1>()
----> 1 profile4.fps()

AttributeError: 'NoneType' object has no attribute 'fps'

Any idea what I'm doing wrong?

tobiasBora
  • 1,542
  • 14
  • 23

1 Answers1

0

from_producer() does not return anything. I would expect you to use:

import mlt
mlt.Factory.init()
profile = mlt.Profile()
myprod = mlt.Producer(profile, "myfile.mp4")
profile.from_producer(myprod)
profile.fps()
Brian
  • 1,200
  • 6
  • 8