revid-cli: removed concept of mpegtsrtp packetization as not needed anymore

This commit is contained in:
saxon 2018-11-25 23:24:03 +10:30
parent 5920d1c8d7
commit 218dcfb8b2
1 changed files with 35 additions and 19 deletions

View File

@ -52,7 +52,8 @@ const (
const ( const (
inputPtr = iota inputPtr = iota
inputCodecPtr inputCodecPtr
outputPtr output1Ptr
output2Ptr
rtmpMethodPtr rtmpMethodPtr
packetizationPtr packetizationPtr
quantizationModePtr quantizationModePtr
@ -107,9 +108,9 @@ var (
flagNames = [noOfConfigFlags]struct{ name, description string }{ flagNames = [noOfConfigFlags]struct{ name, description string }{
{"Input", "The input type: Raspivid, File"}, {"Input", "The input type: Raspivid, File"},
{"InputCodec", "The codec of the input: H264, Mjpeg"}, {"InputCodec", "The codec of the input: H264, Mjpeg"},
{"Output", "The output type: Http, Rtmp, File, Udp, Rtp"}, {"Output1", "The first output type: Http, Rtmp, File, Udp, Rtp"},
{"Output2", "The second output type: Http, Rtmp, File, Udp, Rtp"},
{"RtmpMethod", "The method used to send over rtmp: Ffmpeg, Librtmp"}, {"RtmpMethod", "The method used to send over rtmp: Ffmpeg, Librtmp"},
// NOTE: we add rtp here when we have this functionality
{"Packetization", "The method of data packetisation: Flv, Mpegts, None"}, {"Packetization", "The method of data packetisation: Flv, Mpegts, None"},
{"QuantizationMode", "Whether quantization if on or off (variable bitrate): On, Off"}, {"QuantizationMode", "Whether quantization if on or off (variable bitrate): On, Off"},
{"Verbosity", "Verbosity: Info, Warning, Error, Fatal"}, {"Verbosity", "Verbosity: Info, Warning, Error, Fatal"},
@ -202,23 +203,40 @@ func handleFlags() {
logger.Log(smartlogger.Error, pkg+"bad input codec argument") logger.Log(smartlogger.Error, pkg+"bad input codec argument")
} }
switch *configFlags[outputPtr] { switch *configFlags[output1Ptr] {
case "File": case "File":
config.Output = revid.File config.Output1 = revid.File
case "Http": case "Http":
config.Output = revid.Http config.Output1 = revid.Http
case "Rtmp": case "Rtmp":
config.Output = revid.Rtmp config.Output1 = revid.Rtmp
case "FfmpegRtmp": case "FfmpegRtmp":
config.Output = revid.FfmpegRtmp config.Output1 = revid.FfmpegRtmp
case "Udp": case "Udp":
config.Output = revid.Udp config.Output1 = revid.Udp
case "Rtp": case "Rtp":
config.Output = revid.Rtp config.Output1 = revid.Rtp
config.Packetization = revid.MpegtsRtp
case "": case "":
default: default:
logger.Log(smartlogger.Error, pkg+"bad output argument") logger.Log(smartlogger.Error, pkg+"bad output 1 argument")
}
switch *configFlags[output2Ptr] {
case "File":
config.Output2 = revid.File
case "Http":
config.Output2 = revid.Http
case "Rtmp":
config.Output2 = revid.Rtmp
case "FfmpegRtmp":
config.Output2 = revid.FfmpegRtmp
case "Udp":
config.Output2 = revid.Udp
case "Rtp":
config.Output2 = revid.Rtp
case "":
default:
logger.Log(smartlogger.Error, pkg+"bad output 2 argument")
} }
switch *configFlags[rtmpMethodPtr] { switch *configFlags[rtmpMethodPtr] {
@ -238,8 +256,6 @@ func handleFlags() {
config.Packetization = revid.Mpegts config.Packetization = revid.Mpegts
case "Flv": case "Flv":
config.Packetization = revid.Flv config.Packetization = revid.Flv
case "MpegtsRtp":
config.Packetization = revid.MpegtsRtp
case "": case "":
default: default:
logger.Log(smartlogger.Error, pkg+"bad packetization argument") logger.Log(smartlogger.Error, pkg+"bad packetization argument")
@ -418,15 +434,15 @@ func updateRevid(ns *netsender.Sender, vars map[string]string, stop bool) error
case "Output": case "Output":
switch value { switch value {
case "File": case "File":
config.Output = revid.File config.Output1 = revid.File
case "Http": case "Http":
config.Output = revid.Http config.Output1 = revid.Http
case "Rtmp": case "Rtmp":
config.Output = revid.Rtmp config.Output1 = revid.Rtmp
case "FfmpegRtmp": case "FfmpegRtmp":
config.Output = revid.FfmpegRtmp config.Output1 = revid.FfmpegRtmp
default: default:
logger.Log(smartlogger.Warning, pkg+"invalid Output param", "value", value) logger.Log(smartlogger.Warning, pkg+"invalid Output1 param", "value", value)
continue continue
} }
case "FramesPerClip": case "FramesPerClip":