diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index c4729b2a..98804a5b 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -116,7 +116,6 @@ func handleFlags() revid.Config { outputPathPtr = flag.String("OutputPath", "", "The directory of the output file") inputFilePtr = flag.String("InputPath", "", "The directory of the input file") httpAddressPtr = flag.String("HttpAddress", "", "Destination address of http posts") - sendRetryPtr = flag.Bool("retry", false, "Specify whether a failed send should be retried.") verticalFlipPtr = flag.Bool("VerticalFlip", false, "Flip video vertically: Yes, No") horizontalFlipPtr = flag.Bool("HorizontalFlip", false, "Flip video horizontally: Yes, No") framesPerClipPtr = flag.Uint("FramesPerClip", 0, "Number of frames per clip sent") @@ -228,7 +227,6 @@ func handleFlags() revid.Config { cfg.Quantization = *quantizationPtr cfg.IntraRefreshPeriod = *intraRefreshPeriodPtr cfg.RTPAddress = *rtpAddrPtr - cfg.SendRetry = *sendRetryPtr cfg.Brightness = *brightnessPtr cfg.Saturation = *saturationPtr cfg.Exposure = *exposurePtr diff --git a/revid/config.go b/revid/config.go index b71256a1..b33eb7ad 100644 --- a/revid/config.go +++ b/revid/config.go @@ -153,36 +153,69 @@ type Config struct { Outputs []uint8 // Quantize specifies whether the input to revid will have constant or variable - // bitrate. + // bitrate, if configurable with the chosen input. Raspivid supports quantization. Quantize bool - // FlipHorizonatla and FlipVertical specify whether video frames should be flipped. - FlipHorizontal bool - FlipVertical bool - + // FramesPerClip defines the number of packetization units to pack into a clip + // per HTTP send. FramesPerClip uint - // RtmpUrl specifies the Rtmp output destination URL. This must be defined if + // RTMPURL specifies the Rtmp output destination URL. This must be defined if // RTMP is to be used as an output. - RTMPURL string - Bitrate uint - OutputPath string - InputPath string - Height uint - Width uint - FrameRate uint - HTTPAddress string - Quantization uint + RTMPURL string + + // OutputPath defines the output destination for File output. This must be + // defined if File output is to be used. + OutputPath string + + // InputPath defines the input file location for File Input. This must be + // defined if File input is to be used. + InputPath string + + // FrameRate defines the input frame rate if configurable by the chosen input. + // Raspivid input supports custom framerate. + FrameRate uint + + // HTTPAddress defines a custom HTTP destination if we do not wish to use that + // defined in /etc/netsender.conf. + HTTPAddress string + + // Quantization defines the quantization level, which may be a value between + // 0-40. This will only take effect if the Quantize field is true and if we + // are using Raspivid input. + Quantization uint + + // IntraRefreshPeriod defines the frequency of video parameter NAL units for + // Raspivid input. IntraRefreshPeriod uint - RTPAddress string - Logger Logger - SendRetry bool - BurstPeriod uint - Rotation uint - Brightness uint - Saturation int - Exposure string - AutoWhiteBalance string + + // Logger holds an implementation of the Logger interface as defined in revid.go. + // This must be set for revid to work correctly. + Logger Logger + + // Brightness and saturation define the brightness and saturation levels for + // Raspivid input. + Brightness uint + Saturation int + + // Exposure defines the exposure mode used by the Raspivid input. Valid modes + // are defined in the exported []string ExposureModes defined at the start + // of the file. + Exposure string + + // AutoWhiteBalance defines the auto white balance mode used by Raspivid input. + // Valid modes are defined in the exported []string AutoWhiteBalanceModes + // defined at the start of the file. + AutoWhiteBalance string + + RTPAddress string // RTPAddress defines the RTP output destination. + BurstPeriod uint // BurstPeriod defines the revid burst period in seconds. + Rotation uint // Rotation defines the video rotation angle in degrees Raspivid input. + Height uint // Height defines the input video height Raspivid input. + Width uint // Width defines the input video width Raspivid input. + Bitrate uint // Bitrate specifies the input bitrate for Raspivid input. + FlipHorizontal bool // FlipHorizontal flips video horizontally for Raspivid input. + FlipVertical bool // FlipVertial flips video vertically for Raspivid input. } // Validate checks for any errors in the config fields and defaults settings @@ -251,7 +284,6 @@ func (c *Config) Validate(r *Revid) error { } c.Logger.Log(logger.Info, pkg+"defaulting frames per clip for rtmp out", "framesPerClip", defaultFramesPerClip) c.FramesPerClip = defaultFramesPerClip - c.SendRetry = true case HTTP, RTP: c.Logger.Log(logger.Info, pkg+"defaulting frames per clip for http out", "framesPerClip", httpFramesPerClip) c.FramesPerClip = httpFramesPerClip