Skip to content

[Improvement] When using HLS camera streamer, generate frame snapshot only once a second#755

Merged
guysoft merged 1 commit intoguysoft:develfrom
rastapasta:ffmpeg-improvement
Nov 8, 2021
Merged

[Improvement] When using HLS camera streamer, generate frame snapshot only once a second#755
guysoft merged 1 commit intoguysoft:develfrom
rastapasta:ffmpeg-improvement

Conversation

@rastapasta
Copy link
Contributor

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.

@rastapasta rastapasta changed the title [Improvement] When using HLS camera streamer, gerate frame snapshot only once a second [Improvement] When using HLS camera streamer, generate frame snapshot only once a second Nov 7, 2021
@guysoft
Copy link
Owner

guysoft commented Nov 7, 2021

Related to #650
@chudsaviet any comments on this?

@chudsaviet
Copy link
Contributor

chudsaviet commented Nov 8, 2021

Looks good! Never thought thats the JPEG stream consuming most of CPU.

@rastapasta
Copy link
Contributor Author

rastapasta commented Nov 8, 2021

Never thought thats the JPEG stream consuming most of CPU.

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!

@guysoft guysoft merged commit 718790b into guysoft:devel Nov 8, 2021
@guysoft
Copy link
Owner

guysoft commented Nov 8, 2021

Thank you for your contribution!

@rastapasta rastapasta deleted the ffmpeg-improvement branch November 12, 2021 13:18
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.

3 participants