aboutsummaryrefslogtreecommitdiff
path: root/src/api/utils/videoPreview/FrameIntervalPreview.js
diff options
context:
space:
mode:
authorZephyrrus <[email protected]>2020-07-08 04:00:12 +0300
committerZephyrrus <[email protected]>2020-07-08 04:00:12 +0300
commitad852de51a0d2dd5d29c08838d5a430c58849e74 (patch)
treea4ab9a720f66271c9eba10916061a9b06c43656e /src/api/utils/videoPreview/FrameIntervalPreview.js
parentrefactor: refactor grid to use vuex for every action (diff)
downloadhost.fuwn.me-ad852de51a0d2dd5d29c08838d5a430c58849e74.tar.xz
host.fuwn.me-ad852de51a0d2dd5d29c08838d5a430c58849e74.zip
chore: linter the entire project using the new rules
Diffstat (limited to 'src/api/utils/videoPreview/FrameIntervalPreview.js')
-rw-r--r--src/api/utils/videoPreview/FrameIntervalPreview.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/api/utils/videoPreview/FrameIntervalPreview.js b/src/api/utils/videoPreview/FrameIntervalPreview.js
index 75f6d2b..8c5f1c3 100644
--- a/src/api/utils/videoPreview/FrameIntervalPreview.js
+++ b/src/api/utils/videoPreview/FrameIntervalPreview.js
@@ -1,9 +1,10 @@
+/* eslint-disable no-bitwise */
const ffmpeg = require('fluent-ffmpeg');
const probe = require('ffmpeg-probe');
const noop = () => {};
-module.exports = async opts => {
+module.exports = async (opts) => {
const {
log = noop,
@@ -15,13 +16,13 @@ module.exports = async opts => {
output,
numFrames,
- numFramesPercent = 0.05
+ numFramesPercent = 0.05,
} = opts;
const info = await probe(input);
// const numFramesTotal = parseInt(info.streams[0].nb_frames, 10);
const { avg_frame_rate: avgFrameRate, duration } = info.streams[0];
- const [frames, time] = avgFrameRate.split('/').map(e => parseInt(e, 10));
+ const [frames, time] = avgFrameRate.split('/').map((e) => parseInt(e, 10));
const numFramesTotal = (frames / time) * duration;
@@ -31,7 +32,7 @@ module.exports = async opts => {
const result = {
output,
- numFrames: numFramesToCapture
+ numFrames: numFramesToCapture,
};
await new Promise((resolve, reject) => {
@@ -62,9 +63,9 @@ module.exports = async opts => {
.noAudio()
.outputFormat('webm')
.output(output)
- .on('start', cmd => log && log({ cmd }))
+ .on('start', (cmd) => log && log({ cmd }))
.on('end', () => resolve())
- .on('error', err => reject(err))
+ .on('error', (err) => reject(err))
.run();
});