ffmpeg-progress 1.1.0 → 1.1.1

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.
Files changed (2) hide show
  1. package/core.js +4 -1
  2. package/package.json +1 -1
package/core.js CHANGED
@@ -17,13 +17,16 @@ function scanVideo(file) {
17
17
  return new Promise((resolve, reject) => {
18
18
  (0, child_process_1.exec)(`ffmpeg -i ${JSON.stringify(file)} 2>&1`, (err, stdout, stderr) => {
19
19
  try {
20
+ // e.g. " Duration: 00:03:00.03, start: 0.000000, bitrate: 2234 kb/s"
20
21
  let match = stdout.match(/Duration: ([0-9:.]+),/);
21
22
  if (!match) {
22
23
  throw new Error('failed to find video duration');
23
24
  }
24
25
  let duration = match[1];
25
26
  let seconds = parseToSeconds(duration);
26
- match = stdout.match(/Stream #0:\d.+: Video: .+ (\d+x\d+),/);
27
+ // e.g. " Stream #0:0[0x1](und): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc, progressive), 4032x3024, 2045 kb/s, 29.73 fps, 600 tbr, 600 tbn (default)"
28
+ // e.g. " Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt470bg/unknown/unknown, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 3958 kb/s, 29.49 fps, 29.83 tbr, 11456 tbn (default)"
29
+ match = stdout.match(/Stream #0:\d.+: Video: .+ (\d+x\d+)[\s|,]/);
27
30
  if (!match) {
28
31
  throw new Error('failed to find video resolution');
29
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffmpeg-progress",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Extract progress from ffmpeg child_process",
5
5
  "keywords": [
6
6
  "ffmpeg",