mediasnacks 0.8.0 → 0.8.1

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.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Utilities for preparing videos, images, and audio for the web",
5
5
  "license": "MIT",
6
6
  "author": "Eric Fortis",
package/src/avif.js CHANGED
@@ -44,21 +44,20 @@ async function main() {
44
44
  }
45
45
 
46
46
  async function toAvif({ file, outFile, overwrite }) {
47
- const stImg = lstat(file)
48
47
  const stAvif = lstat(outFile)
49
48
 
50
49
  if (!overwrite && stAvif?.isFile()) {
51
50
  console.log('(skipped: output file exists but --overwrite=false)', file)
52
51
  return
53
52
  }
54
- if (stAvif?.mtimeMs > stImg?.mtimeMs) {
53
+ if (stAvif?.mtimeMs > lstat(file)?.mtimeMs) {
55
54
  console.log('(skipped: avif is newer)', file)
56
55
  return
57
56
  }
58
57
 
59
58
  console.log(file)
60
59
  await ffmpeg([
61
- '-y', // overwrites
60
+ '-y',
62
61
  '-i', file,
63
62
  '-c:v', 'libsvtav1',
64
63
  '-svtav1-params', 'avif=1',
package/src/dropdups.js CHANGED
@@ -52,7 +52,7 @@ async function main() {
52
52
  throw new Error('No video specified. See npx mediasnacks dropdups --help')
53
53
 
54
54
  let nBadFrame = values['bad-frame-number']
55
- if (nBadFrame && /^\d+$/.test(nBadFrame))
55
+ if (nBadFrame && !/^\d+$/.test(nBadFrame))
56
56
  throw new Error('Invalid --bad-frame-number. It must be a positive integer.')
57
57
 
58
58
  console.log('Dropping Duplicate Frames…')