{"id":22312307,"url":"https://github.com/sander1/video-preview-php","last_synced_at":"2026-05-18T19:43:52.139Z","repository":{"id":145609929,"uuid":"338086245","full_name":"sander1/video-preview-php","owner":"sander1","description":"Generate YouTube style video previews","archived":false,"fork":false,"pushed_at":"2021-03-18T19:18:15.000Z","size":516,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T02:39:29.836Z","etag":null,"topics":["ffmpeg","ffprobe","thumbnail-generator","video","video-preview"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/sander1.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-11T16:35:42.000Z","updated_at":"2022-10-21T10:01:25.000Z","dependencies_parsed_at":"2023-07-08T18:31:44.787Z","dependency_job_id":null,"html_url":"https://github.com/sander1/video-preview-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sander1/video-preview-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sander1%2Fvideo-preview-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sander1%2Fvideo-preview-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sander1%2Fvideo-preview-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sander1%2Fvideo-preview-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sander1","download_url":"https://codeload.github.com/sander1/video-preview-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sander1%2Fvideo-preview-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270946068,"owners_count":24672890,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ffmpeg","ffprobe","thumbnail-generator","video","video-preview"],"created_at":"2024-12-03T21:42:28.835Z","updated_at":"2026-05-18T19:43:47.099Z","avatar_url":"https://github.com/sander1.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this?\nThis is a script written in PHP to create small video previews like the ones you see on YouTube. It makes use of [ffmpeg](https://ffmpeg.org/) and [ffprobe](https://ffmpeg.org/ffprobe.html).\n\n## Why PHP, why not bash or something else?\nBecause I'm a web guy and comfortable with PHP.\n\n# How do I use it?\nIn its simplest form you call the script and give it a file and (optionally) video dimensions for the output:\n```\nphp convert.php myVideo.mp4 400x300\n```\nThe result will be a small preview video: `myVideo-preview.mp4`\n\nUse quotes or escape spaces if your filename contains spaces:\n```\nphp convert.php \"my video.mp4\" 400x300\nphp convert.php my\\ video.mp4 400x300\n```\n## Some configuration\nSome tuning can be done with the settings at the top of the script:\n\n* `FFMPEG_PATH`: Path to the ffmpeg binary. If globally installed leave it at `ffmpeg`\n* `FFPROBE_PATH`: Path to the ffprobe binary. If globally installed leave it at `ffprobe`\n* `CHOP_SECONDS`: The number of seconds to skip at the beginning and end of a file, to skip titles, default `30`\n* `NUMBER_OF_PARTS`: The number of segments you want your preview to have, default `8`\n* `PART_DURATION`: The length of each segment in seconds, default `1.25`\n* `FPS`: Frames per second for the output file, default `25`\n\nThe reason why those values are not part of the command line input is because this script will most likely run as an automated task or cronjob and all the video previews need to be the same.\n\n# An example\nHere is an [example video preview](https://raw.githubusercontent.com/sander1/video-preview-php/preview/ElephantsDream-preview.mp4) of the [ElephantsDream movie](https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4).\n\n# Todo\n- [ ] Add check for minimum video length\n- [ ] Add option to set output folder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsander1%2Fvideo-preview-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsander1%2Fvideo-preview-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsander1%2Fvideo-preview-php/lists"}