fix stderr output - #53
Closed
gjrtimmer wants to merge 2 commits into
Closed
Conversation
ffmpeg pipes video output to downstream processes via stdout. Diagnostic and error messages on stdout corrupt the pipe output. Change all std::cout to std::cerr for error/status messages in NVMPI_frameBuf, nvmpi_dec, and nvmpi_enc. Based on: Keylost#15 Co-Authored-By: Andrew Reiter <madsciencetist@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Additional stdout messages missed by the initial stderr fix: - nvmpi_dec: cout "Error DQing buffer" and printf "NvBufferMap failed" - nvmpi_enc: cout "Error while dequeing", printf EAGAIN warning, and cout "Error DQing buffer" All diagnostic output now goes to stderr to prevent corruption of piped video streams. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
ffmpeg pipes video output to downstream processes via stdout. Any diagnostic or error messages written to stdout corrupt the piped stream. This PR redirects all remaining stdout messages to stderr.
Changes
TEST_ERRORmacro innvmpi_dec.cppandnvmpi_enc.cpp:std::cout→std::cerrNVMPI_frameBuf.cpp: all 4std::couterror messages →std::cerrnvmpi_dec.cpp:cout "Error DQing buffer"→cerr,printf "NvBufferMap failed"→fprintf(stderr, ...)nvmpi_dec.cpp:std::cout "Error Qing buffer"→std::cerrnvmpi_enc.cpp:cout "Error while dequeing"→cerr,cout "Error DQing buffer"→cerrnvmpi_enc.cpp:printfEAGAIN warning →fprintf(stderr, ...)Context
Extends the scope of #15 which covered some but not all stdout messages. This PR covers every active
cout/printfcall across all three source files. The only remainingcoutis inside a/* */comment block (dead code).Test plan