You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/Using.md
-77Lines changed: 0 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,83 +131,6 @@ The above example would cause it to not change the audio of the source audio fil
131
131
132
132
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
133
133
134
-
## Generating a Transcoded Video
135
-
136
-
To generate a transcoded video, do the following:
137
-
138
-
{% set transVideoUrl = craft.transcoder.getVideoUrl('/home/vagrant/sites/nystudio107/public/oceans.mp4', {
139
-
"videoFrameRate": 20,
140
-
"videoBitRate": "500k",
141
-
"width": 720,
142
-
"height": 480
143
-
}) %}
144
-
145
-
You can also pass in an URL:
146
-
147
-
{% set transVideoUrl = craft.transcoder.getVideoUrl('http://vjs.zencdn.net/v/oceans.mp4', {
148
-
"videoFrameRate": 20,
149
-
"videoBitRate": "500k",
150
-
"width": 720,
151
-
"height": 480
152
-
}) %}
153
-
154
-
You can also pass in an `Asset`:
155
-
156
-
{% set myAsset = entry.someAsset.one() %}
157
-
{% set transVideoUrl = craft.transcoder.getVideoUrl(myAsset, {
158
-
"videoFrameRate": 20,
159
-
"videoBitRate": "500k",
160
-
"width": 720,
161
-
"height": 480
162
-
}) %}
163
-
164
-
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).
165
-
166
-
In the array you pass in, the default values are used if the key/value pair does not exist:
167
-
168
-
{
169
-
"videoEncoder" => "h264",
170
-
"videoBitRate" => "800k",
171
-
"videoFrameRate" => 15,
172
-
"aspectRatio" => "letterbox",
173
-
"sharpen" => true,
174
-
}
175
-
176
-
These default values come from the `config.php` file.
177
-
178
-
If you want to have the Transcoder not change a parameter, pass in an empty value in the key/value pair, e.g.:
179
-
180
-
{% set transVideoUrl = craft.transcoder.getVideoUrl('/home/vagrant/sites/nystudio107/public/oceans.mp4', {
181
-
"frameRate": "",
182
-
"bitRate": ""
183
-
}) %}
184
-
185
-
The above example would cause it to not change the frameRate or bitRate of the source video (not recommended for client-proofing purposes).
186
-
187
-
The `aspectRatio` parameter lets you control how the video aspect ratio is maintained when it is scaled:
188
-
189
-
`none` results in the aspect ratio of the original video not being maintained, and the video scaled to the dimensions passed in:
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`
202
-
203
-
The `sharpen` option determines whether an unsharp mask filter should be applied to the scaled video.
204
-
205
-
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
Transcoder will also automatically add video thumbnails in the Control Panel Asset index.
210
-
211
134
## Getting Transcoding Progress
212
135
213
136
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:
0 commit comments