Skip to content

Commit

Permalink
Camera: Add a timeout to ffmpeg to prevent it from running forever (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Jun 30, 2023
1 parent ec0eed7 commit b19cff3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/services/rtsp-camera/lib/getImage.js
Original file line number Diff line number Diff line change
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

0 comments on commit b19cff3

Please sign in to comment.