[FFmpeg-user] [FFmpeg-devel]Video filter "setpts" works very slow on Android

Peter White peter.white at posteo.net
Fri Aug 19 13:31:49 EEST 2016

19.08.2016 10:41, schrieb Glorin Li:
> Hi all,


have you really cross-posted this to the devel list? You might want to
think again about that. I am not a developer, so not described to that
one but it certainly is not meant for questions like this. Plus, cross-
posting in general is frowned upon. If you must, you better have a good
reason and make that clear to everyone else.

> I am using ffmpeg to create timelapse videos on Android, I use the command
> below to make a video 2x faster:
> *    ffmpeg -i src.mp4 -filter:v setpts=0.5*PTS -c:v libx264 -threads 6
> -preset ultrafast -t 20 dst.mp4*

You are transcoding the video just to manipulate the PTS. I think that
is the wrong approach. I don't know if ffmpeg is capable of just writing
different PTS without re-encoding the file. I reckon it is not. But as
long as you use the -filter option re-encoding is inevitable.
I think you should find a tool that can just speed up playback on a
metadata level. I don't know if there is one for mp4 but I know of one
for matroska files.

> The src.mp4 is a video file of 40 seconds duration, and the resolution is
> 1920x1080.

That is quite some work for this platform, I reckon:

> I run this command on a Nexus5X phone.

even at preset ultrafast.

> The problem is that the process takes really long time, it costs 300s -
> 400s (5min - 7min) to do the job.

If you must do it this way, downscaling is an option. The less pixels
x264 has to encode the faster it runs. Of course scaling costs CPU time
as well, but compared to x264 that is negligible. I never got the point
of HD video on displays the size of a credit card, anyway. You won't be
missing much, if you are going to watch on that device.

> The same task runs on my mac-mini only takes less than 20 seconds.

That's like comparing a Cesna to a fighter jet, or a bicycle to a
motorbike. ;)


More information about the ffmpeg-user mailing list