{"id":15062842,"url":"https://github.com/tpkn/video-preview","last_synced_at":"2025-06-29T17:03:34.488Z","repository":{"id":57392189,"uuid":"204194546","full_name":"tpkn/video-preview","owner":"tpkn","description":"Make sprite sheets or gif previews of your videos using Node.js","archived":false,"fork":false,"pushed_at":"2019-09-04T20:58:56.000Z","size":25,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T17:02:54.910Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/tpkn.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":"2019-08-24T18:08:03.000Z","updated_at":"2024-08-01T07:07:34.000Z","dependencies_parsed_at":"2022-09-26T17:00:25.582Z","dependency_job_id":null,"html_url":"https://github.com/tpkn/video-preview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tpkn/video-preview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fvideo-preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fvideo-preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fvideo-preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fvideo-preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpkn","download_url":"https://codeload.github.com/tpkn/video-preview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fvideo-preview/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262632296,"owners_count":23340211,"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":[],"created_at":"2024-09-24T23:47:27.132Z","updated_at":"2025-06-29T17:03:34.389Z","avatar_url":"https://github.com/tpkn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Video Preview [![npm Package](https://img.shields.io/npm/v/video-previews.svg)](https://www.npmjs.org/package/video-previews)\nMake sprite sheets or gif previews of your videos using Node.js\n\n\n![preview](https://raw.githubusercontent.com/tpkn/video-preview/master/preview.jpg)\n\n\nThe module creates two types of previews:\n - Horizontal or vertical sprite sheet for css `animation-timing-function: steps(10, end)`\n - Animated gif image\n\n\n## API\n\n```javascript\nawait VideoPreview(input_file, output_file, total_frames[, options])\n```\n\n### input_file\n**Type**: _String_  \nFull path to source video file.\n\n\n### output_file\n**Type**: _String_  \nFull path to preview file. Pay special attention to the file extension, it is here that the type of preview to be made is determined! \n\n\n### total_frames\n**Type**: _Number_  \nThe amount of frames in a preview file. If `= 1`, then would be taken frame from `duration / 2` position\n\n\n### options.temp_dir\n**Type**: _String_  \n**Default**: `{INPUT FILE PATH}/temp_{UNIQ ID}/`  \nTemporary folder for storing video frames\n\n\n\n### options.video_length   \n**Type**: _Number_  \n**Default**: `true`  \nIf not set, then `video-length` module would be used to get actual video length. `video-length` module requires [MediaInfo](https://mediaarea.net/en/MediaInfo) binary!\n\n\n\n### options.frames_format   \n**Type**: _String_  \n**Default**: `jpg`  \n`png` gives maximum quality, but `jpg` is faster\n\n\n\n### options.width   \n**Type**: _Number_ | _String_   \nOutput image width. Read [this article](https://trac.ffmpeg.org/wiki/Scaling) for more info\n\n\n\n### options.height   \n**Type**: _Number_ | _String_   \nOutput image height. Read [this article](https://trac.ffmpeg.org/wiki/Scaling) for more info\n\n\n\n\n### options.quality   \n**Type**: _Number_  \n**Default**: `75`  \nFor now it works only for gif output format\n\n\n\n\n### options.direction   \n**Type**: _String_  \n**Default**: `v`  \nFrames direction for `jpg` or `png` sprite sheets   \n\n| Key | Value |\n| ------ | ------ |\n| v | vertical direction |\n| h | horizontal direction |\n\n\n\n### options.fps   \n**Type**: _Number_  \n**Default**: `1`  \nGif frame rate\n\n\n### options.loop   \n**Type**: _Boolean_  \n**Default**: `true`  \nLoop gif\n\n\n\n\n### options.ffmpeg_bin   \n**Type**: _String_  \n**Default**: `ffmpeg`  \n[FFmpeg binary](https://ffmpeg.org/download.html)\n\n\n\n### options.mediainfo_bin   \n**Type**: _String_  \n**Default**: `MediaInfo`  \n[MediaInfo binary](https://mediaarea.net/en/MediaInfo)\n\n\n\n### options.convert_bin   \n**Type**: _String_  \n**Default**: `convert`  \n[Convert binary](https://ffmpeg.org/download.html)\n\n\n\n### options.gifski_bin   \n**Type**: _String_  \n**Default**: `gifski`  \n[Gifski binary](https://gif.ski/)\n\n\n\n\n### options.cleanup   \n**Type**: _Boolean_  \n**Default**: `false`  \nRemove extracted frames from `temp_dir` at the end\n\n\n### options.silent   \n**Type**: _Boolean_  \n**Default**: `true`  \nEnables logging `stdout` / `stderr` data  \n\n\n\n\n### @output\n**Type**: _Object_  \n```javascript\n{\n   file: 'z:/preview.gif'\n}\n```\n\n\n## Usage   \n```javascript\nconst VideoPreview = require('video-preview');\n\nlet frames = 10;\nlet input_file = './videos/MONICA BELLUCCI in the Matrix Sequels (HD Movie Scenes).mp4';\nlet output_file = './videos/preview.gif';\n\nVideoPreview(input_file, output_file, frames, { \n\n   width: 320,\n   quality: 50,\n   fps: 1,\n   \n   cleanup: true,\n\n}).then(result =\u003e {\n   console.log(result);\n}).catch(err =\u003e {\n   console.log(err);\n})\n```\n\n## PS\n - Demo video: (c) copyright 2008, Blender Foundation / www.bigbuckbunny.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fvideo-preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpkn%2Fvideo-preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fvideo-preview/lists"}