{"id":31593090,"url":"https://github.com/kadir014/pygame-video","last_synced_at":"2026-01-16T12:43:36.630Z","repository":{"id":150903243,"uuid":"376538962","full_name":"kadir014/pygame-video","owner":"kadir014","description":"Video player for Pygame","archived":false,"fork":false,"pushed_at":"2024-11-15T20:54:03.000Z","size":825,"stargazers_count":29,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-06T03:40:28.045Z","etag":null,"topics":["mp4","pygame","python","video","video-player"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kadir014.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-13T12:31:51.000Z","updated_at":"2025-03-01T21:50:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"2461eb73-4fc0-4a4c-92af-9f9436b466dc","html_url":"https://github.com/kadir014/pygame-video","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kadir014/pygame-video","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadir014%2Fpygame-video","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadir014%2Fpygame-video/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadir014%2Fpygame-video/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadir014%2Fpygame-video/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kadir014","download_url":"https://codeload.github.com/kadir014/pygame-video/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kadir014%2Fpygame-video/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mp4","pygame","python","video","video-player"],"created_at":"2025-10-06T03:36:16.727Z","updated_at":"2026-01-16T12:43:36.619Z","avatar_url":"https://github.com/kadir014.png","language":"Python","funding_links":[],"categories":["Multimedia"],"sub_categories":[],"readme":"# Pygame Video Player 📺\n\u003cp\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-3.9%2B-green\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/version-2.0.0-orange\"\u003e\n\u003c/p\u003e\nThis module provides a simple API to let developers use videos in their Pygame apps. Audio playback doesn't use `pygame.mixer`.\n\n## Installing\n```\npip install pygamevideo\n```\nor just copy-paste `pygamevideo.py` to your working directory.\n\n## Usage\n```py\nimport pygame\nfrom pygamevideo import Video\n\npygame.init()\nwindow = pygame.display.set_mode(...)\n\n# Load the video from the specified dir\nvideo = Video(\"video.mp4\")\n\n# Start the video\nvideo.play()\n\n# Main loop\nwhile True:\n  ...\n\n  # Draw video to display surface\n  # this function should be called every frame\n  video.draw_to(window, (0, 0))\n\n  # Update pygame display\n  pygame.display.flip()\n```\n\n## Dependencies\n- [Python](https://www.python.org/downloads/) 3.9+\n- [Pygame Community Edition](https://github.com/pygame-community/pygame-ce) 2.2.0+\n- [NumPy](https://pypi.org/project/numpy/)\n- [OpenCV](https://pypi.org/project/opencv-python/)\n- [FFPyPlayer](https://pypi.org/project/ffpyplayer/)\n\n# API Reference\nYou can just use the docstrings as well.\n\n## `class Video(filepath)`\nPygame video player class.\n\n- ### Parameters\n   `filepath` : Filepath of the video source.\n\n- ### Attributes \u0026 Properties\n   - `is_ready` : Is the video source loaded and ready to play?\n   - `frame_width` : Default frame width in pixels.\n   - `frame_height` : Default frame height in pixels.\n   - `is_playing` : Is the video currently playing?\n   - `is_paused` : Is the video currently paused?\n   - `is_looped` : Is looping enabled?\n   - `volume` : Volume of the audio.\n   - `is_muted` : Is the audio muted?\n   - `fps` : Framerate of the video.\n   - `total_frames` : Total amount of frames of the video.\n   - `duration` : Total duration of the video in milliseconds.\n   - `current_time` : Current time into the video in milliseconds.\n   - `remaining_time` : Remaining time left in the video in milliseconds.\n   - `current_frame` : Current frame into the video.\n   - `remaining_frames` : Remaining frames left in the video.\n   - `current_time` : Current time into the video in milliseconds.\n\n- ### Methods\n   - `load(filepath: Union[str, os.PathLike])` : Load a video from file path. This method is also called implicitly when instantiated.\n   - `reload()` : Reload the video from the same filepath.\n   - `release()` : Release the resources used by the video player.\n   - `play(loop: bool = False)` : Start playing the video.\n   - `stop()` : Stop playing the video.\n   - `pause()` : Pause the video.\n   - `resume()` : Resume the video.\n   - `toggle_pause()` : Switch between paused states.\n   - `mute()` : Mute audio playback.\n   - `unmute()` : Unmute audio playback.\n   - `seek_time(timepoint: float)` : Seek into desired timepoint.\n   - `seek_frame(frame: int)` : Seek into desired frame.\n   - `get_frame()` : Advance the video and return the current frame. Must be called once per frame.\n   - `draw_to(dest_surface: pygame.Surface, position: Coordinate)` : Blit the current video frame to the surface.\n\n# License\n[MIT](LICENSE) © Kadir Aksoy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadir014%2Fpygame-video","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkadir014%2Fpygame-video","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkadir014%2Fpygame-video/lists"}