fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.96k stars 881 forks source link

fix parsing of ffmpeg 7 "is a device" formats #1276

Open alexger opened 6 months ago

alexger commented 6 months ago

when running with ffmpeg 7, some formats are not properly parsed by getAvailableFormats and thus can not be used.

ffmpeg 7 adds a new column to the output of -formats command:

..d = Is a device

https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/pull/1274 partially addressed that issue, but only for formats where the new column is a space.

Formats that have d do not match the existing regex and are silently ignored.

One example is lavfi format which right now can not be used due to this issue.

The fix is to ammend the parsing regex to expect an optional space or 'd'. This way both new and old versions of ffmpeg are supported.

I've added a test for lavfi which fails without this fix when run with ffmpeg 7.

bakkot commented 1 month ago

This also makes avfoundation work again (which looks like https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/492, but that was a different issue).

LorDisturbia commented 2 weeks ago

@schaermu any hope this gets released? Currently fluent-ffmpeg is unusable with FFMPEG 7 due to this. :(