mirror of https://bitbucket.org/ausocean/av.git
Auto stash before merge of "rtmpOutputFunctionality" and "origin/rtmpOutputFunctionality"
This commit is contained in:
parent
d718534f0f
commit
431b2c4a5f
|
@ -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:
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue