Skip to content

fix stderr output - #53

Closed
gjrtimmer wants to merge 2 commits into
Keylost:masterfrom
gjrtimmer:fix/stderr-output
Closed

fix stderr output#53
gjrtimmer wants to merge 2 commits into
Keylost:masterfrom
gjrtimmer:fix/stderr-output

Conversation

@gjrtimmer

@gjrtimmer gjrtimmer commented Jun 11, 2026

Copy link
Copy Markdown

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_ERROR macro in nvmpi_dec.cpp and nvmpi_enc.cpp: std::coutstd::cerr
  • NVMPI_frameBuf.cpp: all 4 std::cout error messages → std::cerr
  • nvmpi_dec.cpp: cout "Error DQing buffer"cerr, printf "NvBufferMap failed"fprintf(stderr, ...)
  • nvmpi_dec.cpp: std::cout "Error Qing buffer"std::cerr
  • nvmpi_enc.cpp: cout "Error while dequeing"cerr, cout "Error DQing buffer"cerr
  • nvmpi_enc.cpp: printf EAGAIN warning → fprintf(stderr, ...)

Context

Extends the scope of #15 which covered some but not all stdout messages. This PR covers every active cout/printf call across all three source files. The only remaining cout is inside a /* */ comment block (dead code).

Test plan

  • Pipe ffmpeg output through nvmpi decoder/encoder to a downstream process and verify no diagnostic text appears in the video stream
  • Trigger error conditions and verify messages appear on stderr

gjrtimmer and others added 2 commits June 11, 2026 04:51
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>
@gjrtimmer gjrtimmer changed the title Fix/stderr output fix stderr output Jun 11, 2026
@gjrtimmer gjrtimmer closed this Jun 14, 2026
@gjrtimmer
gjrtimmer deleted the fix/stderr-output branch June 14, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant