frameloom/docs/README.md

6.7 KiB

Functions

exec(cmd)Promise

Shells out to execute a command with async/await. Async wrapper to exec module.

delay(ms)Promise

Delays process for specified amount of time in milliseconds.

log()

Log function wrapper that can silences logs when QUIET == true

zeroPad(i, max)string

Pads a numerical value with preceding zeros to make strings same length.

shuffle(a)

Shuffles an array into a random state.

clear()

Clears the temporary directory of all files. Establishes a directory if none exists.

frames(video, order, avconv)string

Exports all frames from video. Appends number to the string to keep frames in alternating order to be quickly stitched together or re-sorted.

subExec(cmd)

Shells out to run a sub command on every frame to perform effects

weave(pattern, realtime, random)

Re-arranges the frames into the order specified in the pattern. Calls patternSort() to perform the rename and unlink actions

altSort(list, pattern, realtime)

Alternate frame sorting method.

standardSort(list, pattern, realtime)

Standard frame sorting method.

randomSort(list, pattern, realtime)

Ramdomly sort frames for re-stitching.

render(output, avconv)

Render the frames into a video using ffmpeg.

main(arg)

Parses the arguments and runs the process of exporting, sorting and then "weaving" the frames back into a video

exec(cmd) ⇒ Promise

Shells out to execute a command with async/await. Async wrapper to exec module.

Kind: global function
Returns: Promise - Promise containing the complete stdio

Param Type Description
cmd string Command to execute

delay(ms) ⇒ Promise

Delays process for specified amount of time in milliseconds.

Kind: global function
Returns: Promise - Promise that resolves after set time

Param Type Description
ms integer Milliseconds to delay for

log()

Log function wrapper that can silences logs when QUIET == true

Kind: global function

zeroPad(i, max) ⇒ string

Pads a numerical value with preceding zeros to make strings same length.

Kind: global function
Returns: string - Padded number as a string

Param Type Default Description
i integer Number to pad
max integer 5 (optional) Maximum length of string to pad to

shuffle(a)

Shuffles an array into a random state.

Kind: global function

Param Type Description
a array Array to randomize

clear()

Clears the temporary directory of all files. Establishes a directory if none exists.

Kind: global function

frames(video, order, avconv) ⇒ string

Exports all frames from video. Appends number to the string to keep frames in alternating order to be quickly stitched together or re-sorted.

Kind: global function
Returns: string - String with the export order, not sure why I did this

Param Type Description
video string String representing path to video
order integer Integer to be appended to pathname of file
avconv boolean Whether or not to use avconv instead of ffmpeg

subExec(cmd)

Shells out to run a sub command on every frame to perform effects

Kind: global function

Param Type Description
cmd string Command to execute on every frame

weave(pattern, realtime, random)

Re-arranges the frames into the order specified in the pattern. Calls patternSort() to perform the rename and unlink actions

Kind: global function

Param Type Description
pattern array Pattern of the frames per input
realtime boolean Flag to turn on or off realtime behavior (drop frames / number of vids)
random boolean Whether or not to randomize frames

altSort(list, pattern, realtime)

Alternate frame sorting method.

Kind: global function

Param Type Description
list array List of frames to group
pattern array Array representing pattern
realtime boolean Flag to group with "realtime" behavior

standardSort(list, pattern, realtime)

Standard frame sorting method.

Kind: global function

Param Type Description
list array List of frames to group
pattern array Array representing pattern
realtime boolean Flag to group with "realtime" behavior

randomSort(list, pattern, realtime)

Ramdomly sort frames for re-stitching.

Kind: global function

Param Type Description
list array List of frames to group
pattern array Array representing pattern
realtime boolean Flag to group with "realtime" behavior

render(output, avconv)

Render the frames into a video using ffmpeg.

Kind: global function

Param Type Description
output string Path to export the video to
avconv boolean Whether or not to use avconv in place of ffmpeg

main(arg)

Parses the arguments and runs the process of exporting, sorting and then "weaving" the frames back into a video

Kind: global function

Param Type Description
arg object Object containing all arguments