{"id":13827381,"url":"https://github.com/ArjunSahlot/vidmaker","last_synced_at":"2025-07-09T03:32:04.911Z","repository":{"id":52789886,"uuid":"461726452","full_name":"ArjunSahlot/vidmaker","owner":"ArjunSahlot","description":"A python library which simplifies creating and exporting videos.","archived":false,"fork":false,"pushed_at":"2023-10-01T07:15:22.000Z","size":76,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-10T09:32:37.780Z","etag":null,"topics":["python","python-lib","python-library","video","videomaker"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/vidmaker/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArjunSahlot.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}},"created_at":"2022-02-21T06:05:38.000Z","updated_at":"2024-05-06T14:45:37.000Z","dependencies_parsed_at":"2024-01-15T16:51:50.168Z","dependency_job_id":null,"html_url":"https://github.com/ArjunSahlot/vidmaker","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"5501ec50b4c544ce5f6b6b9bb6d6816d076374bb"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":"ArjunSahlot/module_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjunSahlot%2Fvidmaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjunSahlot%2Fvidmaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjunSahlot%2Fvidmaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjunSahlot%2Fvidmaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArjunSahlot","download_url":"https://codeload.github.com/ArjunSahlot/vidmaker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225481529,"owners_count":17481175,"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":["python","python-lib","python-library","video","videomaker"],"created_at":"2024-08-04T09:01:55.107Z","updated_at":"2024-11-20T06:31:44.184Z","avatar_url":"https://github.com/ArjunSahlot.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# vidmaker\n\nA python library which simplifies creating and exporting videos.\n\n## Purpose\n\nvidmaker was created because I wanted to record some of my pygame projects, and I found this to be the most convenient way.\n\n## How to use\n\nNOTE: vidmaker uses temporary disk space to store frames. This prevents over usage of memory, but slows it down\n\nSince this is a python library, install it by `pip install vidmaker`\n\nCurrently vidmaker only has one class, `Video`, making it extremely simple to use.\n\nFirst, you have to initialize your video with the path you want it to render at the fps and the resolution. Always include the \".mp4\" ending to the path, vidmaker DOES NOT do it for you.\n\n```py\nimport vidmaker\n\nvideo = vidmaker.Video(path=\"vidmaker.mp4\", fps=60, resolution=(300, 300))\n```\n\nThen you have to update the video every frame with the image you want it to add to your video.\n\n```py\nimport pygame\nimport vidmaker\n\nFPS = 60\n\nWINDOW = pygame.display.set_mode((300, 300))\n# If fps and resolution are auto then late_export has to be True\nvideo = vidmaker.Video(\"vidmaker.mp4\", late_export=True)\npygame.display.set_caption(\"vidmaker test\")\n\n\ndef main(window):\n    pygame.init()\n    clock = pygame.time.Clock()\n\n    while True:\n        clock.tick(FPS)\n        window.fill((255, 0, 0))\n        events = pygame.event.get()\n        keys = pygame.key.get_pressed()\n        ctrl_pressed = keys[pygame.K_LCTRL] or keys[pygame.K_RCTRL]\n        for event in events:\n            if event.type == pygame.QUIT:\n                pygame.quit()\n                return\n            if event.type == pygame.KEYDOWN:\n                if event.key == pygame.K_q and ctrl_pressed:\n                    pygame.quit()\n                    return\n\n        # set inverted=True if your colors are inverted\n        video.update(pygame.surfarray.pixels3d(window).swapaxes(0, 1), inverted=False) # THIS LINE\n        pygame.display.update()\n\n\nmain(WINDOW)\n```\n\nOnce your program finishes, you just have to export your video\n\n```py\nvideo.export(verbose=True)\n```\n\nIf you have a long video, you may consider compressing it to a smaller file size. vidmaker offers custom compression although it requires ffmpeg and is not super accurate, although very useful. If your desired compression settings don't turn out as intended, you can just run compress again with the rest of the code commented out.\n\n```py\nvideo.compress(target_size=1024, new_file=True)  # target_size is in KB\n```\n\n```py\n\"\"\"\nOld code of unsuccessful compression\n\"\"\"\nvideo.compress(target_size=2048, new_file=True)  # keep testing different compression sizes until you find a good one\n```\n\nThat's it! You should find your video fully rendered at the given path, but the longer the video, the longer `video.export()` and `video.compress()` take. I tested around 100fps during exporting on my computer and it should be even faster without verbose; compression is also much faster than export. The speed does heavily depend of what you are exporting and your computer.\n\n## Contributing\n\nContributing is always appreciated! I would love it if anyone was to make a pull request to add another feature or create an issue post. Possible features could be things like an option to use memory instead of disk space, the option to render videos in different formats (only mp4 right now), and many more. If there is enough demand I might add some myself as well. Thanks for the support!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArjunSahlot%2Fvidmaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArjunSahlot%2Fvidmaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArjunSahlot%2Fvidmaker/lists"}