halfsize 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/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/package.json +2 -2
- package/src/cli.mjs +5 -5
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="docs/card.webp" width="760" alt="halfsize: 23.2 MB to 1.99 MB, 12x smaller, VMAF 84.4">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/YKLovePython/halfsize/main/docs/card.webp" width="760" alt="halfsize: 23.2 MB to 1.99 MB, 12x smaller, VMAF 84.4">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">halfsize</h1>
|
|
@@ -119,7 +119,7 @@ your own limit, and watch the encode. The file goes to a temporary folder **on y
|
|
|
119
119
|
machine**; nothing is sent anywhere.
|
|
120
120
|
|
|
121
121
|
<p align="center">
|
|
122
|
-
<img src="docs/screenshot.webp" width="860" alt="halfsize local web app showing 23.2 MB compressed to 1.99 MB with VMAF 84.4">
|
|
122
|
+
<img src="https://raw.githubusercontent.com/YKLovePython/halfsize/main/docs/screenshot.webp" width="860" alt="halfsize local web app showing 23.2 MB compressed to 1.99 MB with VMAF 84.4">
|
|
123
123
|
</p>
|
|
124
124
|
|
|
125
125
|
After each run you can download a **share card** (the image at the top of this README) with the
|
package/README.zh-CN.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="docs/card.webp" width="760" alt="halfsize:23.2 MB 压缩到 1.99 MB,小了 12 倍,VMAF 84.4">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/YKLovePython/halfsize/main/docs/card.webp" width="760" alt="halfsize:23.2 MB 压缩到 1.99 MB,小了 12 倍,VMAF 84.4">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">halfsize</h1>
|
|
@@ -115,7 +115,7 @@ npx halfsize --web
|
|
|
115
115
|
然后看着它压。文件只会写进**你自己电脑**的临时目录,不会发到任何地方。
|
|
116
116
|
|
|
117
117
|
<p align="center">
|
|
118
|
-
<img src="docs/screenshot.webp" width="860" alt="halfsize 本地网页版:23.2 MB 压缩到 1.99 MB,VMAF 84.4">
|
|
118
|
+
<img src="https://raw.githubusercontent.com/YKLovePython/halfsize/main/docs/screenshot.webp" width="860" alt="halfsize 本地网页版:23.2 MB 压缩到 1.99 MB,VMAF 84.4">
|
|
119
119
|
</p>
|
|
120
120
|
|
|
121
121
|
每次压完可以生成一张**分享图**(就是本文最上面那张),上面是这次真实的数字。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "halfsize",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Compress any video to an exact target size, locally, and prove the quality did not drop.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"start": "node bin/halfsize.mjs",
|
|
29
29
|
"web": "node bin/halfsize.mjs --web",
|
|
30
|
-
"test": "node --test test/human.test.mjs test/plan.test.mjs test/quality.test.mjs test/e2e.test.mjs"
|
|
30
|
+
"test": "node --test test/human.test.mjs test/plan.test.mjs test/quality.test.mjs test/cli.test.mjs test/e2e.test.mjs"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"video",
|
package/src/cli.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { encode } from "./encode.mjs";
|
|
|
7
7
|
import { measureQuality, verdict } from "./quality.mjs";
|
|
8
8
|
import { bytes, duration, bitrate, ratio, parseSize, clock } from "./human.mjs";
|
|
9
9
|
|
|
10
|
-
const VERSION = "0.1.
|
|
10
|
+
const VERSION = "0.1.1";
|
|
11
11
|
|
|
12
12
|
const HELP = `
|
|
13
13
|
halfsize ${VERSION} - compress a video to an exact size, and prove it still looks the same.
|
|
@@ -67,14 +67,14 @@ export async function main(argv) {
|
|
|
67
67
|
const args = parseArgs(argv);
|
|
68
68
|
const flags = args.flags;
|
|
69
69
|
|
|
70
|
-
if (flags.help || (!args._.length && !flags.web && !flags.doctor)) {
|
|
71
|
-
console.log(HELP);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
70
|
if (flags.version) {
|
|
75
71
|
console.log(VERSION);
|
|
76
72
|
return;
|
|
77
73
|
}
|
|
74
|
+
if (flags.help || (!args._.length && !flags.web && !flags.doctor)) {
|
|
75
|
+
console.log(HELP);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
78
|
if (flags.doctor) return doctor();
|
|
79
79
|
if (flags.web) return startWeb();
|
|
80
80
|
|