I have sent a patch regarding initializing of audio frequency and audio
channels in the avformat and dv producer a while ago (
http://sourceforge.net/mailarchive/forum.php?thread_id=19277958&forum_id=40948 ) ,
and then received some comments from Charles Yates (See at the end of this
mail for his comments and my answer).
This patch is really simple and I don't think it can harm since it just
initializes values that otherwise always returned 0. It allows us to retrieve
the audio frequency and number of audio channels of a file, which is required
to generate audio thumbnails in Kdenlive.
I would be glad if you some of you can have a look again & commit it or tell
me if there is still something wrong with it.
I think that as Kdenlive grows, there will be a growing demand for custom
producers / filters for MLT. Currently, I think it would be easier to have
some kind of "mlt addon" repository in Kdenlive svn which would contain those
additional filters / producers. I am currently setting it up so that I can
put my simple MLT slowmotion / stroboscope producer (
That way, people involved / interested in Kdenlive/MLT development can easily
develop and share MLT filters/producers.
The other way would be to create an "experimental" module folder in MLT cvs
and to give a cvs access on that folder to all people interested...
Let me know what you think.
Charles comment on my patch:
Think there might be a little more to this one - basically, you'd get
the sources frequency on the frame there, but if it's passed through a
resampling filter, this change wouldn't be reflected.
If you make a similar mod to the resample filters
(avformat/filter_avresample.c and resample/filter_resample.c), I'd
happily apply it.
After taking some time to look at it I must say that it seems that these
changes are already reflected. If you look at avformat/filter_avresample.c
and resample/filter_resample.c, you can see that both of them update the
values for frequency and channels at the end of the resample_get_audio
function, and that these values are then applied to the frame in
framework/mlt_tractor.c (line 234-235).
A quick test in the sdl_producer showed me that the entering frame frequency
is correctly adjusted if you apply a resampling filter.
So in my opinion, it is safe to apply my patch that initialises the channels
and frequency values in producer_avformat.c and producer_libdv.c