Ury Jamshy
Ury Jamshy

Reputation: 173

Jitter in video source frame rate

An application written in C# is using DirectShow to record Audio + Video into an AVI file. However, the video source produces unsteady frame rate. For example, when setting the frame rate to 24 fps, the actual rate jitters between 24 to 30 fps.

This causes audio/video sync problem in the resulting AVI file.

A possible solution is to add a filter to the graph (just before writing to AVI) that adjusts the rate - dropping frames or duplicating frames in order to keep the requested rate.

Do you think the solution is feasible?
Any other solutions to this problem?

Thanks,
Ury.

Upvotes: 1

Views: 1025

Answers (1)

Roman Ryltsov
Roman Ryltsov

Reputation: 69632

AVI container is using fixed frame rate, which needs to be provided before starting the file. Video frame have to match the frame rate, or they can be dropped (zero length frame) if there is no sufficient data. As a result, AVI format is not so good for variable frame rate video.

Options for you:

  • adjust video frame time as you suggested
  • use a better suitable container format
  • use high AVI frame rate with higher dropped frame rate, to store all your frames flexibly using a smaller time grid for the frames

Upvotes: 3

Related Questions