Skip to content

Fix streamer2#1

Merged
npostavs merged 2 commits intonpostavs:streamer2.np.qprocfrom
hoffie:fix-streamer2
Feb 13, 2021
Merged

Fix streamer2#1
npostavs merged 2 commits intonpostavs:streamer2.np.qprocfrom
hoffie:fix-streamer2

Conversation

@hoffie
Copy link
Copy Markdown

@hoffie hoffie commented Feb 12, 2021

This PR attempts to fix the QProcess-based ffmpeg invocation:

  • It adds proper logging on ffmpeg exits by adding a ::finished handler and upping the ffmpeg loglevel so that something sane is output.
  • It stops adding "ffmpeg" as the first argument as this seems to be done implicitly by QProcess (spotted using strace)
  • It adds support for parsing space-delimited multiple arguments for ffmpeg. Otherwise, only a single argument would be supported and things like --streamto "-f mp3 /tmp/foo" would break.

Note: The crazy override for the ::finished handler is described here: https://doc.qt.io/qt-5/qprocess.html#finished

cc @npostavs @dingodoppelt

Signed-off-by: Christian Hoffmann <mail@hoffmann-christian.info>
- QProcess automatically populates argv[0]. Explicitly passing
  "ffmpeg" as first argument will end up as argv[1] and will break
  ffmpeg.
- Increase ffmpeg log level to "error" so that startup errors are
  really output.
- Add support for space-delimited multiple parameters for the
  --streamto argument.

Signed-off-by: Christian Hoffmann <mail@hoffmann-christian.info>
@npostavs
Copy link
Copy Markdown
Owner

  • It stops adding "ffmpeg" as the first argument as this seems to be done implicitly by QProcess (spotted using strace)

Aha!

@npostavs npostavs merged commit a0d8b74 into npostavs:streamer2.np.qproc Feb 13, 2021
npostavs pushed a commit that referenced this pull request Mar 7, 2021
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.

2 participants