mediasnacks 0.22.3 → 0.22.5
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/package.json +1 -1
- package/src/avif.js +4 -2
- package/src/flattendir.sh +1 -1
- package/src/framediff.sh +1 -1
- package/src/ssim.js +3 -3
- package/src/vconcat.sh +1 -1
- package/src/vdiff.sh +3 -3
- package/src/vsplit.js +3 -1
- package/src/vtrim.js +4 -2
package/package.json
CHANGED
package/src/avif.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
2
|
import { join, basename, dirname } from 'node:path'
|
|
4
|
-
|
|
5
3
|
import { parseOptions } from './utils/parseOptions.js'
|
|
6
4
|
import { replaceExt, lstat } from './utils/fs-utils.js'
|
|
7
5
|
import { ffmpeg, assertUserHasFFmpeg } from './utils/subprocess.js'
|
|
@@ -13,6 +11,10 @@ SYNOPSIS
|
|
|
13
11
|
|
|
14
12
|
DESCRIPTION
|
|
15
13
|
Converts images to AVIF.
|
|
14
|
+
|
|
15
|
+
EXAMPLES
|
|
16
|
+
mediasnacks avif -y '*.png'
|
|
17
|
+
mediasnacks avif --output-dir=foo/ 'a/**/*.png'
|
|
16
18
|
`.trim()
|
|
17
19
|
|
|
18
20
|
|
package/src/flattendir.sh
CHANGED
package/src/framediff.sh
CHANGED
package/src/ssim.js
CHANGED
|
@@ -23,15 +23,15 @@ async function main() {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export async function ssim(img1, img2) {
|
|
26
|
-
const
|
|
26
|
+
const { stderr } = await ffmpeg([
|
|
27
27
|
'-i', img1,
|
|
28
28
|
'-i', img2,
|
|
29
29
|
'-filter_complex', 'ssim',
|
|
30
30
|
'-f', 'null', '-'
|
|
31
31
|
])
|
|
32
|
-
const match =
|
|
32
|
+
const match = stderr.match(/All:([\d.]+)/)
|
|
33
33
|
if (!match)
|
|
34
|
-
throw new Error(`Could not parse SSIM output:\n${
|
|
34
|
+
throw new Error(`Could not parse SSIM output:\n${stderr}`)
|
|
35
35
|
return parseFloat(match[1])
|
|
36
36
|
}
|
|
37
37
|
|
package/src/vconcat.sh
CHANGED
package/src/vdiff.sh
CHANGED
|
@@ -7,12 +7,12 @@ SYNOPSIS
|
|
|
7
7
|
mediasnacks vdiff <video1> <video2>
|
|
8
8
|
|
|
9
9
|
DESCRIPTION
|
|
10
|
-
Diffs two video files using FFplay with a blend filter.
|
|
11
|
-
|
|
10
|
+
Diffs two video files using FFplay with a blend filter.
|
|
11
|
+
Videos must have the same resolution.
|
|
12
12
|
EOF
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
if [ "$1" = "
|
|
15
|
+
if [ "$1" = "-h" ]; then
|
|
16
16
|
help
|
|
17
17
|
exit 0
|
|
18
18
|
fi
|
package/src/vsplit.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
2
|
import { readFileSync } from 'node:fs'
|
|
4
3
|
import { resolve, parse, join } from 'node:path'
|
|
5
4
|
|
|
@@ -30,6 +29,9 @@ EXAMPLE
|
|
|
30
29
|
10,15
|
|
31
30
|
|
|
32
31
|
Outputs: video_1.mov, video_2.mov, video_3.mov
|
|
32
|
+
|
|
33
|
+
SEE ALSO
|
|
34
|
+
mediasnacks vtrim
|
|
33
35
|
`.trim()
|
|
34
36
|
|
|
35
37
|
|
package/src/vtrim.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
2
|
import { resolve, parse } from 'node:path'
|
|
4
3
|
import { parseOptions } from './utils/parseOptions.js'
|
|
5
4
|
import { ffmpeg, assertUserHasFFmpeg } from './utils/subprocess.js'
|
|
@@ -7,7 +6,7 @@ import { ffmpeg, assertUserHasFFmpeg } from './utils/subprocess.js'
|
|
|
7
6
|
|
|
8
7
|
const HELP = `
|
|
9
8
|
SYNOPSIS
|
|
10
|
-
mediasnacks vtrim [--start <time>] [--end <time>] <
|
|
9
|
+
mediasnacks vtrim [--start <time>] [--end <time>] <videos>
|
|
11
10
|
|
|
12
11
|
DESCRIPTION
|
|
13
12
|
Trims a video without re-encoding (fast, but approximate cuts).
|
|
@@ -16,6 +15,9 @@ OPTIONS
|
|
|
16
15
|
-s, --start <time> Start time (e.g. 10, 00:00:10, 1:23.5). Default: beginning.
|
|
17
16
|
-e, --end <time> End time (e.g. 30, 00:00:30, 2:45.0). Default: end of video.
|
|
18
17
|
-h, --help
|
|
18
|
+
|
|
19
|
+
SEE ALSO
|
|
20
|
+
mediasnacks vsplit
|
|
19
21
|
`.trim()
|
|
20
22
|
|
|
21
23
|
|