user6230: I'd like to record a very long video from webcam which will be mostly the same.
I'd like to drop intermediate frames that are very similar to each other to save on filesize and also make it easier to find "interesting" parts of the video later.
The frames will likely not be identical but should be similar (I imagine I'll have to experiment with thresholds)
I am familiar with both mencoder and ffmpeg but have been unable to find any options to do what I need.
I'd prefer to drop the unwanted frames at time of recording but if it must be done as a post-process that is ok however - the video needs to have a timestamp on it, obviously this will interfere with any similarity test so it either needs to be done at time of recording or the similarity test needs to ignore a predefined section of the video without dropping it.
FYI this is the command I am using currently but without the desired framedropping.
ffmpeg -f video4linux2 -s 800x600 -r 15 -i /dev/video1 -maxrate 800k -minrate 1k -bt 800k -bufsize 2M -filter drawtext='text=%{localtime }:fontfile=/usr/share/fonts/truetype/DejaVuSans-Bold.ttf'  -f h264  out.avi -y

What are my options?

user6210: I found this thread. There you can see that Avisynth has a plugin (GetDups) which will allow you to do exactly what you want.

user6294: It is actually quite easy using a videofilter with select.
This is quite sensitive to video changes:
-vf "select=gt(scene\,0.0098)"

whereas this is not so sensitive:
-vf "select=gt(scene\,0.3)"

EDIT (added your command)
so your command would look like:
ffmpeg -f video4linux2 -s 800x600 -r 15 -i /dev/video1 -maxrate 800k \ 
-minrate 1k -bt 800k -bufsize 2M -filter \ 
drawtext='text=%{localtime }:fontfile=/usr/share/fonts/truetype/DejaVuSans-Bold.ttf'  \
-vf "select=gt(scene\,0.3)" -shortest -c:v libx264 out.mp4 -y

P.S. You need to explicitly state the codec libx264 and not just tell it -f h264 and why on earth would you be using avi???

6230: <p>I'd like to record a very long video from webcam which will be mostly the same.
I'd like to drop intermediate frames that are very similar to each other to save on filesize and also make it easier to find "interesting" parts of the video later.</p>

<p>The frames will likely not be identical but should be similar (I imagine I'll have to experiment with thresholds)</p>

<p>I am familiar with both mencoder and ffmpeg but have been unable to find any options to do what I need.</p>

<p>I'd prefer to drop the unwanted frames at time of recording but if it must be done as a post-process that is ok however - the video needs to have a timestamp on it, obviously this will interfere with any similarity test so it either needs to be done at time of recording or the similarity test needs to ignore a predefined section of the video without dropping it.</p>

<p>FYI this is the command I am using currently but without the desired framedropping.</p>

<pre><code>ffmpeg -f video4linux2 -s 800x600 -r 15 -i /dev/video1 -maxrate 800k -minrate 1k -bt 800k -bufsize 2M -filter drawtext='text=%{localtime }:fontfile=/usr/share/fonts/truetype/DejaVuSans-Bold.ttf'  -f h264  out.avi -y
</code></pre>

<p>What are my options?</p>
 6210: <p>I found <a href="http://forum.videohelp.com/threads/317866-Remove-Duplicate-Frames" rel="nofollow">this</a> thread. There you can see that Avisynth has a plugin (GetDups) which will allow you to do exactly what you want.</p>
 6294: <p>It is actually quite easy using a videofilter with select.</p>

<p>This is quite sensitive to video changes:</p>

<pre><code>-vf "select=gt(scene\,0.0098)"
</code></pre>

<p>whereas this is not so sensitive:</p>

<pre><code>-vf "select=gt(scene\,0.3)"
</code></pre>

<p><em>EDIT (added your command)</em></p>

<p>so your command would look like:</p>

<pre><code>ffmpeg -f video4linux2 -s 800x600 -r 15 -i /dev/video1 -maxrate 800k \ 
-minrate 1k -bt 800k -bufsize 2M -filter \ 
drawtext='text=%{localtime }:fontfile=/usr/share/fonts/truetype/DejaVuSans-Bold.ttf'  \
-vf "select=gt(scene\,0.3)" -shortest -c:v libx264 out.mp4 -y
</code></pre>

<p>P.S. You need to explicitly state the codec libx264 and not just tell it <code>-f h264</code> and why on earth would you be using avi???</p>
