{"id":21261806,"url":"https://github.com/tetrax-10/batch-preview-generator","last_synced_at":"2025-06-22T00:07:21.767Z","repository":{"id":213425137,"uuid":"734097504","full_name":"Tetrax-10/batch-preview-generator","owner":"Tetrax-10","description":"Generates preview videos and GIFs from videos using FFmpeg CLI in batch","archived":false,"fork":false,"pushed_at":"2024-10-16T09:36:23.000Z","size":18877,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T15:12:50.264Z","etag":null,"topics":["batch-processing","cli","ffmpeg","gif","gif-creator","inno-setup","preview","preview-generator","python-cli","thumbnail-generator","thumbnails","video-preview"],"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/Tetrax-10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"Tetrax-10"}},"created_at":"2023-12-20T21:31:48.000Z","updated_at":"2025-03-08T09:56:16.000Z","dependencies_parsed_at":"2024-02-21T14:46:44.152Z","dependency_job_id":"7a9845af-222f-4331-89ed-5fe3e5372c2b","html_url":"https://github.com/Tetrax-10/batch-preview-generator","commit_stats":null,"previous_names":["tetrax-10/batch-preview-generator"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Tetrax-10/batch-preview-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tetrax-10%2Fbatch-preview-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tetrax-10%2Fbatch-preview-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tetrax-10%2Fbatch-preview-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tetrax-10%2Fbatch-preview-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tetrax-10","download_url":"https://codeload.github.com/Tetrax-10/batch-preview-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tetrax-10%2Fbatch-preview-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261212503,"owners_count":23125584,"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":["batch-processing","cli","ffmpeg","gif","gif-creator","inno-setup","preview","preview-generator","python-cli","thumbnail-generator","thumbnails","video-preview"],"created_at":"2024-11-21T04:55:58.586Z","updated_at":"2025-06-22T00:07:16.737Z","avatar_url":"https://github.com/Tetrax-10.png","language":"Python","funding_links":["https://github.com/sponsors/Tetrax-10"],"categories":[],"sub_categories":[],"readme":"# Batch Preview Generator\n\n**Generates preview videos and GIFs from videos using FFmpeg CLI in batch.**\n\n\u003cimg src=\"https://raw.githubusercontent.com/Tetrax-10/batch-preview-generator/main/assets/banner.png\"\u003e\u003c/img\u003e\n\n## Installation\n\nDownload and install the [Latest version](https://github.com/Tetrax-10/batch-preview-generator/releases/latest) from the releases page. Done 🎉.\n\nIf you dont have [FFmpeg](https://ffmpeg.org/) installed then download the [FFmpeg included version](https://github.com/Tetrax-10/batch-preview-generator/releases/latest) or download FFmpeg from [here](https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-essentials.7z).\n\n## Demo\n\n**[PSY - GANGNAM STYLE](https://www.youtube.com/watch?v=9bZkp7q19f0) music video to this 15 seconds preview 👇**\n\n![demo preview](https://raw.githubusercontent.com/Tetrax-10/batch-preview-generator/main/assets/demo.gif)\n\n\u003c/br\u003e\n\n**Run `preview` in terminal without any arguments (flags) to initiate interactive prompts.**\n\n![demo preview](https://raw.githubusercontent.com/Tetrax-10/batch-preview-generator/main/assets/demo.png)\n**Note:** This Screenshot reflects initial release and new changes may not be represented.\n\n\u003c/br\u003e\n\n## CLI docs\n\nYou can use this as a CLI by just giving a valid argument(s).\n\nThe above **Gangnam Style** gif can be created with this command.\n\n```powershell\npreview -p \"Gangnam Style.mp4\" -s 15 -sk 7.0 -sp -g\n```\n\n### Arguments\n\n\u003ctable\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e\u003cb\u003eargs\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eFull args\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eDescription\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eDefault\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eType\u003c/b\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-p\u003c/td\u003e\n    \u003ctd\u003e--path\u003c/td\u003e\n    \u003ctd align=\"left\"\u003ePath of the video or folder for batch processing\u003c/td\u003e\n    \u003ctd\u003eCWD\u003c/td\u003e\n    \u003ctd\u003estring\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-o\u003c/td\u003e\n    \u003ctd\u003e--out\u003c/td\u003e\n    \u003ctd align=\"left\"\u003eOutput folder for generated previews\u003c/td\u003e\n    \u003ctd\u003eCWD\u003c/td\u003e\n    \u003ctd\u003estring\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-r\u003c/td\u003e\n    \u003ctd\u003e--resolution\u003c/td\u003e\n    \u003ctd align=\"left\"\u003ePreview video resolution\u003c/td\u003e\n    \u003ctd\u003e360\u003c/td\u003e\n    \u003ctd\u003eint\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-s\u003c/td\u003e\n    \u003ctd\u003e--segments\u003c/td\u003e\n    \u003ctd align=\"left\"\u003eNo. of \u003ca href=\"#1-what-are-segments--s---segments\"\u003esegments\u003c/a\u003e in a preview video\u003c/td\u003e\n    \u003ctd\u003e10 (check code)\u003c/td\u003e\n    \u003ctd\u003eint\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-sd\u003c/td\u003e\n    \u003ctd\u003e--sduration\u003c/td\u003e\n    \u003ctd align=\"left\"\u003eDuration of a segment\u003c/td\u003e\n    \u003ctd\u003e1.0 (0.1 - n.n)\u003c/td\u003e\n    \u003ctd\u003efloat\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-sk\u003c/td\u003e\n    \u003ctd\u003e--skip\u003c/td\u003e\n    \u003ctd align=\"left\"\u003eSkips the first n seconds of a video, mainly used to skip intros and filler. For movies, set this value higher according to the intro duration\u003c/td\u003e\n    \u003ctd\u003e20\u003c/td\u003e\n    \u003ctd\u003efloat\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-sp\u003c/td\u003e\n    \u003ctd\u003e--samepath\u003c/td\u003e\n    \u003ctd align=\"left\"\u003eWhen passing this argument, the output folder is set to the input folder. when using this the --out path should be relative\u003c/td\u003e\n    \u003cth colspan=\"2\"\u003epresent or not\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-a\u003c/td\u003e\n    \u003ctd\u003e--audio\u003c/td\u003e\n    \u003ctd align=\"left\"\u003ePreviews will be generated with audio\u003c/td\u003e\n    \u003cth colspan=\"2\"\u003epresent or not\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-g\u003c/td\u003e\n    \u003ctd\u003e--gif\u003c/td\u003e\n    \u003ctd align=\"left\"\u003ePreviews will be generated in the GIF format (takes more time \u0026 space)\u003c/td\u003e\n    \u003cth colspan=\"2\"\u003epresent or not\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-f\u003c/td\u003e\n    \u003ctd\u003e--fps\u003c/td\u003e\n    \u003ctd align=\"left\"\u003ePreview video FPS\u003c/td\u003e\n    \u003ctd\u003emp4:24/gif:10\u003c/td\u003e\n    \u003ctd\u003eint\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-q\u003c/td\u003e\n    \u003ctd\u003e--quality\u003c/td\u003e\n    \u003ctd align=\"left\"\u003ePreview video quality (low, normal, high)\u003c/td\u003e\n    \u003ctd\u003enormal\u003c/td\u003e\n    \u003ctd\u003estring\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-c\u003c/td\u003e\n    \u003ctd\u003e--compression\u003c/td\u003e\n    \u003ctd align=\"left\"\u003ePreview video compression modes:\u003cbr\u003e\u003cb\u003efast\u003c/b\u003e but low quality output and bigger file size.\u003cbr\u003e\u003cb\u003eslow\u003c/b\u003e gives good quality and reasonable size but little slower.\u003cbr\u003e\u003cb\u003everyslow\u003c/b\u003e gives best quality and least file size but its very slow.\u003c/td\u003e\n    \u003ctd\u003eslow\u003c/td\u003e\n    \u003ctd\u003estring\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-cli\u003c/td\u003e\n    \u003ctd\u003e--cli\u003c/td\u003e\n    \u003ctd align=\"left\"\u003eRun as a CLI without changing default arguments. If no arguments are provided, the program will act in prompt mode. To prevent that, you can use this flag\u003c/td\u003e\n    \u003cth colspan=\"2\"\u003epresent or not\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-cuda\u003c/td\u003e\n    \u003ctd\u003e--cuda\u003c/td\u003e\n    \u003ctd align=\"left\"\u003eUses cuda cores for fast processing (Nvidia GPUs only)\u003c/td\u003e\n    \u003cth colspan=\"2\"\u003epresent or not\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-v\u003c/td\u003e\n    \u003ctd\u003e--version\u003c/td\u003e\n    \u003ctd align=\"left\"\u003ePrints version info\u003c/td\u003e\n    \u003cth colspan=\"2\"\u003epresent or not\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd\u003e-h\u003c/td\u003e\n    \u003ctd\u003e--help\u003c/td\u003e\n    \u003ctd align=\"left\"\u003eLists all commands with its description\u003c/td\u003e\n    \u003cth colspan=\"2\"\u003epresent or not\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nIf you want to run this as a CLI without providing or changing default arguments then just run\n\n```sh\npreview -cli\n```\n\n\u003c/br\u003e\n\n## FAQ\n\n### 1. What are segments `-s`, `--segments`?\n\nSegments are small videos extracted from the input video with a duration specified by `--sduration`. For example, if you set `--segments` to **10** and `--sduration` to **2**, each segment will be **2** seconds long. Therefore, the total duration of the preview will be **20** seconds, as **10** segments each contribute **2** seconds.\n\n### 2. From which part of the video are the segments extracted?\n\nLet's say you set `--segments` to **3** and `--sduration` to **5**. In this scenario, the input video is evenly split into **3** parts, and the first **5** seconds from each part are extracted for previews. Subsequently, these segments are concatenated and converted into a single video or gif. Thus the resulting preview will be of **5x3 = 15 seconds**.\n\nThe red parts are extracted for previews\n\n![segments](https://raw.githubusercontent.com/Tetrax-10/batch-preview-generator/main/assets/segments.png)\n\n\u003c/br\u003e\n\n## Development\n\n##### Environment setup\n\n```sh\ngit clone https://github.com/Tetrax-10/batch-preview-generator.git\ncd batch-preview-generator\npip install -r requirements.txt\n```\n\n##### Run\n\n```sh\npython preview.py \u003cargs\u003e\n```\n\n##### Build executable\n\n```sh\npyinstaller preview.spec\n```\n\nMake sure to add your \"dist\" folder to the PATH so that when you run preview, it refers to your \"dist\" executable. Additionally, also ensure that the path of the installed \"preview.exe\" is removed during development.\n\nThe installer is compiled with the [Inno Setup Compiler](https://jrsoftware.org/isdl.php), and there's no need to perform this step during the development of Batch Preview Generator, as it is only used for distribution\n\n\u003c/br\u003e\n\n### Known bugs\n\n1. When this program is installed and uninstalled it leaves this string \";;\" in PATH environmental variable, it's not an issue as it doesn't affect the env vars but its a bloat, So please help me fix this as I'm not good with Inno Setup Compiler\n\n\u003c/br\u003e\n\n### Assist required\n\n1. Help me implement H/W acceleration for Radeon graphics as I don't have an AMD gpu.\n2. Help me to build/test executable for `linux` and `mac os`.\n3. Help me fix the `known bugs`.\n\n\u003c/br\u003e\n\n### Support\n\nLike This Tool? Gimme Some ❤️ by Liking this Repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetrax-10%2Fbatch-preview-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetrax-10%2Fbatch-preview-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetrax-10%2Fbatch-preview-generator/lists"}