mediasnacks 0.1.0 → 0.1.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/.zsh/completions/_mediasnacks +1 -1
- package/README.md +3 -1
- package/package.json +1 -1
- package/src/avif.js +0 -1
- package/src/cli.js +1 -1
- package/src/dropdups.js +10 -11
|
@@ -9,7 +9,7 @@ _mediasnacks_commands=(
|
|
|
9
9
|
'qdir:Sequentially runs all *.sh files in a folder'
|
|
10
10
|
'hev1tohvc1:Fixes video thumbnails not rendering in macOS Finder'
|
|
11
11
|
'framediff:ffplay with a filter for diffing adjacent frames'
|
|
12
|
-
'videodiff:Plays a video
|
|
12
|
+
'videodiff:Plays a video with the difference of two videos'
|
|
13
13
|
)
|
|
14
14
|
|
|
15
15
|
_mediasnacks() {
|
package/README.md
CHANGED
|
@@ -18,7 +18,9 @@ Commands:
|
|
|
18
18
|
- `seqcheck` Finds missing sequence number
|
|
19
19
|
- `qdir` Sequentially runs all *.sh files in a folder
|
|
20
20
|
- `hev1tohvc1`: Fixes video thumbnails not rendering in macOS Finder
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
- `framediff`: Plays a video of adjacent frames diff
|
|
23
|
+
- `videodiff`: Plays a video with the difference of two videos
|
|
22
24
|
<br/>
|
|
23
25
|
|
|
24
26
|
### Converting Images to AVIF
|
package/package.json
CHANGED
package/src/avif.js
CHANGED
package/src/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ Commands:
|
|
|
33
33
|
hev1tohvc1: Fixes video thumbnails not rendering in macOS Finder
|
|
34
34
|
|
|
35
35
|
framediff: Plays a video of adjacent frames diff
|
|
36
|
-
videodiff: Plays a video
|
|
36
|
+
videodiff: Plays a video with the difference of two videos
|
|
37
37
|
`.trim()
|
|
38
38
|
|
|
39
39
|
|
package/src/dropdups.js
CHANGED
|
@@ -14,6 +14,8 @@ const PRORES_PROFILES = {
|
|
|
14
14
|
'4444': 4,
|
|
15
15
|
'4444xq': 5,
|
|
16
16
|
}
|
|
17
|
+
const PROFILE = PRORES_PROFILES.hq
|
|
18
|
+
|
|
17
19
|
|
|
18
20
|
const USAGE = `
|
|
19
21
|
Usage: npx mediasnacks dropdups [-n <bad-frame-number>] <video>
|
|
@@ -22,8 +24,9 @@ Removes duplicate frames and outputs ProRes 422 HQ.
|
|
|
22
24
|
|
|
23
25
|
Options:
|
|
24
26
|
-n, --bad-frame-number <n> Known frame interval to drop.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
(default: n=0) auto-detects repeated frames (slower)
|
|
28
|
+
Ex.A: Use n=2 when every other frame is repeated.
|
|
29
|
+
Ex.B: Use n=6 if e.g., a 25 fps got upped to 30 fps without interpolation.
|
|
27
30
|
-h, --help
|
|
28
31
|
`.trim()
|
|
29
32
|
|
|
@@ -31,7 +34,7 @@ Options:
|
|
|
31
34
|
async function main() {
|
|
32
35
|
const { values, positionals } = parseArgs({
|
|
33
36
|
options: {
|
|
34
|
-
'bad-frame-number': { short: 'n', type: 'string' },
|
|
37
|
+
'bad-frame-number': { short: 'n', type: 'string', default: '' },
|
|
35
38
|
help: { short: 'h', type: 'boolean', default: false },
|
|
36
39
|
},
|
|
37
40
|
allowPositionals: true
|
|
@@ -45,13 +48,9 @@ async function main() {
|
|
|
45
48
|
if (!positionals.length)
|
|
46
49
|
throw new Error('No video specified. See npx mediasnacks dropdups --help')
|
|
47
50
|
|
|
48
|
-
let nBadFrame =
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
if (!Number.isFinite(n) || n <= 0)
|
|
52
|
-
throw new Error('Invalid --bad-frame-number. It must be a positive integer.')
|
|
53
|
-
nBadFrame = n
|
|
54
|
-
}
|
|
51
|
+
let nBadFrame = values['bad-frame-number']
|
|
52
|
+
if (nBadFrame && /^\d+$/.test(nBadFrame))
|
|
53
|
+
throw new Error('Invalid --bad-frame-number. It must be a positive integer.')
|
|
55
54
|
|
|
56
55
|
await assertUserHasFFmpeg()
|
|
57
56
|
|
|
@@ -72,7 +71,7 @@ async function drop(video, nBadFrame) {
|
|
|
72
71
|
: 'mpdecimate,setpts=N/FRAME_RATE/TB',
|
|
73
72
|
'-fps_mode', 'cfr',
|
|
74
73
|
'-c:v', 'prores_ks',
|
|
75
|
-
'-profile:v',
|
|
74
|
+
'-profile:v', PROFILE,
|
|
76
75
|
'-pix_fmt', 'yuv422p10le',
|
|
77
76
|
makeOutputPath(video)
|
|
78
77
|
])
|