Skip to content

Commit 0c7460a

Browse files
committed
Merge branch 'release/1.2.0' into v1
2 parents 1e580dc + 2d36303 commit 0c7460a

File tree

67 files changed

+9569
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+9569
-256
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Transcoder Changelog
22

3+
## 1.2.0 - 2018.08.22
4+
### Added
5+
* Added the ability to encode to animated `.gif` files
6+
* Added multiple output paths and URLs for different media types
7+
8+
### Changed
9+
* Moved to a modern webpack build config for the AdminCP
10+
* Added install confetti
11+
312
## 1.1.3 - 2018.03.02
413
### Changed
514
* Fixed deprecation errors from Craft CMS 3 RC13

README.md

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Transcode video & audio files to various formats, and provide video thumbnails
88

99
Related: [Transcoder for Craft 2.x](https://github.com/nystudio107/transcoder)
1010

11-
**Note**: _This plugin will cost $59.00 once Craft 3 GA is released._
11+
**Note**: _This plugin costs $59.00 and is available in the Craft CMS 3 plugin store._
1212

1313
## Requirements
1414

15-
This plugin requires Craft CMS 3.0.0-RC1 or later.
15+
This plugin requires Craft CMS 3.0.0 or later.
1616

1717
## Installation
1818

@@ -36,7 +36,7 @@ If you have managed hosting, contact your sysadmin to get `ffmpeg` installed.
3636

3737
## Transcoder Overview
3838

39-
The Transcoder plugin allows you to take any video (local or remote), and transcode it into any size, bitrate, framerate, and save it out as a web-ready video in a variety of file formats.
39+
The Transcoder plugin allows you to transcode any video or animated gif (local or remote) to any size, bitrate, framerate, and save it out as a web-ready video in a variety of file formats.
4040

4141
It can also transcode audio files to any bitrate & sample rate, to a variety of file formats. It can even extract audio tracks from video files.
4242

@@ -181,6 +181,83 @@ The above example would cause it to not change the audio of the source audio fil
181181

182182
The file format setting `audioEncoder` is preset to what you'll need to generate `mp3` audio files, but it can also generate `aac`, `ogg`, or any other format that `ffmpeg` supports. See the `config.php` file for details
183183

184+
### Generating a Transcoded Video
185+
186+
To generate a transcoded video, do the following:
187+
188+
{% set transVideoUrl = craft.transcoder.getVideoUrl('/home/vagrant/sites/nystudio107/public/oceans.mp4', {
189+
"videoFrameRate": 20,
190+
"videoBitRate": "500k",
191+
"width": 720,
192+
"height": 480
193+
}) %}
194+
195+
You can also pass in an URL:
196+
197+
{% set transVideoUrl = craft.transcoder.getVideoUrl('http://vjs.zencdn.net/v/oceans.mp4', {
198+
"videoFrameRate": 20,
199+
"videoBitRate": "500k",
200+
"width": 720,
201+
"height": 480
202+
}) %}
203+
204+
You can also pass in an `Asset`:
205+
206+
{% set myAsset = entry.someAsset.first() %}
207+
{% set transVideoUrl = craft.transcoder.getVideoUrl(myAsset, {
208+
"videoFrameRate": 20,
209+
"videoBitRate": "500k",
210+
"width": 720,
211+
"height": 480
212+
}) %}
213+
214+
It 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).
215+
216+
In the array you pass in, the default values are used if the key/value pair does not exist:
217+
218+
{
219+
"videoEncoder" => "h264",
220+
"videoBitRate" => "800k",
221+
"videoFrameRate" => 15,
222+
"aspectRatio" => "letterbox",
223+
"sharpen" => true,
224+
}
225+
226+
These default values come from the `config.php` file.
227+
228+
If you want to have the Transcoder not change a parameter, pass in an empty value in the key/value pair, e.g.:
229+
230+
{% set transVideoUrl = craft.transcoder.getVideoUrl('/home/vagrant/sites/nystudio107/public/oceans.mp4', {
231+
"frameRate": "",
232+
"bitRate": ""
233+
}) %}
234+
235+
The above example would cause it to not change the frameRate or bitRate of the source video (not recommended for client-proofing purposes).
236+
237+
The `aspectRatio` parameter lets you control how the video aspect ratio is maintained when it is scaled:
238+
239+
`none` results in the aspect ratio of the original video not being maintained, and the video scaled to the dimensions passed in:
240+
241+
![Screenshot](resources/screenshots/oceans_20s_300w_200h_none.jpg)
242+
243+
`crop` scales the video up to maintain the original aspect ratio, and then crops it so that it's full-frame:
244+
245+
![Screenshot](resources/screenshots/oceans_20s_300w_200h_crop.jpg)
246+
247+
`letterbox` scales the video to fit the new frame, putting a letterboxed or pillarboxed border to pad it:
248+
249+
![Screenshot](resources/screenshots/oceans_20s_300w_200h_letterbox.jpg)
250+
251+
You can control the color of the letterboxed area (it's `black` by default) via the `letterboxColor` option. It can be either a semantic color name, or a hexcode color, e.g.: `0xC0C0C0`
252+
253+
The `sharpen` option determines whether an unsharp mask filter should be applied to the scaled video.
254+
255+
The file format setting `videoEncoder` is preset to what you'll need to generate `h264` videos, but it can also generate `webm` videos, or any other format that `ffmpeg` supports. See the `config.php` file for details
256+
257+
![Screenshot](resources/screenshots/admin-cp-video-thumbnails.png)
258+
259+
Transcoder will also automatically add video thumbnails in the AdminCP Asset index.
260+
184261
### Getting Transcoding Progress
185262

186263
Transcoding of video/audio files can take quite a bit of time, so Transcoder provides you with a way to get the status of any currently running transcoding operation via `craft.transcoder.getVideoProgressUrl()` or `craft.transcoder.getAudioProgressUrl()`. For example:

composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
"name": "nystudio107/craft-transcoder",
33
"description": "Transcode video & audio files to various formats, and provide video thumbnails",
44
"type": "craft-plugin",
5-
"version": "1.1.3",
5+
"version": "1.2.0",
66
"keywords": [
77
"craft",
88
"cms",
99
"craftcms",
1010
"craft-plugin",
11-
"transcoder"
11+
"transcoder",
12+
"transcode",
13+
"video",
14+
"audio",
15+
"gif",
16+
"convert",
17+
"format"
1218
],
1319
"support": {
1420
"docs": "https://github.com/nystudio107/craft-transcoder/blob/v1/README.md",
@@ -22,7 +28,7 @@
2228
}
2329
],
2430
"require": {
25-
"craftcms/cms": "^3.0.0-RC9",
31+
"craftcms/cms": "^3.0.0",
2632
"mikehaertl/php-shellcommand": "~1.2"
2733
},
2834
"autoload": {

package.json

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"name": "transcoder",
3+
"version": "1.0.0",
4+
"description": "Transcode video & audio files to various formats, and provide video thumbnails",
5+
"copyright": "nystudio107",
6+
"main": "index.js",
7+
"scripts": {
8+
"dev": "webpack --config webpack.dev.js --progress --hide-modules",
9+
"watch": "webpack --config webpack.dev.js --progress --watch --hide-modules",
10+
"build": "webpack --config webpack.prod.js"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/nystudio107/craft-transcoder.git"
15+
},
16+
"author": "andrew@nystudio107.com",
17+
"license": "proprietary",
18+
"bugs": {
19+
"url": "https://github.com/nystudio107/craft-transcoder/issues"
20+
},
21+
"homepage": "https://github.com/nystudio107/craft-transcoder",
22+
"paths": {
23+
"src": {
24+
"base": "./src/assetbundles/transcoder/src/",
25+
"js": "./src/assetbundles/transcoder/src/js/",
26+
"css": "./src/assetbundles/transcoder/src/css/"
27+
},
28+
"dist": {
29+
"base": "./src/assetbundles/transcoder/dist/",
30+
"public": "/cpresources/transcoder/",
31+
"clean": [
32+
"./js",
33+
"./css"
34+
]
35+
},
36+
"copyFiles": [
37+
],
38+
"manifest": {
39+
"basePath": "",
40+
"template": {
41+
"twigCss": "./src/templates/_src/include-css-module.twig",
42+
"twigModern": "./src/templates/_src/include-modern-module.twig",
43+
"twigLegacy": "./src/templates/_src/include-legacy-module.twig"
44+
},
45+
"filename": {
46+
"twigCss": "./src/templates/_includes/include-css-module.twig",
47+
"twigModern": "./src/templates/_includes/include-modern-module.twig",
48+
"twigLegacy": "./src/templates/_includes/include-legacy-module.twig"
49+
}
50+
},
51+
"templates": "./src/templates/"
52+
},
53+
"entries": {
54+
"transcoder": "Transcoder.js",
55+
"welcome": "Welcome.js"
56+
},
57+
"babelConfig": {
58+
"legacyBrowsers": [
59+
"> 1%",
60+
"last 2 versions",
61+
"Firefox ESR"
62+
],
63+
"modernBrowsers": [
64+
"last 2 Chrome versions",
65+
"not Chrome < 60",
66+
"last 2 Safari versions",
67+
"not Safari < 10.1",
68+
"last 2 iOS versions",
69+
"not iOS < 10.3",
70+
"last 2 Firefox versions",
71+
"not Firefox < 54",
72+
"last 2 Edge versions",
73+
"not Edge < 15"
74+
]
75+
},
76+
"purgeCss": {
77+
"paths": [
78+
"./src/templates/**/*.{twig,html}"
79+
],
80+
"whitelist": [
81+
"../css/components.pcss"
82+
],
83+
"whitelistPatterns": [],
84+
"extensions": [
85+
"html",
86+
"js",
87+
"twig",
88+
"vue"
89+
]
90+
},
91+
"urls": {},
92+
"vars": {
93+
"cssName": "transcoder.css",
94+
"jsName": "transcoder.js"
95+
},
96+
"devDependencies": {
97+
"autoprefixer": "^8.1.0",
98+
"babel-core": "^6.26.0",
99+
"babel-loader": "^7.1.4",
100+
"babel-plugin-syntax-dynamic-import": "^6.18.0",
101+
"babel-plugin-transform-runtime": "^6.23.0",
102+
"babel-polyfill": "^6.26.0",
103+
"babel-preset-env": "^1.7.0",
104+
"clean-webpack-plugin": "^0.1.19",
105+
"copy-webpack-plugin": "^4.5.1",
106+
"css-loader": "^0.28.10",
107+
"cssnano": "^3.10.0",
108+
"extract-text-webpack-plugin": "^4.0.0-beta.0",
109+
"file-loader": "^1.1.11",
110+
"git-rev-sync": "^1.10.0",
111+
"glob-all": "^3.1.0",
112+
"html-webpack-plugin": "^3.2.0",
113+
"ignore-loader": "^0.1.2",
114+
"mini-css-extract-plugin": "^0.4.0",
115+
"moment": "^2.21.0",
116+
"optimize-css-assets-webpack-plugin": "^4.0.3",
117+
"postcss": "^6.0.19",
118+
"postcss-extend": "^1.0.5",
119+
"postcss-hexrgba": "^1.0.0",
120+
"postcss-import": "^11.1.0",
121+
"postcss-loader": "^2.1.1",
122+
"postcss-nested": "^3.0.0",
123+
"postcss-nested-ancestors": "^1.0.0",
124+
"postcss-simple-vars": "^4.1.0",
125+
"purgecss-webpack-plugin": "^1.2.0",
126+
"purgecss-whitelister": "^2.1.0",
127+
"resolve-url-loader": "^2.3.0",
128+
"tailwindcss": "^0.6.4",
129+
"uglifyjs-webpack-plugin": "^1.2.7",
130+
"vue-loader": "^15.3.0",
131+
"vue-style-loader": "^4.1.2",
132+
"vue-template-compiler": "^2.5.17",
133+
"webpack": "^4.1.1",
134+
"webpack-bundle-analyzer": "^2.13.1",
135+
"webpack-cli": "^2.0.11",
136+
"webpack-manifest-plugin": "^2.0.3",
137+
"webpack-merge": "^4.1.2"
138+
},
139+
"dependencies": {
140+
"vue": "^2.5.17",
141+
"vue-confetti": "^0.4.1"
142+
}
143+
}

postcss.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
plugins: [
3+
require('postcss-import'),
4+
require('postcss-extend'),
5+
require('postcss-simple-vars'),
6+
require('postcss-nested-ancestors'),
7+
require('postcss-nested'),
8+
require('postcss-hexrgba'),
9+
require('autoprefixer'),
10+
require('tailwindcss')('./tailwind.config.js')
11+
]
12+
}
-150 KB
Loading
-1.13 KB
Loading
-945 Bytes
Loading
-1.21 KB
Loading
54.1 KB
Loading

0 commit comments

Comments
 (0)