[FFmpeg-user] Grab stills on scene change math question

Bouke (VideoToolShed) bouke at videotoolshed.com
Tue Aug 25 14:22:31 CEST 2015


Hi Moritz,
Thanks!

> Hi Bouke,
>
> On Tue, Aug 25, 2015 at 13:00:40 +0200, Bouke (VideoToolShed) wrote:
>> assuming that gt(scene\,0.4) will return a number that I could do math 
>> on,
>> but this fails.
>
> ffmpeg's expressions give the select filter a true/false (take or don't
> take this frame) decision. In this case: scene detection shows a change
> of 0.4 or more, principally.

Ah, that makes sense!

>> And to make it more complex, can I also grab a shot out of the middle
>> of a scene? (that would require to get the current and next
>> framenumber, subtract and divide by two to an integer and add to the
>> first...)
>
> I wish I knew. I don't think such a filter exists. Part of the issue is
> that ffmpeg would need to look ahead, and buffer a lot of data (which
> it does for other filters as well).

Well, in theory it should only have to remember the last frame number...
But this is acedemic, as your solution is way easier.

> What you could do is to parse the video for scene changes first,

Ok, this I can do.

> calculate the images you want, and present them to the select filter in
> the second run.

But, I'm clueless on how to do that?.
(Except restarting FFmpeg for each frame with a -ss)
Btw, is there a -ss  option that i can input frames instead of time?

Thanks,
Bouke

> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the ffmpeg-user mailing list