{"id":21429340,"url":"https://github.com/nystudio107/transcoder","last_synced_at":"2025-07-14T10:32:57.038Z","repository":{"id":57029566,"uuid":"68052251","full_name":"nystudio107/transcoder","owner":"nystudio107","description":"DEPRECATED Transcode videos to various formats, and provide thumbnails of the video","archived":false,"fork":false,"pushed_at":"2019-01-01T23:40:49.000Z","size":14,"stargazers_count":25,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-07-08T00:01:34.934Z","etag":null,"topics":["craft-plugin","craftcms","ffmpeg","transcoder"],"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/nystudio107.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-12T22:09:13.000Z","updated_at":"2023-12-13T00:18:26.000Z","dependencies_parsed_at":"2022-08-23T18:50:22.989Z","dependency_job_id":null,"html_url":"https://github.com/nystudio107/transcoder","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nystudio107%2Ftranscoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nystudio107%2Ftranscoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nystudio107%2Ftranscoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nystudio107%2Ftranscoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nystudio107","download_url":"https://codeload.github.com/nystudio107/transcoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225970889,"owners_count":17553411,"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":["craft-plugin","craftcms","ffmpeg","transcoder"],"created_at":"2024-11-22T22:17:16.388Z","updated_at":"2024-11-22T22:17:17.020Z","avatar_url":"https://github.com/nystudio107.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n# DEPRECATED\n\nThis Craft CMS 2.x plugin is no longer supported, but it is fully functional, and you may continue to use it as you see fit. The license also allows you to fork it and make changes as needed for legacy support reasons.\n\nThe Craft CMS 3.x version of this plugin can be found here: [craft-transcoder](https://github.com/nystudio107/craft-transcoder) and can also be installed via the Craft Plugin Store in the Craft CP.\n\n# Transcoder plugin for Craft CMS\n\nTranscode videos to various formats, and provide thumbnails of the video\n\nRelated: [Transcoder for Craft 3.x](https://github.com/nystudio107/craft3-transcoder)\n\n## Installation\n\nTo install Transcoder, follow these steps:\n\n1. Download \u0026 unzip the file and place the `transcoder` directory into your `craft/plugins` directory\n2.  -OR- do a `git clone https://github.com/nystudio107/transcoder.git` directly into your `craft/plugins` folder.  You can then update it with `git pull`\n3.  -OR- install with Composer via `composer require nystudio107/transcoder`\n4. Install plugin in the Craft Control Panel under Settings \u003e Plugins\n5. The plugin folder should be named `transcoder` for Craft to see it.  GitHub recently started appending `-master` (the branch name) to the name of the folder for zip file downloads.\n\nTranscoder works on Craft 2.4.x, Craft 2.5.x and Craft 2.6.x.  `ffmpeg` **must** be installed for it to function.\n\n## Transcoder Overview\n\nThe Transcoder video allows you to take any locally stored video, and transcode it into any bitrate/framerate, and save it out as a web-ready `.mp4` file.\n\nIt also allows you to get a thumbnail of the video in any size and at any timecode.\n\nFinally, it lets you download an arbitrary file (such as the transcoded video) via a special download link.\n\nIf the source file has changed since the last time the video was encoded, it will re-encode the video and replace it.\n\n## Configuring Transcoder\n\nThe only configuration for Transcoder is in the `config.php` file, which is a multi-environment friendly way to store the default settings.  Don't edit this file, instead copy it to `craft/config` as `transcoder.php` and make your changes there.  Here's the default `config.php` file:\n\n    \u003c?php\n    /**\n     * Transcoder Configuration\n     *\n     * Completely optional configuration settings for Transcoder if you want to customize some\n     * of its more esoteric behavior, or just want specific control over things.\n     *\n     * Don't edit this file, instead copy it to 'craft/config' as 'transcoder.php' and make\n     * your changes there.\n     */\n\n    return array(\n\n    /**\n     * The path to the ffmpeg binary\n     */\n        \"ffmpegPath\" =\u003e \"/usr/bin/ffmpeg\",\n\n    /**\n     * The path where the transcoded videos are stored\n     */\n\n        \"transcoderPath\" =\u003e $_SERVER['DOCUMENT_ROOT'] . \"/transcoder/\",\n\n    /**\n     * The URL where the transcoded videos are stored\n     */\n\n        \"transcoderUrl\" =\u003e \"/transcoder/\",\n    );\n\n## Using Transcoder\n\n### Generating a Transcoded Video\n\nTo generate a transcoded video, do the following:\n\n    {% set transVideoUrl = craft.transcoder.getVideoUrl('/home/vagrant/sites/nystudio107/public/trimurti.mp4', {\n        \"frameRate\": 20,\n        \"bitRate\": \"500k\"\n    }) %}\n\nYou can also pass in an `AssetFileModel`:\n\n    {% set myAsset = entry.someAsset.first() %}\n    {% set transVideoUrl = craft.transcoder.getVideoUrl(myAsset, {\n        \"frameRate\": 20,\n        \"bitRate\": \"500k\"\n    }) %}\n\nIt will return to you a URL to the transcoded video if it already exists, or if it doesn't exist, it will return `\"\"` and kick off the transcoding process (which can be quite lengthy for long videos).\n\nIn the array you pass in, the default values are used if the key/value pair does not exist:\n\n    {\n        \"bitRate\" =\u003e \"800k\",\n        \"frameRate\" =\u003e 15,\n    }\n\nIf you want to have the Transcoder not change a parameter, pass in an empty value in the key/value pair, e.g.:\n\n    {% set transVideoUrl = craft.transcoder.getVideoUrl('/home/vagrant/sites/nystudio107/public/trimurti.mp4', {\n        \"frameRate\": \"\",\n        \"bitRate\": \"\"\n    }) %}\n\nThe above example would cause it to not change the frameRate or bitRate of the source movie (not recommended for client-proofing purposes).\n\n### Generating a Video Thumbnail\n\nTo generate a thumbnail from a video, do the following:\n\n    {% set transVideoThumbUrl = craft.transcoder.getVideoThumbnailUrl('/home/vagrant/sites/nystudio107/public/trimurti.mp4', {\n        \"width\": 300,\n        \"height\": 200,\n        \"timeInSecs\": 20,\n    }) %}\n\nIt will return to you a URL to the thumbnail of the video, in the size you specify, from the timecode `timeInSecs` in the video.  It creates this thumbnail immediately if it doesn't already exist.\n\nIn the array you pass in, the default values are used if the key/value pair does not exist:\n\n    {\n        \"width\" =\u003e 200,\n        \"height\" =\u003e 100,\n        \"timeInSecs\" =\u003e 10,\n    }\n\nIf you want to have the Transcoder not change a parameter, pass in an empty value in the key/value pair, e.g.:\n\n    {% set transVideoThumbUrl = craft.transcoder.getVideoThumbnailUrl('/home/vagrant/sites/nystudio107/public/trimurti.mp4', {\n        \"width\": \"\",\n        \"height\": \"\",\n        \"timeInSecs\": 20,\n    }) %}\n\nThe above example would cause it to generate a thumbnail at whatever size the video is (not recommended for client-proofing purposes).\n\n### Generating a Download URL\n\nTo generate a download URL for a file, do the following:\n\n    {% set downloadUrl = craft.transcoder.getDownloadUrl('/some/url') %}\n\nWhen the user clicks on the URL, it will download the file to their local computer.  If the file doesn't exist, `\"\"` is returned.\n\nThe file must reside in the webroot (thus a URL or URI must be passed in as a parameter, not a path), for security reasons.\n\n## Transcoder Roadmap\n\nSome things to do, and ideas for potential features:\n\n* The videos could potentially be saved in different formats (though `.mp4` really is \"the\" standard for video)\n* The videos could potentially be resized, either to an aspect ratio or an absolute size or what have you\n* Accessors could be written to get information about a video (height, width, duration, and so on)\n\nBrought to you by [nystudio107](https://nystudio107.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnystudio107%2Ftranscoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnystudio107%2Ftranscoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnystudio107%2Ftranscoder/lists"}