[FFmpeg-user] How to get he total number of frames

Ulf Zibis Ulf.Zibis at CoSoCo.de
Tue Mar 9 11:43:50 EET 2021

Am 09.03.21 um 09:57 schrieb Peter White:
> On Tue, Mar 09, 2021 at 09:46:43AM +0100, Ulf Zibis wrote:
>> Am 09.03.21 um 09:26 schrieb Peter White:
>>> On Tue, Mar 09, 2021 at 09:13:14AM +0100, Ulf Zibis wrote:
>>>> Hi,,
>>>> can one please tell me, how I can get the total number of frames of a video?
>>> ffmpeg -i input -an -sn -c copy -f null -
>>> This basically copies all frames into the void but you get the total
>>> count this way in the stats line.
>> Much thanks. This at least gives a ballpark figure. Is there a way to get the exact frame count?
> The frame count *is* exact. The way to get there is just not that
> pretty. If anybody on this list knows a better one, step up, please.

I suspect that the last "progression" line shows the exact count, as it may only show the last reprted progression state before the operation is completed.


More information about the ffmpeg-user mailing list