|
5 | 5 |
|
6 | 6 | * On-the-fly repackaging of MP4 files to DASH, HDS, HLS, MSS
|
7 | 7 |
|
8 |
| -* Adaptive bitrate support |
9 |
| - |
10 | 8 | * Working modes:
|
11 | 9 | 1. Local - serve locally accessible files (local disk/NFS mounted)
|
12 | 10 | 2. Remote - serve files accessible via HTTP using range requests
|
13 | 11 | 3. Mapped - perform an HTTP request to map the input URI to a locally accessible file
|
14 | 12 |
|
| 13 | +* Adaptive bitrate support |
| 14 | + |
| 15 | +* Playlist support (playing several different media files one after the other) - mapped mode only |
| 16 | + |
15 | 17 | * Fallback support for file not found in local/mapped modes (useful in multi-datacenter environments)
|
16 | 18 |
|
17 | 19 | * Video codecs: H264, H265 (DASH/HLS)
|
@@ -93,7 +95,7 @@ baseurl = http://installrepo.kaltura.org/releases/latest/RPMS/$basearch/
|
93 | 95 | #### Debian/Ubuntu deb package
|
94 | 96 | ```
|
95 | 97 | # wget -O - http://installrepo.kaltura.org/repo/apt/debian/kaltura-deb.gpg.key|apt-key add -
|
96 |
| -# echo "deb http://installrepo.kaltura.org/repo/apt/debian jupiter main" > /etc/apt/sources.list.d/kaltura.list |
| 98 | +# echo "deb [arch=amd64] http://installrepo.kaltura.org/repo/apt/debian kajam main" > /etc/apt/sources.list.d/kaltura.list |
97 | 99 | # apt-get update
|
98 | 100 | # apt-get install kaltura-nginx
|
99 | 101 | ```
|
@@ -162,6 +164,204 @@ Where:
|
162 | 164 | The default is to include the first audio and first video tracks of each file.
|
163 | 165 | The tracks selected on the file name are AND-ed with the tracks selected with the /tracks/ path parameter.
|
164 | 166 |
|
| 167 | +### Mapping response format |
| 168 | + |
| 169 | +When configured to run in mapped mode, nginx-vod-module issues an HTTP request to a configured upstream server |
| 170 | +in order to receive the layout of media streams it should generate. |
| 171 | +The response has to be in JSON format, this section contains are a few simple examples followed by a reference |
| 172 | +of the supported objects and fields. |
| 173 | + |
| 174 | +But first, a couple of definitions: |
| 175 | +1. `Source Clip` - a set of audio and/or video frames (tracks) extracted from a single media file |
| 176 | +2. `Filter` - a manipulation that can be applied on audio/video frames. The following filters are supported: |
| 177 | + * rate (speed) change - applies to both audio and video |
| 178 | + * audio volume change |
| 179 | + * mix - can be used to merge several audio tracks together, or to merge the audio of source A with the video of source B |
| 180 | +2. `Clip` - the result of applying zero or more filters on a set of source clips |
| 181 | +3. `Sequence` - a set of clips that should be played one after the other. |
| 182 | +4. `Set` - several sequences that play together as an adaptive set, each sequence must have the same number of clips. |
| 183 | + |
| 184 | +#### Simple mapping |
| 185 | + |
| 186 | +The JSON below maps the request URI to a single MP4 file: |
| 187 | +``` |
| 188 | +{ |
| 189 | + "sequences" : [ |
| 190 | + { |
| 191 | + "clips": [ |
| 192 | + { |
| 193 | + "type": "source", |
| 194 | + "path": "/path/to/video.mp4" |
| 195 | + } |
| 196 | + ] |
| 197 | + } |
| 198 | + ] |
| 199 | +} |
| 200 | +``` |
| 201 | + |
| 202 | +When using multi URLs, this is the only allowed JSON pattern. In other words, it is not |
| 203 | +possible to combine more complex JSONs using multi URL. |
| 204 | + |
| 205 | +#### Adaptive set |
| 206 | + |
| 207 | +As an alternative to using multi URL, an adaptive set can be defined via JSON: |
| 208 | +``` |
| 209 | +{ |
| 210 | + "sequences" : [ |
| 211 | + { |
| 212 | + "clips": [ |
| 213 | + { |
| 214 | + "type": "source", |
| 215 | + "path": "/path/to/bitrate1.mp4" |
| 216 | + } |
| 217 | + ] |
| 218 | + }, |
| 219 | + { |
| 220 | + "clips": [ |
| 221 | + { |
| 222 | + "type": "source", |
| 223 | + "path": "/path/to/bitrate2.mp4" |
| 224 | + } |
| 225 | + ] |
| 226 | + } |
| 227 | + ] |
| 228 | +} |
| 229 | +``` |
| 230 | + |
| 231 | +#### Playlist |
| 232 | + |
| 233 | +The JSON below will play 35 seconds of video1 followed by 22 seconds of video2: |
| 234 | +``` |
| 235 | +{ |
| 236 | + "durations" : [ 35000, 22000 ], |
| 237 | + "sequences" : [ |
| 238 | + { |
| 239 | + "clips": [ |
| 240 | + { |
| 241 | + "type": "source", |
| 242 | + "path": "/path/to/video1.mp4" |
| 243 | + }, |
| 244 | + { |
| 245 | + "type": "source", |
| 246 | + "path": "/path/to/video2.mp4" |
| 247 | + } |
| 248 | + ] |
| 249 | + } |
| 250 | + ] |
| 251 | +} |
| 252 | +``` |
| 253 | + |
| 254 | +#### Filters |
| 255 | + |
| 256 | +The JSON below takes video1, plays it at x1.5 and mixes the audio of the result with the audio of video2, |
| 257 | +after reducing it to 50% volume: |
| 258 | +``` |
| 259 | +{ |
| 260 | + "sequences" : [ |
| 261 | + { |
| 262 | + "clips": [ |
| 263 | + { |
| 264 | + "type": "mixFilter", |
| 265 | + "sources": [ |
| 266 | + { |
| 267 | + "type": "rateFilter", |
| 268 | + "rate": 1.5, |
| 269 | + "source": { |
| 270 | + "type": "source", |
| 271 | + "path": "/path/to/video1.mp4" |
| 272 | + } |
| 273 | + }, |
| 274 | + { |
| 275 | + "type": "gainFilter", |
| 276 | + "gain": 0.5, |
| 277 | + "source": { |
| 278 | + "type": "source", |
| 279 | + "path": "/path/to/video2.mp4", |
| 280 | + "tracks": "a1" |
| 281 | + } |
| 282 | + } |
| 283 | + ] |
| 284 | + } |
| 285 | + ] |
| 286 | + } |
| 287 | + ] |
| 288 | +} |
| 289 | +``` |
| 290 | + |
| 291 | +### Mapping reference |
| 292 | + |
| 293 | +#### Set (top level object in the mapping JSON) |
| 294 | + |
| 295 | +Mandatory fields: |
| 296 | +* `sequences` - array of Sequence objects. |
| 297 | + The mapping has to contain at least one sequence and up to 32 sequences. |
| 298 | + |
| 299 | +Optional fields: |
| 300 | +* `durations` - an array of integers representing clip durations in milliseconds. |
| 301 | + This field is mandatory if the mapping contains more than a single clip per sequence. |
| 302 | + If specified, this array must contain at least one element and up to 128 elements. |
| 303 | +* `discontinuity` - boolean, indicates whether the different clips in each sequence have |
| 304 | + different media parameters. This field has different manifestations according to the |
| 305 | + delivery protocol - a value of true will generate `#EXT-X-DISCONTINUITY` in HLS, |
| 306 | + and a multi period MPD in DASH. The default value is true, set to false only if the media |
| 307 | + files were transcoded with exactly the same parameters (in AVC for example, |
| 308 | + the clips should have exactly the same SPS/PPS). |
| 309 | +* `consistentSequenceMediaInfo` - boolean, currently affects only DASH. When set to true (default) |
| 310 | + the MPD will report the same media parameters in each period element. Setting to false |
| 311 | + can have severe performance implications for long sequences (nginx-vod-module has |
| 312 | + to read the media info of all clips included in the mapping in order to generate the MPD) |
| 313 | + |
| 314 | +#### Sequence |
| 315 | + |
| 316 | +Mandatory fields: |
| 317 | +* `clips` - array of Clip objects (mandatory). The number of elements must match the number |
| 318 | + the durations array specified on the set. If the durations array is not specified, |
| 319 | + the clips array must contain a single element. |
| 320 | + |
| 321 | +#### Clip (abstract) |
| 322 | + |
| 323 | +Mandatory fields: |
| 324 | +* `type` - a string that defines the type of the clip. Allowed values are: |
| 325 | + * source |
| 326 | + * rateFilter |
| 327 | + * mixFilter |
| 328 | + * gainFilter |
| 329 | + |
| 330 | +#### Source clip |
| 331 | + |
| 332 | +Mandatory fields: |
| 333 | +* `type` - a string with the value `source` |
| 334 | +* `path` - a string containing the path of the MP4 file |
| 335 | + |
| 336 | +Optional fields: |
| 337 | +* `tracks` - a string that specifies the tracks that should be used, the default is "v1-a1", |
| 338 | + which means the first video track and the first audio track |
| 339 | +* `clipFrom` - an integer that specifies an offset in milliseconds, from the beginning of the |
| 340 | + media file, from which to start loading frames |
| 341 | + |
| 342 | +#### Rate filter clip |
| 343 | + |
| 344 | +Mandatory fields: |
| 345 | +* `type` - a string with the value `rateFilter` |
| 346 | +* `rate` - a float that specified the acceleration factor, e.g. a value of 2 means double speed. |
| 347 | + Allowed values are in the range 0.5 - 2 with up to two decimal points |
| 348 | +* `source` - a clip object on which to perform the rate filtering |
| 349 | + |
| 350 | +#### Gain filter clip |
| 351 | + |
| 352 | +Mandatory fields: |
| 353 | +* `type` - a string with the value `gainFilter` |
| 354 | +* `gain` - a float that specified the amplification factor, e.g. a value of 2 means twice as loud. |
| 355 | + The gain must be positive with up to two decimal points |
| 356 | +* `source` - a clip object on which to perform the gain filtering |
| 357 | + |
| 358 | +#### Mix filter clip |
| 359 | + |
| 360 | +Mandatory fields: |
| 361 | +* `type` - a string with the value `mixFilter` |
| 362 | +* `sources` - an array of Clip objects to mix. This array must contain at least one clip and |
| 363 | + up to 32 clips. |
| 364 | + |
165 | 365 | ### DRM
|
166 | 366 |
|
167 | 367 | Nginx-vod-module has the ability to perform on-the-fly encryption for MPEG DASH (CENC) and MSS Play Ready.
|
|
0 commit comments