image-video-optimizer 1.1.1 → 1.1.2
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 +1 -1
- package/src/videoProcessor.js +8 -0
package/package.json
CHANGED
package/src/videoProcessor.js
CHANGED
|
@@ -80,6 +80,9 @@ class VideoProcessor {
|
|
|
80
80
|
.outputOptions('-preset medium')
|
|
81
81
|
.format('mp4')
|
|
82
82
|
.output(tempPath)
|
|
83
|
+
.on('start', (commandLine) => {
|
|
84
|
+
console.log(`FFmpeg command: ${commandLine}`);
|
|
85
|
+
})
|
|
83
86
|
.on('end', () => {
|
|
84
87
|
const compressionResult = this.checkCompression(inputPath, tempPath);
|
|
85
88
|
|
|
@@ -103,6 +106,7 @@ class VideoProcessor {
|
|
|
103
106
|
})
|
|
104
107
|
.on('error', (err) => {
|
|
105
108
|
console.error(`Error processing video ${inputPath}:`, err.message);
|
|
109
|
+
console.error(`FFmpeg stderr: ${err.stderr || 'No stderr available'}`);
|
|
106
110
|
if (fs.existsSync(tempPath)) {
|
|
107
111
|
fs.unlinkSync(tempPath);
|
|
108
112
|
}
|
|
@@ -139,6 +143,9 @@ class VideoProcessor {
|
|
|
139
143
|
.outputOptions('-preset medium')
|
|
140
144
|
.format('mp4')
|
|
141
145
|
.output(outputPath)
|
|
146
|
+
.on('start', (commandLine) => {
|
|
147
|
+
console.log(`FFmpeg command: ${commandLine}`);
|
|
148
|
+
})
|
|
142
149
|
.on('end', () => {
|
|
143
150
|
const compressionResult = this.checkCompression(inputPath, outputPath);
|
|
144
151
|
|
|
@@ -159,6 +166,7 @@ class VideoProcessor {
|
|
|
159
166
|
})
|
|
160
167
|
.on('error', (err) => {
|
|
161
168
|
console.error(`Error processing video ${inputPath}:`, err.message);
|
|
169
|
+
console.error(`FFmpeg stderr: ${err.stderr || 'No stderr available'}`);
|
|
162
170
|
if (fs.existsSync(outputPath)) {
|
|
163
171
|
fs.unlinkSync(outputPath);
|
|
164
172
|
}
|