More than one producer+consumer should work. That was a key requirement
from the beginning for a multi-channel broadcast playout server. However,
focus has changed since that time, and this is rarely exercised. The
avformat, qimage, and pixbuf consumers all use mlt_cache via mlt_service,
which is a per-process thing:
https://github.com/mltframework/mlt/blob/master/src/framework/mlt_service.c#L897
See how it uses mlt_global_properties():
https://github.com/mltframework/mlt/blob/master/src/framework/mlt_factory.c#L56

Why? Think about a composition with a few hundred producers and the ability
to seek freely within that composition. Should all of the files handles be
held open? In the case of libavcodec and multi-threaded video codecs,
should all of the threads remain created? It quickly becomes possible to
hit kernel resource limits on open files and child processes per process.
Thus, some producers use a cache to limit private context allocations with
its associated handles and threads active. Upon a cache miss, it must
recreate the private context and re-open and re-initialize things. This
repeats what I just said but also describes an environment variable you can
use to increase caching for avformat:
https://github.com/mltframework/mlt/blob/master/src/modules/avformat/producer_avformat.yml#L18

Try setting that to a higher number using the environment variable or
mlt_service_cache_set_size( NULL, "producer_avformat", n );
Also, try testing with other producers such as color and noise.



On Tue, Aug 2, 2016 at 5:34 AM Paweł Goliński <golp...@gmail.com> wrote:

> Hi,
>
> For quite some time I’ve been fighting with a curious bug in my consumer.
>
> Basically in VLMC (Videolan’s video editor) we have Clip Preview and
> Project Preview
> windows, one for streaming imported clips, the second one for streaming
> current project.
> My libVLC consumer takes as it’s target widget id, and I have 2
> producer+consumer MLT
> pipelines, one for clip preview widget, one for project preview widget.
>
> The problem is, when trying to run streaming on both these widgets at
> once, suddenly
> everything starts misbehaving, and it looks like producer connected to my
> consumer
> (which is avformat for Clip Preview, and avformat+series of filters for
> Project Preview)
> produces frames at stunningly low rate (like, 30 frames for 10 seconds for
> each of the widgets).
>
> I discovered funny thing today however. When I launch these pipelines with
> separate MLT instances
> (so using different mlt_repositories), everything works ok… Moreover, when
> looking at Shotcut, kdenlive,
> I discovered none of these video editors support streaming video to two
> widgets at once (in kdenlive,
> if you display Project Monitor and Clip Monitor in one kdenlive window,
> and play the second one while the
> first one is playing, the first one stops).
>
> This leads to my question. I’m trying to eliminate all possible causes of
> my bug, I’ve been looking at my consumer’s
> code for quite some time, but it seems to me that the problem may actually
> lie in avformat producer (although I may be wrong),
> as it just looks that when turning both pipelines on at once, suddenly
> mlt_consumer_get_frames() in my consumer start taking a looot
> of time (like, more than 100x slower).
>
> So - is the thing I’m doing supported in MLT (meaning, running two
> independent producer+consumer pipelines at once)?
>
>
> Best,
> Paweł
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Mlt-devel mailing list
> Mlt-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mlt-devel
>
------------------------------------------------------------------------------
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to