Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoded video play speed(frame interval) seems depended on fps. #12

Closed
hongryeol-lee opened this issue Mar 26, 2020 · 2 comments
Closed

Comments

@hongryeol-lee
Copy link

hongryeol-lee commented Mar 26, 2020

Hi,
Thank you for your project.

I encoded avi file using public int Encode(Bitmap bmp);
and played this video on mediaplayer(windows).
but, video files encoded with different fps have different play speeds.
It seems to vary according to fps.
I want to keep the playing speed constant even if the fps are different.
Can you help me?

I used the timer to encode the screen capture in real time as follows.

_timer.Interval = 1000 / fps; _timer.Tick += (sender, e) => { try { Bitmap screen = _provider.Capture(); _encoder.Encode(screen); } catch { } };

@secile
Copy link
Owner

secile commented Jul 31, 2020

I'm sorry for late, very late reply.
I think you do not need the answer anymore, but anyway I answer.

It is natural that different fps have different playback speed.

  • 10 bitmaps with 1 fps -> playback in 10 sec.
  • 10 bitmaps with 10 fps -> playback in 1 sec.

To keep playback speed constant,
you need to change the number of bitmaps you supply.

  • 10 bitmaps with 1 fps -> playback in 10 sec.
  • 100 bitmaps with 10 fps -> playback in 10 sec.
  • 300 bitmaps with 30 fps -> playback in 10 sec.

If this does not answer your question, please ask again.
Thank you.

@hongryeol-lee
Copy link
Author

I got it, Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants