[MEncoder-users] How to transcode MTS files recorded by Panasonic HDC-SD100 camera?

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Feb 14 22:16:57 CET 2012

On Tue, Feb 14, 2012 at 12:12:30PM -0800, Marton Sigmond wrote:
> That is above 80 FPS.
> Following command is executed at 39 FPS:
> ffmpeg -threads 1 -i %out -f null -s vga -aspect 16:9 -
> This one is 42 FPS:
> ffmpeg -threads 1 -i %out -f null -r 25 -
> However when I combine the two it is only 19 FPS:
> ffmpeg -threads 1 -i %out -f null -r 25 -s vga -aspect 16:9 -

You said your input is 50 fps.
So the scaling halves the speed, and -r 25 halves it once more
(because with -r 25 you need to decode 2 frames to encode one,
and the fps value is in encoded frames).
However it would have been more interesting to see the -threads 8
(or similar) results.
perf record ffmpeg ...
perf report
might give an idea where most time is spent, too.
Most likely you should start by choosing a simpler scaler.
For mencoder/mplayer that is set with the -sws option, and the default
is fast bilinear.
Use -sws_flags fast_bilinear to choose the same for FFmpeg.
For 720p input and on a dual-core Phenom changing -threads 1 and no
sws_flags to -threads 8 -sws_flags fast_bilinear resulted in
80 fps -> 125 fps.
Going to -sws_flags neighbor gave 130 fps.

> One could decode the input stream and convert to 25 fps (1), a second one could resize the stream (2), and a third one could encode the final mpeg stream.

A large enough -threads value should cause decode to run on different
cores than the rest.

More information about the MEncoder-users mailing list