On Thu, Oct 22, 2015 at 4:07 AM Abhijit Pathak <abhi...@amagi.com> wrote:
> Hi , > > I am having hard time in getting MLT Consumer transcode faster than > real-time. > > Typically on a input file, I apply effects, overlay logo and then handover > to AvFormat to transcode, but overall process takes as much time or more > than time of input file. > > My Playback system plays transcoded Mpeg2TS file, I am not playing out > directly. > > E.g. > > time melt A_David_Beckham_30_sec.mp4 -consumer > avformat:output-stab-test.ts vcodec=h264_qsv b=5000k acodec=aac ab=128k > tune=film > > booo QuickSync is notorious for bad quality compared to x264, which at its veryfast speed setting approaches QuickSync speed with better results. I do not know if it works in MLT; never tried it, and I do not have hardware that supports it. Is it really working for you? > command takes more than 30 second, whereas if I use ffmpeg for transcoding > directly it takes <10 seconds. > > Maybe ffmpeg is automatically using hardware-accelerated decoding on your system but not MLT? I made a test using libx264 for transcoding only - no explicit filters - and yeah, melt is a _little_ slower: time ffmpeg -y -i ~/Videos/A06.avi -c:v libx264 -b:v 5000k -c:a aac -strict experimental -b:a 128k test.mp4 ... real 0m21.908s user 2m20.206s sys 0m0.912s time melt ~/Videos/A06.avi -consumer avformat:test.mp4 vcodec=libx264 vb=5M acodec=aac ab=128k ... real 0m22.923s user 2m16.615s sys 0m1.460s This is due to some MLT internals to provide the convenience and expression for the workloads for which it was designed. For example, it applies normalization filters - whether active or not - that has a little overhead to determine whether to do something. It also has more limited YUV format support. Filters and transitions can only operate in yuv422p, rgb24, rgba, or opengl. Thus, by default, there is a conversion yuv420p -> yuv422 -> yuv420p. You can add mlt_image_format=yuv420p to the consumer to make it skip doing those YUV conversions. However, if you do any sort of filters or transitions; then, that will cause problems as yuv420p. However, in special, controlled yuv420p -> yuv420p use cases you can use it. While that property is working for the sdl consumer, I noticed while testing for this response that it was broken for avformat. So, I just fixed it. Now, it is very close to ffmpeg: time melt ~/Videos/A06.avi -consumer avformat:test.mp4 vcodec=libx264 vb=5M acodec=aac ab=128k mlt_image_format=yuv420p ... real 0m22.094s user 2m13.910s sys 0m1.374s
------------------------------------------------------------------------------
_______________________________________________ Mlt-devel mailing list Mlt-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mlt-devel