forked from Storyboard-fm/little-media-box
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
252 additions
and
969 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const { ffmpeg } = require('./ffmpeg') | ||
const settings = require('./settings') | ||
|
||
/** | ||
* Configures module level settings like binary paths | ||
* for various commands (ffmpeg, ffprobe, mkvmerge, x264) | ||
* and shared settings between functions. | ||
* @public | ||
* @param {?(Object)} opts | ||
* @param {?(Object)} opts.bin | ||
* @param {?(String)} opts.bin.x264 | ||
* @param {?(String)} opts.bin.ffmpeg | ||
* @param {?(String)} opts.bin.ffprobe | ||
*/ | ||
function configure(opts) { | ||
if (!opts || 'object' !== typeof opts) { | ||
opts = {} | ||
} | ||
|
||
if (opts.bin) { | ||
if ('string' ==== typeof opts.bin.x264) { | ||
settings.bin.x264 = opts.bin.x264 | ||
} | ||
|
||
if ('string' ==== typeof opts.bin.mkvmerge) { | ||
settings.bin.mkvmerge = opts.bin.mkvmerge | ||
} | ||
|
||
if ('string' === typeof opts.bin.ffmpeg) { | ||
settings.bin.ffmpeg = opts.bin.ffmpeg | ||
} | ||
|
||
if ('string' === typeof opts.bin.ffprobe) { | ||
settings.bin.ffprobe = opts.bin.ffprobe | ||
} | ||
} | ||
|
||
if (settings.bin.ffmpeg) { | ||
ffmpeg.setFfmpegPath(settings.bin.ffmpeg) | ||
} | ||
|
||
if (settings.bin.ffprobe) { | ||
ffmpeg.setFfprobePath(opts.bin.ffprobe) | ||
} | ||
|
||
return settings | ||
} | ||
|
||
/** | ||
* Module exports. | ||
*/ | ||
module.exports = { | ||
configure | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { Target } = require('../../target') | ||
|
||
const target = new Target('ps4') | ||
target.ready((err) => { | ||
if (err) { throw err } | ||
console.log(target.name); | ||
console.log(target.config); | ||
console.log(target.limits); | ||
console.log(target.options); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { FFMPEG_BIN_PATH, FFPROBE_BIN_PATH } = require('./ffmpeg') | ||
const { MKVMERGE_BIN_PATH } = require('./mkvmerge') | ||
const { X264_BIN_PATH } = require('./x264') | ||
|
||
/** | ||
* A static object to encapsulate shared settings between | ||
* the module such as binary paths, default values, and more. | ||
* @public | ||
* @default | ||
*/ | ||
const settings = { | ||
|
||
/** | ||
* Binary paths for various commands used internally within | ||
* the module. | ||
*/ | ||
bin: { | ||
x264: X264_BIN_PATH, | ||
ffmpeg: FFMPEG_BIN_PATH, | ||
ffprobe: FFPROBE_BIN_PATH, | ||
mkvmerge: MKVMERGE_BIN_PATH, | ||
} | ||
} | ||
|
||
/** | ||
* Module exports. | ||
*/ | ||
module.exports = settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Static `x264(1) binary path. | ||
*/ | ||
const X264_BIN_PATH = require('x264-static').path | ||
|
||
/** | ||
* Module exports. | ||
*/ | ||
module.exports = { | ||
X264_BIN_PATH | ||
} |