{"id":20371316,"url":"https://github.com/postpop/videoreader","last_synced_at":"2025-04-12T06:24:09.930Z","repository":{"id":36436897,"uuid":"142710943","full_name":"postpop/videoreader","owner":"postpop","description":"pythonic video reader","archived":false,"fork":false,"pushed_at":"2024-10-13T07:34:33.000Z","size":112,"stargazers_count":13,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T19:45:24.961Z","etag":null,"topics":["opencv","python","video"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postpop.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}},"created_at":"2018-07-28T21:21:44.000Z","updated_at":"2024-10-25T19:25:25.000Z","dependencies_parsed_at":"2024-02-01T20:59:36.501Z","dependency_job_id":null,"html_url":"https://github.com/postpop/videoreader","commit_stats":{"total_commits":91,"total_committers":2,"mean_commits":45.5,"dds":0.01098901098901095,"last_synced_commit":"2426cae4800d5f555328a7044ff14aca16b0e68e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postpop%2Fvideoreader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postpop%2Fvideoreader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postpop%2Fvideoreader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postpop%2Fvideoreader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postpop","download_url":"https://codeload.github.com/postpop/videoreader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248526237,"owners_count":21118845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["opencv","python","video"],"created_at":"2024-11-15T01:07:25.780Z","updated_at":"2025-04-12T06:24:09.905Z","avatar_url":"https://github.com/postpop.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pythonic video reader\nWrapper around [opencv's][1] `cv2.VideoCapture` to simplify reading video files in python.\n\n## Installation\nIn a terminal window run:\n```shell\nconda install pyvideoreader -c ncb\n```\nor\n```shell\npip install pyvideoreader\n```\n\n## Usage\nOpen a video file and read frame 100:\n```python\nfrom videoreader import VideoReader\nvr = VideoReader(video_file_name)\nprint(vr)  # prints video_file_name, number of frames, frame rate and frame size\nframe = vr[100]\nvr.close()\n```\n\nOr use a [context manger][2] which takes care of opening and closing the video:\n```python\nwith VideoReader(video_file_name) as vr:  # load the video\n    frame = vr[100]\n```\n\nSupports slice-syntax: `vr[start:end:step]`. To iterate over all frames you need to use `vr[:]`. To read every 100th frame, starting at frame 500 and ending at frame 10000 do this:\n```python\nfor frame in vr[500:10000:100]:\n    do_something_with(frame)\n```\nLists, tuples or ranges can also be passed as indices, e.g. `vr[(42, 314, 999)]`.\n\nNote that indexing returns a generator - each frame in the indices is read on demand which saves memory. If you need all frames at once you can convert it to a list `list(vr[start:end:frame])`.\n\nFor compatibility, `videoreader` can also be used like the underlying `cv2.VideoCapture`:\n```python\nret, frame = vr.read()  # read next frame\n```\n\n[1]: http://opencv.org\n[2]: https://jeffknupp.com/blog/2016/03/07/python-with-context-managers/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostpop%2Fvideoreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostpop%2Fvideoreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostpop%2Fvideoreader/lists"}