mediasnacks 0.21.0 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -52
- package/install-zsh-completions.js +48 -0
- package/package.json +3 -4
- package/src/avif.js +5 -5
- package/src/cli.js +36 -24
- package/src/detectdups.js +9 -7
- package/src/dropdups.js +6 -14
- package/src/edgespic.js +5 -5
- package/src/hev1tohvc1.js +5 -5
- package/src/moov2front.js +7 -3
- package/src/play.js +64 -0
- package/src/prores.js +19 -15
- package/src/qdir.js +2 -2
- package/src/random.js +45 -0
- package/src/resize.js +3 -3
- package/src/seqcheck.js +2 -2
- package/src/sqcrop.js +3 -3
- package/src/ssim.js +3 -3
- package/src/utils/parseOptions.js +1 -0
- package/src/vsplit.js +5 -5
- package/src/vtrim.js +5 -5
- package/.zsh/completions/_mediasnacks +0 -47
- package/install-zsh-completions.sh +0 -23
- package/src/avif.test.js +0 -16
- package/src/detectdups.test.js +0 -24
- package/src/edgespic.test.js +0 -36
- package/src/fixtures/60fps.csv +0 -7
- package/src/fixtures/60fps.mp4 +0 -0
- package/src/fixtures/big-buck-bunny/bbb_24_to_25fps_dup.mp4 +0 -0
- package/src/fixtures/big-buck-bunny/bbb_24_to_30fps_dup.mp4 +0 -0
- package/src/fixtures/big-buck-bunny/bbb_24_to_48fps_dup.mp4 +0 -0
- package/src/fixtures/big-buck-bunny/bbb_24fps_no_dups.mp4 +0 -0
- package/src/fixtures/big-buck-bunny/bbb_25_to_30fps_dup.mp4 +0 -0
- package/src/fixtures/big-buck-bunny/bbb_25_to_50fps_dup.mp4 +0 -0
- package/src/fixtures/big-buck-bunny/bbb_25_to_60fps_dup.mp4 +0 -0
- package/src/fixtures/big-buck-bunny/bbb_25fps_no_dups.mp4 +0 -0
- package/src/fixtures/big-buck-bunny/generate.md +0 -71
- package/src/fixtures/edgespic/60fps_first.png +0 -0
- package/src/fixtures/edgespic/60fps_last.png +0 -0
- package/src/fixtures/lenna.avif +0 -0
- package/src/fixtures/lenna.png +0 -0
- package/src/fixtures/qdir-jobs/job1_good.sh +0 -1
- package/src/fixtures/qdir-jobs/job2_bad.sh +0 -1
- package/src/fixtures/qdir-jobs/job3_good.sh +0 -2
- package/src/fixtures/qdir-jobs/job4_bad.sh +0 -1
- package/src/flattendir.test.js +0 -36
- package/src/qdir.test.js +0 -24
- package/src/seqcheck.test.js +0 -27
- package/src/utils/fs-utils.test.js +0 -21
- package/src/utils/parseOptions.test.js +0 -59
- package/src/vconcat.test.js +0 -23
- package/src/vsplit.test.js +0 -32
- package/src/vtrim.test.js +0 -40
- /package/src/utils/{ffmpeg.js → subprocess.js} +0 -0
package/src/vtrim.test.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ok } from 'node:assert/strict'
|
|
2
|
-
import { join } from 'node:path'
|
|
3
|
-
import { cpSync } from 'node:fs'
|
|
4
|
-
import { describe, test } from 'node:test'
|
|
5
|
-
|
|
6
|
-
import { videoAttrs } from './utils/ffmpeg.js'
|
|
7
|
-
import { mkTempDir, cli } from './utils/test-utils.js'
|
|
8
|
-
|
|
9
|
-
const rel = f => join(import.meta.dirname, f)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
describe('vtrim', () => {
|
|
13
|
-
function almostEqual(actual, expected) {
|
|
14
|
-
const EPSILON = 0.05
|
|
15
|
-
ok(Math.abs(parseFloat(actual) - expected) < EPSILON,
|
|
16
|
-
`Duration should be around ${expected}s, got ${actual}s`)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const tmp = mkTempDir('vtrim')
|
|
20
|
-
const inputFile = join(tmp, '60fps.mp4')
|
|
21
|
-
cpSync(rel('fixtures/60fps.mp4'), inputFile)
|
|
22
|
-
|
|
23
|
-
test('from start to end time', async () => {
|
|
24
|
-
cli('vtrim', '--start', 5, '--end', 11, inputFile)
|
|
25
|
-
const { duration } = await videoAttrs(join(tmp, '60fps.trim.mp4'))
|
|
26
|
-
almostEqual(duration, 6)
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
test('start time only', async () => {
|
|
30
|
-
cli('vtrim', '--start', 5, inputFile)
|
|
31
|
-
const { duration } = await videoAttrs(join(tmp, '60fps.trim.mp4'))
|
|
32
|
-
almostEqual(duration, 25)
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
test('end time only', async () => {
|
|
36
|
-
cli('vtrim', '--end', 11, inputFile)
|
|
37
|
-
const { duration } = await videoAttrs(join(tmp, '60fps.trim.mp4'))
|
|
38
|
-
almostEqual(duration, 11)
|
|
39
|
-
})
|
|
40
|
-
})
|
|
File without changes
|