mediasnacks 0.33.1 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasnacks",
3
- "version": "0.33.1",
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
  }
package/src/dropdups.js CHANGED
@@ -16,14 +16,14 @@ DESCRIPTION
16
16
 
17
17
  OPTIONS
18
18
  -n, --dup-frame-num <n> Known frame interval to drop.
19
- Default: n=0, which auto-detects repeated frames (slower)
19
+ Default: n=0, which auto-detects repeated frames (slower)
20
20
 
21
21
  EXAMPLES
22
22
  Use n=2 when every other frame is repeated:
23
- mediasnacks dropdups -n2 vid.mov
24
-
25
- Use n=6 if e.g., a 25 fps got upped to 30 fps without interpolation.
26
- mediasnacks dropdups -n6 vid.mov
23
+ mediasnacks dropdups -n2 vid.mov
24
+
25
+ Use n=6 if e.g. a 25 fps got upped to 30 fps without interpolation:
26
+ mediasnacks dropdups -n6 vid.mov
27
27
  `
28
28
 
29
29
 
package/src/info.js CHANGED
@@ -59,7 +59,7 @@ export async function infoSummary(video) {
59
59
  return [
60
60
  String(v.width).padStart(4),
61
61
  String(v.height).padStart(4),
62
- `${fps(v.r_frame_rate)}fps`.padStart(7),
62
+ `${fps(v.r_frame_rate)}fps`.padStart(8),
63
63
  formatSeconds(v.duration, 0).padStart(8),
64
64
  v.codec_name
65
65
  ].join('\t')