{"id":17163000,"url":"https://github.com/amnuts/jwplayer-thumbnail-preview-generator","last_synced_at":"2025-04-13T13:22:43.645Z","repository":{"id":22053126,"uuid":"25381900","full_name":"amnuts/jwplayer-thumbnail-preview-generator","owner":"amnuts","description":"A simple but effective command-line tool for generating thumbnails of a video, and corresponding VTT file, for use within JW Player to allow for toolbar video preview.","archived":false,"fork":false,"pushed_at":"2021-10-09T14:14:39.000Z","size":10,"stargazers_count":55,"open_issues_count":0,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-27T04:22:41.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amnuts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"amnuts"}},"created_at":"2014-10-18T00:02:13.000Z","updated_at":"2025-02-11T21:31:24.000Z","dependencies_parsed_at":"2022-08-18T23:40:09.419Z","dependency_job_id":null,"html_url":"https://github.com/amnuts/jwplayer-thumbnail-preview-generator","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amnuts%2Fjwplayer-thumbnail-preview-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amnuts%2Fjwplayer-thumbnail-preview-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amnuts%2Fjwplayer-thumbnail-preview-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amnuts%2Fjwplayer-thumbnail-preview-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amnuts","download_url":"https://codeload.github.com/amnuts/jwplayer-thumbnail-preview-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248718113,"owners_count":21150509,"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-10-14T22:47:30.150Z","updated_at":"2025-04-13T13:22:43.621Z","avatar_url":"https://github.com/amnuts.png","language":"PHP","funding_links":["https://github.com/sponsors/amnuts"],"categories":[],"sub_categories":[],"readme":"# JWPlayer thumbnail preview generator\n\nA simple but effective command-line tool for generating thumbnails of a video and corresponding VTT file for use within JW Player to generate the toolbar thumbnail previews.\n\n[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=acollington\u0026url=https://github.com/amnuts/jwplayer-thumbnail-preview-generator\u0026title=JWPlayer%20thumbnail%20preview%20generator\u0026language=\u0026tags=github\u0026category=software)\n\n### Requirements\n\nFFmpeg is required to generate the thumbnails.  If you have libav-tools install and the binary is a different name to ffmpeg (or even if you have ffmpeg but installed in a different location) then you can modify the `$params` information to point to your particular ffmpeg install.\n\nPHP 5.4+ is required as the code uses short array syntax and the CallbackFilterIterator.\n\n### Getting started\n\nThere are two ways to getting started using this script:\n\n1. Simply to copy/paste or download the thumbnails.php to your server\n2. Install via composer by running the command:\n```bash\ncomposer require amnuts/jwplayer-thumbnail-preview-generator\n```\n\n### How to use the generator\n\n#### Simplest example\n\nTypical usage would look like:\n\n```bash\nphp thumbnails.php -i \"/input/video.mp4\"\n```\n\nThis would generate the thumbnails for the video given coalesced into one file (a sprite sheet) and the required VTT file that specifies which thumbnail to display and where in the sprite sheet it is located.\n\n#### Verbose output\n\nIf you do not wish to generate a sprite sheet then include the `-v` switch to generate verbose output - ie, all the thumbnails are separate files and the VTT file points to each.\n\n```bash\nphp thumbnails.php -i \"/input/video.mp4\" -v\n```\n\nIt is recommended that you use the default coalesced file as this is more optimal when loading than individual images.\n\n#### Changing output directory\n\nYou can change the output directory with the `-o` switch:\n\n```bash\nphp thumbnails.php -i \"/input/video.mp4\" -o \"/output/directory\"\n```\n\nThis will write the images and VTT file in the provided directory (default is just to write into the same directory as the generator script).\n\n#### Change time between thumbnails\n\nTo alter the default time between thumbnails use the `-t` switch with the number of seconds you'd like between each:\n\n```bash\nphp thumbnails.php -i \"/input/video.mp4\" -t 30\n```\n\nThat will generate one thumbnail for every 30 seconds of video.\n\n#### Change thumbnail width\n\nTo change the width of the thumbnail use the `-w` switch with the size in pixels:\n\n```bash\nphp thumbnails.php -i \"/input/video.mp4\" -w 75\n```\n\nThat will generate thumbnails that are 75 pixels in width.  The height is automatic and proportional to the video size.\n\n#### Generate poster image\n\nThe tool also provides the ability to generate a poster file of the video from a random frame of the video at the same time it's generating the thumbnails.  To do this, use the `-p` switch:\n\n```bash\nphp thumbnails.php -i \"/input/video.mp4\" -p\n```\n\n### How to include in JW Player\n\nThe code you would use for JW Player would be something like:\n\n```html\n\u003cdiv id=\"video\"\u003evideo loading...\u003c/div\u003e\n\u003cscript\u003e\n    jwplayer(\"video\").setup({\n        playlist: [{\n            file: \"/input/video.mp4\",\n            image: \"poster.jpg\",\n            tracks: [{\n                file: \"thumbnails.vtt\",\n                kind: \"thumbnails\"\n            }]\n        }]\n    });\n\u003c/script\u003e\n```\n\n# License\n\nMIT: http://acollington.mit-license.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famnuts%2Fjwplayer-thumbnail-preview-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famnuts%2Fjwplayer-thumbnail-preview-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famnuts%2Fjwplayer-thumbnail-preview-generator/lists"}