Auto stash before merge of "rtmpOutputFunctionality" and "origin/rtmpOutputFunctionality"

This commit is contained in:
Unknown 2018-03-14 11:32:22 +10:30
parent d718534f0f
commit 431b2c4a5f
2 changed files with 43 additions and 15 deletions

View File

@ -77,6 +77,8 @@ const (
Revid = 12
Flv = 13
LibRtmp = 14
QuantizationOn = 15
QuantizationOff = 16
)
// Default config settings
@ -88,11 +90,22 @@ const (
defaultTimeout = "0"
defaultQuantization = "40"
defaultBitrate = "0"
defaultQuantizationMode = QuantizationOff
)
// checkConfig checks for any errors in the config files and defaults settings
// if particular parameters have not been defined.
func (config *Config) Validate(r *revidInst) error {
switch config.QuantizationMode {
case QuantizationOn:
case QuantizationOff:
case NothingDefined:
r.Log(Warning, "No quantization mode defined, defaulting to QuantizationOff!")
config.QuantizationMode = QuantizationOff
default:
return errors.New("Bad QuantizationMode define in config!")
}
switch config.Input {
case Rtp:
case Raspivid:

View File

@ -451,24 +451,39 @@ func (r *revidInst) setupOutputForFile() (err error) {
// setupInputForRaspivid sets up things for input from raspivid i.e. starts
// a raspivid process and pipes it's data output.
func (r *revidInst) setupInputForRaspivid() error {
//fps,_ := strconv.Atoi(r.config.FrameRate)
//r.parser.SetDelay( uint( float64(1000) / float64(fps) ) )
r.Log(Info, "Starting raspivid!")
switch r.config.InputCodec {
case H264:
switch r.config.QuantizationMode {
case QuantizationOn:
r.cmd = exec.Command("raspivid",
"-cd", "H264",
"-o", "-",
"-n",
"-t", r.config.Timeout,
"-b", "500000",
//"-qp", r.config.Quantization,
"-b", "0",
"-qp", r.config.Quantization,
"-w", r.config.Width,
"-h", r.config.Height,
"-fps", r.config.FrameRate,
"-ih",
"-g", r.config.IntraRefreshPeriod,
)
case QuantizationOff:
r.cmd = exec.Command("raspivid",
"-cd", "H264",
"-o", "-",
"-n",
"-t", r.config.Timeout,
"-b", r.config.Bitrate,
"-w", r.config.Width,
"-h", r.config.Height,
"-fps", r.config.FrameRate,
"-ih",
"-g", r.config.IntraRefreshPeriod,
)
}
case Mjpeg:
r.cmd = exec.Command("raspivid",
"-cd", "MJPEG",