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

Video streaming #207

Merged
merged 9 commits into from
Dec 2, 2024
Merged

Video streaming #207

merged 9 commits into from
Dec 2, 2024

Conversation

Leterax
Copy link
Contributor

@Leterax Leterax commented Dec 2, 2024

This pull request includes significant updates to the video player implementation using PyAV for decoding and ModernGL for rendering. The changes focus on improving the video decoding and playback functionality, enhancing error handling, and refining the user interface for video control.

Video Player Improvements:

  • examples/video.py: Refactored the video decoding and playback classes. The Decoder class has been renamed to VideoDecoder, and the Player class has been renamed to VideoPlayer. Added better error handling, logging, and methods for seeking and frame generation.
  • examples/video.py: Introduced constants for frame synchronization thresholds and improved the update method to handle frame skipping and synchronization more effectively.
  • examples/video.py: Enhanced the VideoPlayerWindow class to handle keyboard inputs for seeking and pausing, and added debug information printing.

Bug Fixes:

  • moderngl_window/timers/clock.py: Fixed a potential division by zero error in the next_frame method by adding a check to ensure delta is greater than zero before calculating the FPS.

examples/video.py Outdated Show resolved Hide resolved
@einarf einarf merged commit 1905451 into moderngl:master Dec 2, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants