I need to know how to find the total number of frames in a video file using avcodec / avformat.
I have a project that I am building from someone else who used ffmpeg libraries to decode video streams. I need to refine some functionality in order to search frame by frame, and therefore my first task is simply to calculate the total number of frames in the file. AVStream.nb_frames seems like a reasonable place to search, but it is always 0 with all the video files I tried. Does the total number of frames output from AVFormatContex.duration in the best way?
source share