mlt icon indicating copy to clipboard operation
mlt copied to clipboard

Add audio cache to avformat producer

Open Tjoppen opened this issue 4 years ago • 3 comments

I based this off of how producer_avformat.c does video caching. Seems to work fine and doesn't leak any more memory than melt did before this patchset.

I purposefully don't use mlt_frame_get_audio() because it sets *samples to zero.

This fixes #738

Tjoppen avatar Oct 28 '21 07:10 Tjoppen

Thank you for your contribution.

ddennedy avatar Oct 28 '21 16:10 ddennedy

I was reviewing some things today, and I agree to merge this if you simply "add a property to set the amount of audio caching. Leave it unset by default in which case it evaluates to 0 when getting it. Then, you can set it to a higher value for your needs."

ddennedy avatar Nov 29 '21 23:11 ddennedy

I was reviewing some things today, and I agree to merge this if you simply "add a property to set the amount of audio caching. Leave it unset by default in which case it evaluates to 0 when getting it. Then, you can set it to a higher value for your needs."

Worksforme. I lost some interest in this patch because I wrote a URL caching FUSE thing instead. While audio caching helps, it does not help with mlt opening the same file/URL several times instead of just once. This means libavformat has to re-parse the file. This is especially bad with MXF files. I forget the exact number of times mlt re-opens the file, but it's something like seven. So if it takes ffprobe five seconds to probe a HTTP URL then it takes melt around thirty seconds..

Tjoppen avatar Dec 01 '21 10:12 Tjoppen

This PR was implemented by https://github.com/mltframework/mlt/pull/903

bmatherly avatar Aug 25 '23 13:08 bmatherly