We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a9e1098 + f7811e1 commit f2d7b83Copy full SHA for f2d7b83
src/createFFmpeg.js
@@ -69,8 +69,9 @@ module.exports = (_options = {}) => {
69
} else if (message.startsWith('frame') || message.startsWith('size')) {
70
const ts = message.split('time=')[1].split(' ')[0];
71
const t = ts2sec(ts);
72
- const f = parseFloat(message.match(/frame=\s*(\d+)/)[1]);
73
- if (frames) {
+ const match = message.match(/frame=\s*(\d+)/);
+ if (frames && match) {
74
+ const f = parseFloat(match[1]);
75
ratio = Math.min(f / frames, 1);
76
} else {
77
ratio = t / duration;
0 commit comments