mirror of
https://github.com/gen2brain/cam2ip.git
synced 2026-01-08 15:48:30 +00:00
Add timestamp option
This commit is contained in:
@@ -27,6 +27,7 @@ func main() {
|
||||
flag.Float64Var(&srv.FrameHeight, "height", 480, "Frame height")
|
||||
flag.IntVar(&srv.Rotate, "rotate", 0, "Rotate image, valid values are 90, 180, 270")
|
||||
flag.BoolVar(&srv.NoWebGL, "nowebgl", false, "Disable WebGL drawing of images (html handler)")
|
||||
flag.BoolVar(&srv.Timestamp, "timestamp", false, "Draws timestamp on images")
|
||||
flag.StringVar(&srv.Bind, "bind-addr", ":56000", "Bind address")
|
||||
flag.StringVar(&srv.Htpasswd, "htpasswd-file", "", "Path to htpasswd file, if empty auth is disabled")
|
||||
|
||||
@@ -52,7 +53,7 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
cam, err := camera.New(camera.Options{srv.Index, srv.Rotate, srv.FrameWidth, srv.FrameHeight})
|
||||
cam, err := camera.New(camera.Options{srv.Index, srv.Rotate, srv.FrameWidth, srv.FrameHeight, srv.Timestamp})
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
|
||||
os.Exit(1)
|
||||
|
||||
@@ -28,6 +28,7 @@ func main() {
|
||||
flag.Float64Var(&srv.FrameHeight, "height", 480, "Frame height")
|
||||
flag.IntVar(&srv.Rotate, "rotate", 0, "Rotate image, valid values are 90, 180, 270")
|
||||
flag.BoolVar(&srv.NoWebGL, "nowebgl", false, "Disable WebGL drawing of images (html handler)")
|
||||
flag.BoolVar(&srv.Timestamp, "timestamp", false, "Draws timestamp on images")
|
||||
flag.StringVar(&srv.Bind, "bind-addr", ":56000", "Bind address")
|
||||
flag.StringVar(&srv.Htpasswd, "htpasswd-file", "", "Path to htpasswd file, if empty auth is disabled")
|
||||
flag.StringVar(&srv.FileName, "video-file", "", "Use video file instead of camera")
|
||||
@@ -63,7 +64,7 @@ func main() {
|
||||
|
||||
srv.Reader = vid
|
||||
} else {
|
||||
cam, err := camera.New(camera.Options{srv.Index, srv.Rotate, srv.FrameWidth, srv.FrameHeight})
|
||||
cam, err := camera.New(camera.Options{srv.Index, srv.Rotate, srv.FrameWidth, srv.FrameHeight, srv.Timestamp})
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
|
||||
os.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user