fix: classify FFmpeg log messages as ffout/fferr instead of always stderr - #941
Open
PiedPiper911 wants to merge 2 commits into
Open
fix: classify FFmpeg log messages as ffout/fferr instead of always stderr#941PiedPiper911 wants to merge 2 commits into
PiedPiper911 wants to merge 2 commits into
Conversation
…derr FFmpeg writes virtually all output (including informational messages like version info, stream details, progress) to stderr. Previously every log event had type "stderr", making it impossible to distinguish errors. Now messages are classified by content: - "ffout": informational stderr output (progress, stream info, etc.) - "fferr": actual error messages ([error], [fatal], "not found", etc.) - "stdout": unchanged (from print()) Fixes ffmpegwasm#877
✅ Deploy Preview for ffmpegwasm canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #877 -
ffmpeg.on('log')always reportstype: "stderr"regardless of whether the output is an error or informational message.Root Cause
FFmpeg natively writes virtually ALL its output to stderr -- including version info, stream details, encoding progress, and other informational messages. This is by design in native FFmpeg. So the
printErr()callback inbind.jsgets called for everything, and every log event getstype: "stderr".Fix
Modified
printErr()insrc/bind/ffmpeg/bind.jsto classify messages by content:"ffout": Informational stderr output (progress bars, stream info, version, etc.)"fferr": Actual error messages matching patterns like[error],[fatal],not found,invalid,cannot, etc."stdout": Unchanged (fromprint())Breaking Change Note
Users who were checking
type === "stderr"will need to update totype === "fferr"for error detection. This is a deliberate API improvement -- the old behavior was the bug itself.Changes
src/bind/ffmpeg/bind.js: AddedFFMPEG_ERROR_PATTERNSregex array and classification logic inprintErr()packages/types/types/index.d.ts: UpdatedLog.typeJSDoc to document new valuesTest plan
"ffout", never"stderr""fferr"stdoutlogs still work unchanged