revid: added flag options to usage output

This commit is contained in:
saxon 2018-08-22 13:45:20 +09:30
parent cacf89e499
commit 0def69f012
1 changed files with 13 additions and 12 deletions

View File

@ -98,13 +98,14 @@ func main() {
cpuprofile := flag.String("cpuprofile", "", "write cpu profile to `file`") cpuprofile := flag.String("cpuprofile", "", "write cpu profile to `file`")
flagNames := [noOfConfigFlags]struct{ name, description string }{ flagNames := [noOfConfigFlags]struct{ name, description string }{
{"Input", "The input type"}, {"Input", "The input type: Raspivid, File"},
{"InputCodec", "The codec of the input"}, {"InputCodec", "The codec of the input: H264, Mjpeg"},
{"Output", "The output type"}, {"Output", "The output type: Http, Rtmp, File"},
{"RtmpMethod", "The method used to send over rtmp (ffmpeg or librtmp)"}, {"RtmpMethod", "The method used to send over rtmp: Ffmpeg, Librtmp"},
{"Packetization", "The method of data packetisation"}, // NOTE: we add rtp here when we have this functionality
{"QuantizationMode", "The level of quantization"}, {"Packetization", "The method of data packetisation: Flv, Mpegts, None"},
{"Verbosity", "Verbosity on or off"}, {"QuantizationMode", "Whether quantization if on or off (variable bitrate): On, Off"},
{"Verbosity", "Verbosity: On, Off"},
{"FramesPerClip", "Number of frames per clip sent"}, {"FramesPerClip", "Number of frames per clip sent"},
{"RtmpUrl", "Url of rtmp endpoint"}, {"RtmpUrl", "Url of rtmp endpoint"},
{"Bitrate", "Bitrate of recorded video"}, {"Bitrate", "Bitrate of recorded video"},
@ -114,11 +115,11 @@ func main() {
{"Width", "Width in pixels"}, {"Width", "Width in pixels"},
{"FrameRate", "Frame rate of captured video"}, {"FrameRate", "Frame rate of captured video"},
{"HttpAddress", "Destination address of http posts"}, {"HttpAddress", "Destination address of http posts"},
{"Quantization", "Desired quantization value"}, {"Quantization", "Desired quantization value: 0-40"},
{"Timeout", "Http timeout in seconds"}, {"Timeout", "Http timeout in seconds"},
{"IntraRefreshPeriod", "The IntraRefreshPeriod i.e. how many keyframes we send"}, {"IntraRefreshPeriod", "The IntraRefreshPeriod i.e. how many keyframes we send"},
{"VerticalFlip", "Flip video vertically"}, {"VerticalFlip", "Flip video vertically: Yes, No"},
{"HorizontalFlip", "Flip video horizontally"}, {"HorizontalFlip", "Flip video horizontally: Yes, No"},
} }
// Create the configFlags based on the flagNames array // Create the configFlags based on the flagNames array
@ -281,11 +282,11 @@ func main() {
// initialize then run the main NetSender client // initialize then run the main NetSender client
func run() error { func run() error {
// initialize NetSender and use NetSender's logger // initialize NetSender and use NetSender's logger
config.Logger = netsender.Logger() //config.Logger = netsender.Logger()
config.Logger.Log(progName, "Info", "Running in NetSender mode") config.Logger.Log(progName, "Info", "Running in NetSender mode")
var ns netsender.Sender var ns netsender.Sender
err := ns.Init(nil, nil, nil) err := ns.Init(nil, nil, nil, nil)
if err != nil { if err != nil {
return err return err
} }