@mediaproc/audio 1.1.1 → 1.2.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/dist/cli.js +19 -4
- package/dist/cli.js.map +1 -1
- package/dist/commands/convert.d.ts.map +1 -1
- package/dist/commands/convert.js +31 -29
- package/dist/commands/convert.js.map +1 -1
- package/dist/commands/extract.d.ts.map +1 -1
- package/dist/commands/extract.js +57 -34
- package/dist/commands/extract.js.map +1 -1
- package/dist/commands/merge.d.ts.map +1 -1
- package/dist/commands/merge.js +100 -39
- package/dist/commands/merge.js.map +1 -1
- package/dist/commands/normalize.d.ts.map +1 -1
- package/dist/commands/normalize.js +92 -34
- package/dist/commands/normalize.js.map +1 -1
- package/dist/commands/trim.d.ts.map +1 -1
- package/dist/commands/trim.js +27 -22
- package/dist/commands/trim.js.map +1 -1
- package/dist/register.d.ts +2 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +16 -1
- package/dist/register.js.map +1 -1
- package/dist/types.d.ts +30 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/ffmpeg-output.d.ts +6 -2
- package/dist/utils/ffmpeg-output.d.ts.map +1 -1
- package/dist/utils/ffmpeg-output.js +51 -59
- package/dist/utils/ffmpeg-output.js.map +1 -1
- package/dist/utils/ffmpeg.d.ts +9 -8
- package/dist/utils/ffmpeg.d.ts.map +1 -1
- package/dist/utils/ffmpeg.js +107 -28
- package/dist/utils/ffmpeg.js.map +1 -1
- package/dist/utils/ffmpegLogger.d.ts +3 -7
- package/dist/utils/ffmpegLogger.d.ts.map +1 -1
- package/dist/utils/ffmpegLogger.js +16 -48
- package/dist/utils/ffmpegLogger.js.map +1 -1
- package/package.json +4 -8
- package/bin/cli.js +0 -5
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
* FFmpeg Output Logger - Styled output for better readability
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* Check if a line should be displayed based on content
|
|
5
|
+
* Check if a line should be displayed based on content (no styling)
|
|
6
6
|
*/
|
|
7
7
|
export declare function shouldDisplayLine(line: string): boolean;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Log FFmpeg output (plain, no styling)
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
12
|
-
/**
|
|
13
|
-
* Log FFmpeg output with styling
|
|
14
|
-
*/
|
|
15
|
-
export declare function logFFmpegOutput(output: string): void;
|
|
11
|
+
export declare function logFFmpegOutput(output: string, verbose?: boolean): void;
|
|
16
12
|
//# sourceMappingURL=ffmpegLogger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ffmpegLogger.d.ts","sourceRoot":"","sources":["../../src/utils/ffmpegLogger.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"ffmpegLogger.d.ts","sourceRoot":"","sources":["../../src/utils/ffmpegLogger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWvD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,IAAI,CAOrE"}
|
|
@@ -1,65 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FFmpeg Output Logger - Styled output for better readability
|
|
3
3
|
*/
|
|
4
|
-
import chalk from 'chalk';
|
|
5
4
|
/**
|
|
6
|
-
* Check if a line should be displayed based on content
|
|
5
|
+
* Check if a line should be displayed based on content (no styling)
|
|
7
6
|
*/
|
|
8
7
|
export function shouldDisplayLine(line) {
|
|
9
8
|
const trimmed = line.trim();
|
|
10
|
-
// Skip empty lines
|
|
11
9
|
if (!trimmed)
|
|
12
10
|
return false;
|
|
13
|
-
//
|
|
14
|
-
if (trimmed.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* Style FFmpeg output line with appropriate colors and formatting
|
|
25
|
-
*/
|
|
26
|
-
export function styleFFmpegOutput(line) {
|
|
27
|
-
const trimmed = line.trim();
|
|
28
|
-
// Progress updates (frame=, fps=, time=)
|
|
29
|
-
if (trimmed.match(/frame=|fps=|time=|speed=/)) {
|
|
30
|
-
return chalk.cyan(trimmed);
|
|
31
|
-
}
|
|
32
|
-
// Input file info
|
|
33
|
-
if (trimmed.startsWith('Input #') || trimmed.includes('Duration:') || trimmed.includes('Stream #')) {
|
|
34
|
-
return chalk.blue(trimmed);
|
|
35
|
-
}
|
|
36
|
-
// Output file info
|
|
37
|
-
if (trimmed.startsWith('Output #')) {
|
|
38
|
-
return chalk.green(trimmed);
|
|
39
|
-
}
|
|
40
|
-
// Warnings
|
|
41
|
-
if (trimmed.toLowerCase().includes('warning')) {
|
|
42
|
-
return chalk.yellow(trimmed);
|
|
43
|
-
}
|
|
44
|
-
// Errors
|
|
45
|
-
if (trimmed.toLowerCase().includes('error') || trimmed.toLowerCase().includes('failed')) {
|
|
46
|
-
return chalk.red(trimmed);
|
|
47
|
-
}
|
|
48
|
-
// Success messages
|
|
49
|
-
if (trimmed.includes('successfully') || trimmed.includes('complete')) {
|
|
50
|
-
return chalk.green(trimmed);
|
|
51
|
-
}
|
|
52
|
-
// Default gray for other lines
|
|
53
|
-
return chalk.gray(trimmed);
|
|
11
|
+
// Always show errors and warnings
|
|
12
|
+
if (trimmed.toLowerCase().includes('error') || trimmed.toLowerCase().includes('failed') || trimmed.toLowerCase().includes('warning'))
|
|
13
|
+
return true;
|
|
14
|
+
// Show progress and status lines always
|
|
15
|
+
if (trimmed.match(/frame=|fps=|time=|speed=/))
|
|
16
|
+
return true;
|
|
17
|
+
// Show input/output info
|
|
18
|
+
if (trimmed.startsWith('Input #') || trimmed.startsWith('Output #'))
|
|
19
|
+
return true;
|
|
20
|
+
// Show other lines if verbose (handled in command code)
|
|
21
|
+
return false;
|
|
54
22
|
}
|
|
55
23
|
/**
|
|
56
|
-
* Log FFmpeg output
|
|
24
|
+
* Log FFmpeg output (plain, no styling)
|
|
57
25
|
*/
|
|
58
|
-
export function logFFmpegOutput(output) {
|
|
26
|
+
export function logFFmpegOutput(output, verbose = false) {
|
|
59
27
|
const lines = output.split('\n');
|
|
60
28
|
for (const line of lines) {
|
|
61
|
-
if (shouldDisplayLine(line)) {
|
|
62
|
-
console.log(
|
|
29
|
+
if (shouldDisplayLine(line) || verbose) {
|
|
30
|
+
console.log(line);
|
|
63
31
|
}
|
|
64
32
|
}
|
|
65
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ffmpegLogger.js","sourceRoot":"","sources":["../../src/utils/ffmpegLogger.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"ffmpegLogger.js","sourceRoot":"","sources":["../../src/utils/ffmpegLogger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,kCAAkC;IAClC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAClJ,wCAAwC;IACxC,IAAI,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3D,yBAAyB;IACzB,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IACjF,wDAAwD;IACxD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,OAAO,GAAG,KAAK;IAC7D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,OAAO,EAAE,CAAC;YACvC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediaproc/audio",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Audio processing plugin for mediaproc - powered by FFmpeg",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
-
"bin": {
|
|
9
|
-
"mediaproc-audio": "./bin/cli.js"
|
|
10
|
-
},
|
|
11
8
|
"exports": {
|
|
12
9
|
".": {
|
|
13
10
|
"types": "./dist/index.d.ts",
|
|
@@ -15,8 +12,7 @@
|
|
|
15
12
|
}
|
|
16
13
|
},
|
|
17
14
|
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
"bin"
|
|
15
|
+
"dist"
|
|
20
16
|
],
|
|
21
17
|
"keywords": [
|
|
22
18
|
"mediaproc",
|
|
@@ -28,7 +24,7 @@
|
|
|
28
24
|
"author": "Sharique Chaudhary",
|
|
29
25
|
"license": "ISC",
|
|
30
26
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
27
|
+
"node": ">=22.0.0"
|
|
32
28
|
},
|
|
33
29
|
"scripts": {
|
|
34
30
|
"build": "tsc",
|
|
@@ -37,7 +33,7 @@
|
|
|
37
33
|
"clean": "rm -rf dist"
|
|
38
34
|
},
|
|
39
35
|
"dependencies": {
|
|
40
|
-
"@mediaproc/core": "1.
|
|
36
|
+
"@mediaproc/core": "^1.2.2",
|
|
41
37
|
"chalk": "^5.3.0",
|
|
42
38
|
"commander": "^14.0.2",
|
|
43
39
|
"ora": "^9.0.0"
|