{"id":22595048,"url":"https://github.com/bluemirrors/vidsz","last_synced_at":"2025-04-11T00:20:26.958Z","repository":{"id":43755685,"uuid":"373820406","full_name":"BlueMirrors/vidsz","owner":"BlueMirrors","description":"Common Wrapper/Interface around various video reading/writing tools to make video reading stable, consistent, and super easy around different systems and OS.","archived":false,"fork":false,"pushed_at":"2022-04-24T19:37:24.000Z","size":2041,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T07:48:26.957Z","etag":null,"topics":["opencv-python","python","python3","video-reader","video-writer"],"latest_commit_sha":null,"homepage":"https://vidsz.readthedocs.io/","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/BlueMirrors.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}},"created_at":"2021-06-04T11:32:03.000Z","updated_at":"2025-04-05T22:34:33.000Z","dependencies_parsed_at":"2022-09-17T04:41:46.418Z","dependency_job_id":null,"html_url":"https://github.com/BlueMirrors/vidsz","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueMirrors%2Fvidsz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueMirrors%2Fvidsz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueMirrors%2Fvidsz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueMirrors%2Fvidsz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueMirrors","download_url":"https://codeload.github.com/BlueMirrors/vidsz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248318715,"owners_count":21083709,"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","python","python3","video-reader","video-writer"],"created_at":"2024-12-08T10:08:41.419Z","updated_at":"2025-04-11T00:20:26.924Z","avatar_url":"https://github.com/BlueMirrors.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://raw.githubusercontent.com/BlueMirrors/vidsz/master/static/logo.png\" width=\"30\"\u003eVidsz: Video's Wizard\n\n![CI-Test-Status](https://github.com/BlueMirrors/vidsz/actions/workflows/ci_tests.yml/badge.svg) [![CodeFactor](https://www.codefactor.io/repository/github/bluemirrors/vidsz/badge?s=8752aa2850f09145fc469fd9a07eafb5144d56fc)](https://www.codefactor.io/repository/github/bluemirrors/vidsz) ![status](https://img.shields.io/pypi/status/ansicolortags.svg) [![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) [![Documentation Status](https://readthedocs.org/projects/vidsz/badge/?version=latest)](https://vidsz.readthedocs.io/en/latest/?badge=latest) [![Downloads](https://static.pepy.tech/personalized-badge/vidsz?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=Downloads)](https://pepy.tech/project/vidsz)\n\nCommon Wrapper/Interface around various video reading/writing tools to make video reading stable, consistent and super easy around different systems and OS.\n\n```bash\npip install vidsz\n```\n\nBackends\n\n- OpenCV (in-development)\n\n\nFeatures\n\n- Easy and hassle free (read/write with ```for-loop```, ```with-block```, ```while-loop```)\n- Batch Support. Read and write frames in batches.\n\n\n# Read Video\n\n\n## Read with ```for-loop```\n```python\nfrom vidsz.opencv import Reader\n\n# open reader\nreader = Reader(\"static/countdown.mp4\")\n\n# read frame with for loop\nfor frame in reader:\n    # use ndarry-frame however you like\n    pass\n\n# release\nreader.release()\n```\n\n\n## Read with a ```with-block```\n```python\nwith Reader(\"static/countdown.mp4\") as reader:\n    frame = reader.read()\n```\n\n\n## Read with a ```while-loop```\n```python\n# this follows similar behavior as opencv counterpart\nwhile reader.is_open():\n    # returns ndarry-frame or None if nothing left to read\n    frame = reader.read()\n    if frame is None:\n        break\n```\n\n\n## Read frames in a ```batch```\n```python\nwith Reader(\"dummy.mp4\", batch_size=8, dynamic_batch=True) as reader:\n    batch_frames = reader.read()\n```\n\n\n## Get properties of the reader\n```python\n# print info: width, height, fps etc.\nprint(reader)\n\n# access specific things\nprint(reader.width, reader.height, reader.fps)\n\n# access number-of-frames/seconds/minutes that have been read\nprint(reader.frame_count, reader.seconds, reader.minutes)\n```\n\n\n# Write Video\n\n\n## Write a single frame\n```python\nfrom vidsz.opencv import Reader, Writer\n\nvideo_fname = \"static/countdown.mp4\"\n\n# open reader\nreader = Reader(video_fname)\n\n# start writer with the Reader object\n# by default it'll append _out in the name of the output video\nwriter = Writer(reader)\n\n# start writer with your settings;\n# you can also give any combinations of\n# following settings with Reader object to\n# overwrite default settings\nwriter = Writer(name=\"out.mp4\", width=1920, height=1080, fps=15)\n\n# print writer info\nprint(writer)\n\n# write single frame\nframe = reader.read()\nwriter.write(frame)\n```\n\n\n## Write with ```for-loop```\n```python\n# read frame with for loop\nfor frame in reader:\n    # write the ndarry-frame\n    writer.write(frame)\n```\n\n\n## Write a ```batch```\n```python\n# read batches and write\nwith Reader(\"dummy.mp4\", batch_size=8, dynamic_batch=True) as reader:\n    batch_frames = reader.read()\n    # write list or ndarray of frames\n    writer.write_all(batch_frames)\n\n# close off\nreader.release()\nwriter.release()\n```\n\n\n## Write with a ```with-block```\n```python\n# using \"with\" block, write \"static/countdown_out.mp4\" (clone of input)\nwith Reader(video_fname) as reader:\n    with Writer(reader, name=\"out_with.mp4\") as writer:\n        writer.write_all(reader)\n```\n\n***Logo-Attribution***\n\u003ca href=\"http://www.freepik.com\"\u003eDesigned by brgfx / Freepik\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluemirrors%2Fvidsz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluemirrors%2Fvidsz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluemirrors%2Fvidsz/lists"}