{"id":20672798,"url":"https://github.com/selective-php/video-type","last_synced_at":"2025-04-19T19:11:20.892Z","repository":{"id":35055059,"uuid":"200734252","full_name":"selective-php/video-type","owner":"selective-php","description":"Video type detection","archived":false,"fork":false,"pushed_at":"2023-09-08T01:41:38.000Z","size":1604,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-06T01:42:15.154Z","etag":null,"topics":["forensic","php","video","video-formats"],"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/selective-php.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-05T21:55:53.000Z","updated_at":"2022-02-18T00:11:09.000Z","dependencies_parsed_at":"2022-08-08T04:15:30.608Z","dependency_job_id":null,"html_url":"https://github.com/selective-php/video-type","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selective-php%2Fvideo-type","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selective-php%2Fvideo-type/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selective-php%2Fvideo-type/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selective-php%2Fvideo-type/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selective-php","download_url":"https://codeload.github.com/selective-php/video-type/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224970156,"owners_count":17400294,"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":["forensic","php","video","video-formats"],"created_at":"2024-11-16T20:38:50.652Z","updated_at":"2024-11-16T20:38:51.208Z","avatar_url":"https://github.com/selective-php.png","language":"PHP","readme":"# selective/video-type\n\nVideo type detection library for PHP.\n\n[![Latest Version on Packagist](https://img.shields.io/github/release/selective-php/video-type.svg?style=flat-square)](https://packagist.org/packages/selective/video-type)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![build](https://github.com/selective-php/video-type/workflows/build/badge.svg)](https://github.com/selective-php/video-type/actions)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/selective-php/video-type.svg?style=flat-square)](https://scrutinizer-ci.com/g/selective-php/video-type/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/quality/g/selective-php/video-type.svg?style=flat-square)](https://scrutinizer-ci.com/g/selective-php/video-type/?branch=master)\n[![Total Downloads](https://img.shields.io/packagist/dt/selective/video-type.svg?style=flat-square)](https://packagist.org/packages/selective/video-type/stats)\n\n\n## Features\n\n* Detection of the video type based on its header\n* No dependencies\n* Very fast\n\n### Supported formats\n\n* **AVI** (Audio Video Interleave)\n* **MKV**\n* **MP4**\n* **MPEG-1** Part 2\n* **MPEG-2** Part 2\n* **OGG** OGV\n* **3G2** 3GPP2\n* **3GP** 3GPP\n* **WEBM**\n* **QuickTime**\n* **RealMedia**\n* **WMV** (Windows Media Video)\n* **FLV** (Adobe Flash Video)\n* **MXF** (Material Exchange Format)\n\n## Requirements\n\n* PHP 7.2+\n\n## Installation\n\n```\ncomposer require selective/video-type\n```\n\n## Usage\n\n### Detect the video type of file\n\n```php\nuse Selective\\VideoType\\VideoTypeDetector;\nuse Selective\\VideoType\\Provider\\DefaultVideoProvider;\nuse SplFileObject;\n\n$file = new SplFileObject('example.mp4');\n\n$detector = new VideoTypeDetector();\n\n// Add video detectors\n$detector-\u003eaddProvider(new DefaultVideoProvider());\n$videoType = $detector-\u003egetVideoTypeFromFile($file);\n\n// Get the video format\necho $videoType-\u003egetFormat(); // mp4\n\n// Get the mime type\necho $videoType-\u003egetMimeType(); // video/mp4\n```\n\n### Detect the video type of in-memory object\n\n```php\n$video = new SplTempFileObject();\n\n$video-\u003efwrite('my file content');\n\n$detector = new VideoTypeDetector();\n\n// Add video detectors\n$detector-\u003eaddProvider(new DefaultVideoProvider());\n\necho $detector-\u003egetVideoTypeFromFile($file)-\u003egetFormat();\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselective-php%2Fvideo-type","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselective-php%2Fvideo-type","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselective-php%2Fvideo-type/lists"}