# Documentation






## Module: avconv-utils





**createImageMosaic**(o, cb) *function*

> `Object` **o**

> `String` **o.outFile** - image file to save mosaic in

> `String[]` **o.files** - each image file to mosaic

> `Number[2]` **o.frameDimensions** - each extracted frame dimensions

> `Number[2]` [**o.grid**] - if ommitted uses strategy option to generate the grid automatically

> `String` [**o.strategy**]=`'horizontal'` - one of: 'horizontal', 'vertical', 'ar_a_b'. used if grid option is ommitted to elect the mosaic aspect

> `Boolean` [**o.deleteFiles**]=`false` - if trueish and mosaic is created, deletes frame files

> `Function` **cb** - callback



Creates image mosaic from the given frames.

Uses the given grid to layout frames or generates grid based on strategy.

ar_a_b tries to generate a mosaic with closest aspect ratio to a / b.





---
**doMosaicMagic**(o, cb) *function*

> `Object` **o**

> `String` **o.video** - path to video file to analyse

> `String` **o.mosaic** - path where to store the generated mosaic image

> `Number` [**o.fps**]=`1` - sample every n frames per second

> `Number` [**o.scale**]=`1` - scales the video frames

> `String` [**o.strategy**]=`'horizontal'` - one of: 'horizontal', 'vertical', 'ar_a_b'

> `Function` **cb** - callback



High level function which uses the other ones to perform whole workflow.

ar_a_b tries to generate a mosaic with closest aspect ratio to a / b.





---
**extractFrames**(o, cb) *function*

> `Object` **o**

> `String` **o.inFile** - video file to use

> `Number[2]` **o.videoDimensions** - dimensions assumed for the video (used if scale is passed)

> `String` [**o.guid**] - if ommited a GUID will be auto generated

> `Number` [**o.fps**]=`1` - sample every n frames per second

> `Number` [**o.startTime**] - start time to sample, in seconds

> `Number` [**o.numFrames**] - number of frames to sample

> `Number` [**o.duration**] - max duration to sample, in seconds

> `Number` [**o.scale**]=`1` - scales the video frames

> `String` [**o.outPath**]=`'/tmp'` - directory where generated content will be put

> `String` [**o.outImageMask**]=`'GUID_%04.png'` - generated images mask

> `String` [**o.outJSON**]=`'GUID.json'` - generated json file name

> `String` [**o.debug**]=`false` - outputs debug info to console if trueish

> `Function` **cb** - callback



Extracts and stores video frames from given video.





---
**getMetadata**(media, cb) *function*

> `String` **media** - path to media file to analyse

> `Function` **cb** - callback



Returns an object with the most relevant information found in avconv output





---


*documentation auto-generated by [inkdoc](https://github.com/JosePedroDias/inkdoc) from block comments*
