{"id":30187029,"url":"https://github.com/takuya/php-ffmpeg-cmd-shortcuts","last_synced_at":"2025-08-12T15:24:41.316Z","repository":{"id":292644879,"uuid":"981506339","full_name":"takuya/php-ffmpeg-cmd-shortcuts","owner":"takuya","description":"ffmpeg command wrapper for php","archived":false,"fork":false,"pushed_at":"2025-08-12T02:19:23.000Z","size":210,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-12T04:25:55.689Z","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takuya.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,"zenodo":null}},"created_at":"2025-05-11T09:11:01.000Z","updated_at":"2025-08-12T02:19:26.000Z","dependencies_parsed_at":"2025-06-10T03:23:17.551Z","dependency_job_id":"52358f16-a999-41d9-8f31-68bd3c80c740","html_url":"https://github.com/takuya/php-ffmpeg-cmd-shortcuts","commit_stats":null,"previous_names":["takuya/php-ffmpeg-cmd-shortcuts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/takuya/php-ffmpeg-cmd-shortcuts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fphp-ffmpeg-cmd-shortcuts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fphp-ffmpeg-cmd-shortcuts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fphp-ffmpeg-cmd-shortcuts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fphp-ffmpeg-cmd-shortcuts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takuya","download_url":"https://codeload.github.com/takuya/php-ffmpeg-cmd-shortcuts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fphp-ffmpeg-cmd-shortcuts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270084611,"owners_count":24524215,"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-12T02:00:09.011Z","response_time":80,"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":[],"created_at":"2025-08-12T15:24:32.536Z","updated_at":"2025-08-12T15:24:41.290Z","avatar_url":"https://github.com/takuya.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ffmpeg in short hand.\n\nThis package is shortcut to ffmpeg movie convert.\n\n# Installation\nFrom GitHub\n```shell\nname='php-ffmpeg-cmd-shortcuts'\ncomposer config repositories.$name \\\nvcs https://github.com/takuya/$name  \ncomposer require takuya/$name\n```\n\n## Requirements.\nThese command are used.\n\n- ffmpeg \n- ffprobe\n- pv\n\n# Sample\n\n1. Convert mp4 to mkv\n2. Generate Image Thumbnail\n3. Concat movie \n4. Cut by time\n5. Resize  movie \n6. Movie info\n7. Compare encode quality\n8. Watching progress \n\n\n## Covert mp4 to mkv\n```php\n$ffmpeg = new FFMpegEncode('5sec.mp4', '5sec.mkv');\n$ffmpeg-\u003estart();\n```\n## Generate Thumbnail\n```php\n$thumbnailer = new FFMpegThumbnailer('a.mp4');\n$img = $thumbnailer-\u003egetImage();\n```\n## Concatenate Movies.\n```php\n$ffmpeg = new FFMpegConcat();\n$ffmpeg-\u003eaddSrcFile('a.mp4');\n$ffmpeg-\u003eaddSrcFile('b.mp4');\n$dst = $ffmpeg-\u003econcat(['c.mp4','d.mp4']);\n```\n\n## Cut by time.\n```php\n$duration = 20;\n$start = 60;\n$ffmpeg = new FFMpegSliceTime('in.mp4', 'out.mp4', $start, $duration);\n$ffmpeg-\u003estart();\n```\n## Resize movie \n```php\n$height = 320;//320p\n$ffmpeg = new FFMpegResizeMovie();\n$ffmpeg-\u003eresize($height,null,$src);\n$dst = $ffmpeg-\u003egetOutput();\n```\n## Retrieve info \n```php\n$path = 'sample.mp4';\n$ffprobe = new FFProbe();\n$ret = $ffprobe-\u003emovie_info($path);\n$streams = $ffprobe-\u003elist_streams($path)\n$codec = $ffprobe-\u003emovie_codec($path);\n```\n## Quality\n```php\n$ffmpeg = new FFMpeg_PSNR_SSSIM($src, $dst);\n$q = $ffmpeg-\u003egetQuality();\n$ssim = $q['ssim'];\n$psnr = $q['psnr'];\n```\n\n## watch encode progress\n\nffmpeg verbose output.\n```php\n$ffmpeg = new FFMpegEncode('in.mp4', 'out.mkv');\n$ffmpeg-\u003esetOnFFMpegProgress(fn ( $ffmpeg_stats ) =\u003edump($ffmpeg_stats));\n$ffmpeg-\u003estart();\n```\nshow read bytes by `pv` ( pipe viewer )\n```php\n$ffmpeg = new FFMpegEncode('in.mp4', 'out.mkv');\n$ffmpeg-\u003esetOnPvProgress(function ($pv_stats ) {\n  dump($pv_stats);\n});\n$ffmpeg-\u003esetOnFFMpegProgress(function ( $ffmpeg_stats )  {\n  dump($ffmpeg_stats);\n});\n$ffmpeg-\u003estart();\n\n```\nLimit Encode Transfer speed by `pv` ( pipe viewer )\n```php\n$ffmpeg = new FFMpegEncode('in.mp4', 'out.mkv');\n$ffmpeg-\u003esetPvOpts(['-L 2M']);\n$ffmpeg-\u003estart();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuya%2Fphp-ffmpeg-cmd-shortcuts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakuya%2Fphp-ffmpeg-cmd-shortcuts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuya%2Fphp-ffmpeg-cmd-shortcuts/lists"}