mediasnacks 0.33.2 → 0.34.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/avif.js +6 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasnacks",
3
- "version": "0.33.2",
3
+ "version": "0.34.0",
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,7 @@
1
1
  import { join, basename, dirname } from 'node:path'
2
2
  import { parseOptions } from './utils/parseOptions.js'
3
3
  import { replaceExt, lstat } from './utils/fs-utils.js'
4
- import { ffmpeg } from './utils/ffmpeg.js'
4
+ import { runSilently } from './utils/subprocess.js'
5
5
 
6
6
 
7
7
  const HELP = `
@@ -9,11 +9,14 @@ SYNOPSIS
9
9
  mediasnacks avif [-y | --overwrite] [--outdir=<dir>] <images>
10
10
 
11
11
  DESCRIPTION
12
- Converts images to AVIF.
12
+ Converts images to AVIF.
13
13
 
14
14
  EXAMPLES
15
15
  mediasnacks avif -y '*.png'
16
16
  mediasnacks avif --outdir=foo/ 'a/**/*.png'
17
+
18
+ DEPENDENCIES
19
+ brew install libavif
17
20
  `
18
21
 
19
22
  export default async function main() {
@@ -42,11 +45,5 @@ export async function avif({ file, outFile, overwrite = false }) {
42
45
  if (stAvif?.mtimeMs > lstat(file)?.mtimeMs) throw `avif is newer: ${file}`
43
46
  }
44
47
 
45
- await ffmpeg([
46
- '-y',
47
- '-i', file,
48
- '-c:v', 'libsvtav1',
49
- '-svtav1-params', 'avif=1',
50
- outFile
51
- ])
48
+ await runSilently('avifenc', [file, outFile])
52
49
  }