homebridge / camera-utils

Utilities to simplify homebridge camera plugin development
18 stars 8 forks source link

ffmpeg: Add optional stdout callback #584

Closed kkuehlz closed 10 months ago

kkuehlz commented 10 months ago

:recycle: Current situation

When using ffmpeg, there are situations where it's nice to simply stream the output the stdout, especially when post-processing is intended to be done within the same program that launched ffmpeg. Right now, if you set the output to -, there is no way for the caller to capture that output.

I am using the ring-client-api, which depends on this class for transcoding the livestream. If I can get this merged, adding a PR to that repo will be next in order. https://github.com/dgreif/ring/blob/4b4e5611bafddc8ca4ad5baba35335c05879b5cc/packages/ring-client-api/streaming/streaming-session.ts#L132-L139

:bulb: Proposed solution

Add an optional callback for the user to process stdout data.

:gear: Release Notes

Provide a summary of the changes or features from a user's point of view. If there are breaking changes, provide migration guides using code examples of the affected features.

New option stdoutCallback added to FfmpegOptions struct. If you accept this PR, can you do a release so I can update the dependency in ring-client-api?

donavanbecker commented 10 months ago

@keur once you have resolved @dgreif comments, I will merge this into a beta where we have also update dependencies and then we can get a new beta version out.

kkuehlz commented 10 months ago

@keur once you have resolved @dgreif comments, I will merge this into a beta where we have also update dependencies and then we can get a new beta version out.

@donavanbecker Done. Btw, since you changed the base branch, it included a Discord Webhooks from latest as part of this diff. So I re-created my branch off beta-2.2.5 and force pushed.

donavanbecker commented 10 months ago

@keur once you have resolved @dgreif comments, I will merge this into a beta where we have also update dependencies and then we can get a new beta version out.

@donavanbecker Done. Btw, since you changed the base branch, it included a Discord Webhooks from latest as part of this diff. So I re-created my branch off beta-2.2.5 and force pushed.

yep that was in the latest branch already

coveralls commented 10 months ago

Pull Request Test Coverage Report for Build 7452778478

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report. To ensure accuracy in future PRs, please see these guidelines. A quick fix for this PR: rebase it; your next report should be accurate.


Totals Coverage Status
Change from base Build 7452346226: -0.5%
Covered Lines: 68
Relevant Lines: 183

💛 - Coveralls
donavanbecker commented 10 months ago

@keur 2.2.5 has been released

kkuehlz commented 10 months ago

@keur 2.2.5 has been released

Thank you so much!!