[Improvement] When using HLS camera streamer, generate frame snapshot only once a second#755
Merged
guysoft merged 1 commit intoguysoft:develfrom Nov 8, 2021
Merged
Conversation
bac1fbf to
b1f8449
Compare
Owner
|
Related to #650 |
Contributor
|
Looks good! Never thought thats the JPEG stream consuming most of CPU. |
Contributor
Author
Was surprised as well.. initially was just wondering why the hardware accelerated h264_omx would use so many CPU cycles until priming in on the non-accelerated MJPEG encoding. Btw, thanks for this amazing project & your folks' work! |
Owner
|
Thank you for your contribution! |
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.
When using the experimental HLS camera streamer, an image snapshot is being generated for each frame, encoded to JPG and atomically written to the filesystem.
This creates a huge CPU cycle and IO burden at the configured 30 fps - when running on a Raspberry 3B, the current setup consumes over ~70% CPU.
With this PR, ffmpeg is configured to only generate a snapshot once a second, reducing the resulting CPU load to ~20% on a RP 3B.