Project

General

Profile

Actions

Feature #741

closed

Add option to run in low-res mode

Added by Hammel almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
Webcam
Start date:
17 Feb 2020
Due date:
% Done:

100%

Estimated time:
Severity:
03 - Medium

Description

The UI needs to default to low-res mode (5 or 10 fps) with an option to run at high-res (30fps).
This means an additional Message Action type for MT_STREAM: MA_START_LOW.
This implies the following:
  • handleStream: adds msgAction case for MA_START_LOW that is the same as MA_START, but passes the msgAction value to spawnStream.
  • spawnStream: accepts msgAction type argument.
  • spawnStream: uses msgAction argument to select the FPS and builds command with that.

If I do this then I can use the media system as a web cam at the house, using an ssh tunnel to the Pi's. Using the phone at 30fps works but is really, really slow and falls behind quickly. I think slowing down the frame rate (and maybe the video size) would help.

Actions #1

Updated by Hammel almost 5 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

The description only mentions what should be done with piboxd. I need to map out what piboxwww has to have changed too.

  1. webcam(): default to low-res (action=3 instead of 1)
  2. webcam.tmpl: add hires() function that adds res=high to URL.
  3. webcam.tmpl: change reload() function to pass res=low in URL.
  4. webcam(): Use $_GET["res"] to determine if action should be 1 instead of 3.

Also, the "Reload" button should now say "High Res" and add a new button that says "Low Res" in webcam.tmpl.

That should allow hi vs low resolution when requesting the stream from piboxd.

Actions #2

Updated by Hammel almost 5 years ago

  • % Done changed from 10 to 20

This will likely work, but there is an underlying bug that needs to be fixed first: The use of TAG to add state doesn't work. This means that "Quit" or restarting at a different resolution doesn't work. The backgrounded mjpeg-streamer process keeps running.

The simple fix (but not ideal) is to stop associating the request with the tag. Every new inbound request kills the currently running process before restarting it with a new config.

Now working on implementing that fix.

Actions #3

Updated by Hammel almost 5 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 20 to 100

Done. High and low res options work on the web interface. Console interface is always hi res. Switching resolution or device will always restart the server so only one person at a time can view it. Low-res works much better on my phone over 4G (i think, maybe 3G?).

Tested, committed to both repos (piboxd and piboxwww) and pushed.

Closing issue.

Actions

Also available in: Atom PDF