-
If I create an MLT graph (using an xml file) with 2 Does the avformat producer have to open the file 2 times to get the video metadata? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Yes, producers are separate; it does not cache in the manner that you asked about. |
Beta Was this translation helpful? Give feedback.
-
I’m not interested in doing the work or maintaining it in the framework or avformat producer. You can already reference a producer multiple times in a composition with a caveat. Mixing an avformat producer with itself such as in a transition like cross fade may produce corrupt audio because there is a buffer of decoded audio samples in the object’s state. But it’s been a long time since I tried it and looked into it. It could be now there is something to flush that buffer between calls to get audio from non-sequential frames. So, your script or application can maintain a map of file name to producer to reuse the objects. Or, are you using the melt command line tool? |
Beta Was this translation helpful? Give feedback.
-
the avformat-novalidate producer might help with that: https://mltframework.org/plugins/ProducerAvformat-novalidate/ Also, I don't think the optimization you are proposing will really help. Depending on the container, making an arbitrary seek into an open producer probably takes about as much resources as opening the file and seeking. I don't think it would save a lot. Maybe you would want an optimization that opens the file multiple times, but each producer somehow pre-seeks to the first frame (possibly asynchronously in a different thread long before the first frame is needed). |
Beta Was this translation helpful? Give feedback.
Yes, producers are separate; it does not cache in the manner that you asked about.