@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.
@@ -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
- * Style FFmpeg output line with appropriate colors and formatting
9
+ * Log FFmpeg output (plain, no styling)
10
10
  */
11
- export declare function styleFFmpegOutput(line: string): string;
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;AAIH;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAgBvD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmCtD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAQpD"}
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
- // Skip configuration lines
14
- if (trimmed.startsWith('ffmpeg version') ||
15
- trimmed.startsWith('built with') ||
16
- trimmed.startsWith('configuration:') ||
17
- trimmed.startsWith('lib')) {
18
- return false;
19
- }
20
- // Show important progress and status lines
21
- return true;
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 with styling
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(styleFFmpegOutput(line));
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;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAE5B,mBAAmB;IACnB,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAE3B,2BAA2B;IAC3B,IAAI,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC;QACpC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;QAChC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC;QACpC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAE5B,yCAAyC;IACzC,IAAI,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,kBAAkB;IAClB,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO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"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.1.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": ">=18.0.0"
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.0.0",
36
+ "@mediaproc/core": "^1.2.2",
41
37
  "chalk": "^5.3.0",
42
38
  "commander": "^14.0.2",
43
39
  "ora": "^9.0.0"
package/bin/cli.js DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import('../dist/cli.js').catch((error) => {
3
- console.error('Fatal error:', error);
4
- process.exit(1);
5
- });