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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasnacks",
3
- "version": "0.22.3",
3
+ "version": "0.22.5",
4
4
  "description": "Utilities for optimizing and preparing videos and images",
5
5
  "license": "MIT",
6
6
  "author": "Eric Fortis",
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
@@ -11,7 +11,7 @@ DESCRIPTION
11
11
  EOF
12
12
  }
13
13
 
14
- if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
14
+ if [ "$1" = "-h" ]; then
15
15
  help
16
16
  exit 0
17
17
  fi
package/src/framediff.sh CHANGED
@@ -18,7 +18,7 @@ SEE ALSO
18
18
  EOF
19
19
  }
20
20
 
21
- if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
21
+ if [ "$1" = "-h" ]; then
22
22
  help
23
23
  exit 0
24
24
  fi
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 result = await ffmpeg([
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 = result.stderr.match(/All:([\d.]+)/)
32
+ const match = stderr.match(/All:([\d.]+)/)
33
33
  if (!match)
34
- throw new Error(`Could not parse SSIM output:\n${result.stderr}`)
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
@@ -16,7 +16,7 @@ EXAMPLES
16
16
  EOF
17
17
  }
18
18
 
19
- if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
19
+ if [ "$1" = "-h" ]; then
20
20
  help
21
21
  exit 0
22
22
  fi
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. Videos must have
11
- the same resolution and ideally the same framerate.
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" = "--help" ] || [ "$1" = "-h" ]; then
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>] <video>
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