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

Rodney Baker rodney.baker at iinet.net.au
Tue Mar 9 14:56:49 EET 2021


On Tuesday, 9 March 2021 23:17:34 ACDT Peter White wrote:
> On Tue, Mar 09, 2021 at 01:07:41PM +0100, Nicolas George wrote:
> > Peter White (12021-03-09):
> > > ffmpeg -i input.mkv -an -sn -c copy -f null -
> > 
> > -c copy tells ffmpeg to dispense with the decoder, which means it does
> > not count frames but packets. Have you tried telling ffprobe to count
> > packets?
> 
> I have now, but it returns 'N/A'. Now that I see that, I might have
> tried it way back when, even, and have forgotten about it.
> 
> ffprobe -count_packets -select_streams v:0 -show_entries
 [...]
>     Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 768x432 [SAR
> 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default) Metadata:
>       BPS-eng         : 1021384
>       DURATION-eng    : 00:21:40.716000000
>       NUMBER_OF_FRAMES-eng: 31186

Isn't this exactly what you're looking for? 
[...]


-- 
==============================================================
Rodney Baker VK5ZTV
rodney.baker at iinet.net.au
CCNA #CSCO12880208
==============================================================




More information about the ffmpeg-user mailing list