polotno-node 2.9.16 → 2.9.18
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/video-parallel.js +9 -3
package/package.json
CHANGED
package/video-parallel.js
CHANGED
|
@@ -238,7 +238,8 @@ module.exports.jsonToVideo = async function jsonToVideo(inst, json, attrs) {
|
|
|
238
238
|
.input(`${tempFolder.name}/%d.jpeg`)
|
|
239
239
|
.inputFPS(fps)
|
|
240
240
|
.videoCodec('libx264')
|
|
241
|
-
.outputOptions('-pix_fmt yuv420p')
|
|
241
|
+
.outputOptions('-pix_fmt yuv420p')
|
|
242
|
+
.videoFilters('scale=trunc(iw/2)*2:trunc(ih/2)*2'); // Ensure dimensions are divisible by 2
|
|
242
243
|
|
|
243
244
|
// Add each audio segment as a separate input
|
|
244
245
|
inputs.forEach((input, index) => {
|
|
@@ -261,13 +262,18 @@ module.exports.jsonToVideo = async function jsonToVideo(inst, json, attrs) {
|
|
|
261
262
|
|
|
262
263
|
// Map each audio stream
|
|
263
264
|
inputs.forEach((_, index) => {
|
|
264
|
-
ffmpegCmd.outputOptions([`-map ${index + 1}:a
|
|
265
|
+
ffmpegCmd.outputOptions([`-map ${index + 1}:a?`]);
|
|
265
266
|
});
|
|
266
267
|
|
|
267
268
|
ffmpegCmd
|
|
268
269
|
.format(format)
|
|
269
270
|
.on('end', () => resolve())
|
|
270
|
-
.on('error', (err) =>
|
|
271
|
+
.on('error', (err, stdout, stderr) => {
|
|
272
|
+
console.log(err.message);
|
|
273
|
+
console.log('stdout:\n' + stdout);
|
|
274
|
+
console.log('stderr:\n' + stderr);
|
|
275
|
+
reject(err);
|
|
276
|
+
})
|
|
271
277
|
.save(attrs.out);
|
|
272
278
|
});
|
|
273
279
|
|