[FFmpeg-user] What is the fastest way to run cropdetect on specificframes in the video?

Dan Flett dflett at bigpond.net.au
Thu Jul 28 13:42:01 CEST 2011


-----Original Message-----
From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-bounces at ffmpeg.org]
On Behalf Of Matt Kim
Sent: Monday, 4 July 2011 04:40
To: ffmpeg-user at ffmpeg.org
Subject: [FFmpeg-user] What is the fastest way to run cropdetect on
specificframes in the video?


I am trying to run the cropdetect function from the libavfilter library in
the fastest way possible.

And so I am trying to only take a collection of video frames throughout the
video and run it through the cropdetect filter.

So far I have tried two methods:
1. Run FFmpeg 4 different times in parallel at 4 different seektimes using
the -ss option.
    - Unfortunately for me--the -ss option does not seem to work quickly,
and so attempts to run through every frame before reaching the correct time.
This causes the -ss option to be the bottleneck.  This maybe be an issue
with file itself and not FFmpeg.

2. Apply the "select" filter before "cropdetect".
    - This method is even slower than the previous one.  I'm assuming that
applying the select filter on each frame takes much time.

*I have heard that moving the -ss option around may speed up the
process--but unfortunately on all of the encoded files I am dealing
with--this method does not seem to help.

Does anyone have any advice on how I may be able to run cropdetect faster?
Right now my analysis (using the parallel method) takes about 1 sec per 1
minute.  This can cause problems though--as a 3hour long video will take
about 3 minutes to analyze.

Here is an example of how I am running my cropdetect filter:
ffmpeg -i [input video] -vf
-ss 600 -t 100 -an -y null.mp4

Any help would be greatly appreciated.
Matt Kim
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org

Hi Matt

The only suggestion I have is putting -ss and -t before -i in your command


More information about the ffmpeg-user mailing list