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: README.md
+24-8Lines changed: 24 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ It will return to you a URL to the transcoded video if it already exists, or if
66
66
In the array you pass in, the default values are used if the key/value pair does not exist:
67
67
68
68
{
69
-
"videoFormat" => "mp4",
69
+
"videoEncoder" => "h264",
70
70
"videoBitRate" => "800k",
71
71
"videoFrameRate" => 15,
72
72
"aspectRatio" => "letterbox",
@@ -102,7 +102,7 @@ You can control the color of the letterboxed area (it's `black` by default) via
102
102
103
103
The `sharpen` option determines whether an unsharp mask filter should be applied to the scaled video.
104
104
105
-
The file format setting `videoFormat` is preset to what you'll need to generate `mp4` videos, but it can also generate `webm` videos, or any other format that `ffmpeg` supports. See the `config.php` file for details
105
+
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
106
106
107
107
### Generating a Transcoded Audio File
108
108
@@ -128,7 +128,7 @@ It will return to you a URL to the transcoded audio file if it already exists, o
128
128
In the array you pass in, the default values are used if the key/value pair does not exist:
129
129
130
130
{
131
-
"audioFormat" => "mp3",
131
+
"audioEncoder" => "mp3",
132
132
"audioBitRate" => "128k",
133
133
"audioSampleRate" => "44100",
134
134
"audioChannels" => "2",
@@ -146,7 +146,7 @@ If you want to have the Transcoder not change a parameter, pass in an empty valu
146
146
147
147
The above example would cause it to not change the audio of the source audio file at all (not recommended for client-proofing purposes).
148
148
149
-
The file format setting `audioFormat` is preset to what you'll need to generate `mp3` audio files, but it can also generate `m4a`, `ogg`, or any other format that `ffmpeg` supports. See the `config.php` file for details
149
+
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
150
150
151
151
### Getting Transcoding Progress
152
152
@@ -242,14 +242,31 @@ The `sharpen` option determines whether an unsharp mask filter should be applied
242
242
243
243
To get information about an existing video/audio file, you can use `craft.transcoder.getFileInfo()`:
244
244
245
-
{% set fileInfo = craft.transcoder.getFileInfo('/home/vagrant/sites/nystudio107/public/oceans.mp4') %}
245
+
{% set fileInfo = craft.transcoder.getFileInfo('/home/vagrant/sites/nystudio107/public/oceans.mp4', true) %}
246
246
247
247
You can also pass in an `Asset`:
248
248
249
249
{% set myAsset = entry.someAsset.first() %}
250
-
{% set fileInfo = craft.transcoder.getFileInfo(myAsset) %}
250
+
{% set fileInfo = craft.transcoder.getFileInfo(myAsset, true) %}
251
251
252
-
This returns an array with two top-level keys:
252
+
By passing in `true` as the second argument, we get just a summary of the video/audio file information in an array:
If you instead pass in `false` as the second parameter (or omit it), then `craft.transcoder.getFileInfo()` returns the full video/audio file info an array with two top-level keys:
253
270
254
271
*`format` - information about the container file format
255
272
*`streams` - information about each stream in the container; many videos have multiple streams, for instance, one for the video streams, and another for the audio stream. There can even be multiple video or audio streams in a container.
@@ -387,7 +404,6 @@ The file must reside in the webroot (thus a URL or URI must be passed in as a pa
387
404
388
405
Some things to do, and ideas for potential features:
389
406
390
-
* Add a simpler way to extract the most common video/audio info from a file
391
407
* Add a console command for doing encodings via console
392
408
* Figure out a way to reliably do multi-pass video encoding
393
409
* Add audio normalization via `loudnorm`http://k.ylo.ph/2016/04/04/loudnorm.html
0 commit comments