FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix issue #195. Redirect stdout/err to /dev/null by 0x3333 · Pull Request #417 · kkroening/ffmpeg-python · GitHub

Fix issue #195. Redirect stdout/err to /dev/null - #417

Merged
depau merged 2 commits into
kkroening:masterfrom
0x3333:master
Dec 6, 2020
Merged

depau merged 2 commits into
kkroening:masterfrom
0x3333:master

Conversation

0x3333 commented Sep 16, 2020

Copy link
Copy Markdown
Contributor

Fixes #195

Redirect stdout/stderr to DEVNULL when quiet is requested, otherwise, the buffer will be filled until a MemoryError on long encodings.

0x3333 commented Oct 14, 2020

Copy link
Copy Markdown
Contributor Author

Any news on this one? Straightforward change

0x3333 commented Oct 19, 2020

Copy link
Copy Markdown
Contributor Author

@kkroening

Copy link
Copy Markdown

Have you already tested the code?
I used the same fix, but problem still exists.

0x3333 commented Oct 30, 2020

Copy link
Copy Markdown
Contributor Author

@ArchieMeng could you check with the latest version? I changed it slightly to cover all cases.

I tested in my use case, which is:

        self._ffmpeg_proc = (
            ffmpeg.input("pipe:", format="rawvideo", pix_fmt="yuyv422", s=resolution, framerate=cfg().calculate_fps())
            .output(self._filename, vcodec=cfg().record_codec)
            .overwrite_output()
            .run_async(pipe_stdin=True, quiet=True)
        )

depau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can someone else please confirm that this works as intended?

Copy link
Copy Markdown

Patched and running fine in v0.2.0. Here's how run_async is being called:

def run(self):
  """
  Run channel encoder
  """

  self.process = (
    self.output.run_async(
      quiet=self.quiet
    )
  )
  self.print("Running")

  return_code = self.process.wait()
  if return_code:
    self.print(f"Exited with code {return_code}")

0x3333 commented Dec 5, 2020

Copy link
Copy Markdown
Contributor Author

Just for the record, the secret here is to redirect stderr to stdout and then redirect stdout to /dev/null, otherwise, it doesn't work redirecting both to /dev/null.

depau merged commit 0612a44 into kkroening:master Dec 6, 2020

depau commented Dec 6, 2020

Copy link
Copy Markdown
Collaborator

Just for the record, the secret here is to redirect stderr to stdout and then redirect stdout to /dev/null, otherwise, it doesn't work redirecting both to /dev/null.

That's a weird bug 🤔

Copy link
Copy Markdown

Yes. It works. Thank you.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quiet mode for run_async method might cause ffmpeg process to stick.

4 participants


Back | FazBrowse Home | New Git URL