Skip to content

Commit b18f80e

Browse files
committed
Fix video mode for V4L2 cameras
1 parent 9898083 commit b18f80e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

server/videostream.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,18 +482,18 @@ class videoStream {
482482
let callbackCalled = false;
483483
let stdoutBuffer = ''; // Buffer for accumulating data chunks
484484

485-
// Importing cv2 and Picamera2 on a Pi can take 6-10 seconds.
486-
// Safety Timeout: If nothing happens in 15 seconds, unblock the UI
485+
// Importing cv2 and Picamera2 on a Pi can take a minute or more
486+
// Safety Timeout: If nothing happens in 60 seconds, unblock the UI
487487
const timeout = setTimeout(() => {
488488

489489
if (!callbackCalled) {
490490
callbackCalled = true;
491-
console.log(`${modeName}: No response from script after 15s, assuming start.`);
491+
console.log(`${modeName}: No response from script after 60s, assuming start.`);
492492
this.active = true;
493493
this.saveSettings();
494494
callback(null, { active: true, addresses: this.deviceAddresses });
495495
}
496-
}, 15000);
496+
}, 60000);
497497

498498
this.deviceStream.on('error', (err) => {
499499
clearTimeout(timeout);

src/video.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ class VideoPage extends basePage {
392392
width: capsObj.width,
393393
format: capsObj.format,
394394
rotation: this.state.rotSelected,
395-
fps: this.state.fpsSelected,
396-
bitrate: this.state.bitrate,
395+
fps: parseInt(this.state.fpsSelected), // Make sure FPS is an integer
396+
bitrate: parseInt(this.state.bitrate), // Make sure bitrate is an integer
397397
useUDP: this.state.transportSelected === 'RTP',
398398
useUDPIP: this.state.useUDPIP,
399399
useUDPPort: this.state.useUDPPort,

0 commit comments

Comments
 (0)