user20294: I need to stabilize a video only when the video is shaky. 
I have successfully stabilized a video using FFmpeg, and I do not need to stabilize all the videos, I only need to stabilize the videos which appear shaky (not stable). 
Is there any way I can detect that?

user27348: Try ffmpeg's deshake filter. It scans the full frame (or a portion of your choosing) and detects shake based on a number of adjustable variables. If the video isn't shaking, it doesn't change the content. You can run the default settings with:
ffmpeg -i [input] -vf deshake [output]
Great little demo here. It's a combination detection and repair tool, no need to separately identify videos then reprocess.

20294: <p>I need to stabilize a video only when the video is shaky. </p>

<p>I have successfully stabilized a video using FFmpeg, and I do not need to stabilize all the videos, I only need to stabilize the videos which appear shaky (not stable). </p>

<p>Is there any way I can detect that?</p>
 27348: <p>Try ffmpeg's <a href="https://ffmpeg.org/ffmpeg-filters.html#deshake" rel="nofollow noreferrer">deshake filter</a>. It scans the full frame (or a portion of your choosing) and detects shake based on a number of adjustable variables. If the video isn't shaking, it doesn't change the content. You can run the default settings with:</p>

<p><code>ffmpeg -i [input] -vf deshake [output]</code></p>

<p><a href="http://blog.gregzaal.com/2014/05/30/camera-stabilisation-with-ffmpeg/" rel="nofollow noreferrer">Great little demo here</a>. It's a combination detection and repair tool, no need to separately identify videos then reprocess.</p>
