Following Kdenlive's bug report:

https://bugs.kde.org/show_bug.cgi?id=392294

I noticed that encoding to webm with the avformat consumer produces files reporting an incorrect fps (1000fps). Some googling suggested to enforce the fps on the stream, and the following patch produces files that report a correct fps. However not sure if this can have side effects...

Any comments on that ?

Regards

jb

-----------

diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c
index c3724d13..edb157c9 100644
--- a/src/modules/avformat/consumer_avformat.c
+++ b/src/modules/avformat/consumer_avformat.c
@@ -792,6 +792,10 @@ static AVStream *add_video_stream( mlt_consumer consumer, AVFormatContext *oc, A
 #endif
                st->time_base = c->time_base;

+               // Enforce fps
+               c->framerate = av_inv_q(st->time_base);
+               st->avg_frame_rate = c->framerate;
+
                // Default to the codec's first pix_fmt if possible.
                c->pix_fmt = pix_fmt ? av_get_pix_fmt( pix_fmt ) : codec ?                         ( codec->pix_fmts ? codec->pix_fmts[0] : AV_PIX_FMT_YUV422P ): AV_PIX_FMT_YUV420P;

Looks legit to me. Ffmpeg does the same thing:
http://ffmpeg.org/doxygen/trunk/ffmpeg_8c_source.html#l03372

I'm not sure the comment and blank line are necessary. I would suggest:
                st->time_base = c->time_base;
                st->avg_frame_rate = av_inv_q(c->time_base);
                c->framerate = av_inv_q(c->time_base);

~Brian



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to