

ffprobe -v error -select_streams v:0 -count_frames -show_entries stream=nb_read_frames -print_format default=nokey=1:noprint_wrappers=1 Big_Buck_Bunny_1080_10s_20MB.mp4 This will ensure that the keys are not printed and only the value is output by ffprobe. If you want only the number and not the specifier ( stream), then you can modify the commandline as instructed here. It’s as simple as that! ffprobe -v error -select_streams v:0 -count_frames -show_entries stream=nb_read_frames Big_Buck_Bunny_1080_10s_20MB.mp4 Running this command will instruct ffprobe to print the number of frames in the video.

Here is more information on ffprobe’s specifiers. stream is a selector that allows you to narrow down on what data to print. nb_read_frames is the number of frames returned by the decoder.-count_frames as the name suggests, gives you a count of the number of frames in the video.You can modify suitably for your use case.

