0

i am a newbie and trying to understand the concepts behind ffmpeg/video.

FPS means frame per second , for example

25fps -> 25 frames captured in a second

From the display perpective

25 frames need to be displayed in a second.

correct me if i am wrong?

Now i have written a simple video player in ffmpeg to display. i read frames by av_read_frame(), if fps is 25, then does

 av_read_frame()

returns 25 frames per second? how can i relate it?

Whoami
  • 13,930
  • 19
  • 84
  • 140

1 Answers1

1

Read and write operations don't have to honor the data rate of the stream in question. Instead, they happen without any delays as soon as possible. After all, if you transcode a file, you are typically not interested in doing it at 100% playback speed and more likely you are interested in having it completed quickly, as quick as reading, writing, encoding etc. allows.

Any source generating content is interested to properly time stamp it, attaching frame rate and individual timestamps, so that playback could reproduce the stream accurately, including relatively to other streams ("lipsync").

Any presentation system is interested in presenting data taking into consideration time stamps, adding delays and idle time if/when necessary, so that playback is accurate.

Everything else in between, including av_read_frame, only cares for not losing timings attached to data, and is executed without any delays (in case of av_read_frame returning you as many frames per second as it can).

Roman R.
  • 68,205
  • 6
  • 94
  • 158