mirror of
https://github.com/Luzifer/cam2mjpeg.git
synced 2024-11-09 22:20:03 +00:00
Hide ffmpeg logs by default
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
8d7625aacd
commit
ce8b98b9cb
1 changed files with 4 additions and 1 deletions
5
main.go
5
main.go
|
@ -19,6 +19,7 @@ import (
|
||||||
var (
|
var (
|
||||||
cfg = struct {
|
cfg = struct {
|
||||||
Device string `flag:"input,i" default:"/dev/video0" description:"Video device to read from"`
|
Device string `flag:"input,i" default:"/dev/video0" description:"Video device to read from"`
|
||||||
|
FFMpegLog bool `flag:"ffmpeg-log" default:"false" description:"Send ffmpeg logs to stderr"`
|
||||||
FrameRate int `flag:"rate,r" default:"10" description:"Frame rate to show in MJPEG"`
|
FrameRate int `flag:"rate,r" default:"10" description:"Frame rate to show in MJPEG"`
|
||||||
Height int `flag:"height,h" default:"720" description:"Height of video frames"`
|
Height int `flag:"height,h" default:"720" description:"Height of video frames"`
|
||||||
Listen string `flag:"listen" default:":3000" description:"Port/IP to listen on"`
|
Listen string `flag:"listen" default:":3000" description:"Port/IP to listen on"`
|
||||||
|
@ -79,7 +80,9 @@ func main() {
|
||||||
"-f", "image2pipe",
|
"-f", "image2pipe",
|
||||||
"-")
|
"-")
|
||||||
|
|
||||||
cmd.Stderr = os.Stderr
|
if cfg.FFMpegLog {
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
}
|
||||||
|
|
||||||
out, err := cmd.StdoutPipe()
|
out, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue