Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera: Add a timeout to ffmpeg to prevent it from running forever #1821

Merged
merged 1 commit into from Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions server/services/rtsp-camera/lib/getImage.js
Expand Up @@ -47,8 +47,9 @@ async function getImage(device) {
if (cameraRotationParam.value === '1') {
outputOptions.push('-vf hflip,vflip'); // Rotate 180
}
// and send a camera thumbnail to this stream
this.ffmpeg(cameraUrlParam.value)
// Send a camera thumbnail to this stream
// Add a timeout to prevent ffmpeg from running forever
this.ffmpeg(cameraUrlParam.value, { timeout: 10 })
.format('image2')
.outputOptions(outputOptions)
.output(writeStream)
Expand Down