mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
broadcast url in config.
This commit is contained in:
parent
194fd29679
commit
c34a76c8a3
@ -102,7 +102,7 @@ func New(desktop types.DesktopManager, config *config.Capture) *CaptureManagerCt
|
|||||||
"! x264enc threads=4 bitrate=%d key-int-max=15 byte-stream=true tune=zerolatency speed-preset=%s "+
|
"! x264enc threads=4 bitrate=%d key-int-max=15 byte-stream=true tune=zerolatency speed-preset=%s "+
|
||||||
"! mux.", url, config.AudioDevice, config.BroadcastAudioBitrate*1000, config.Display, config.BroadcastVideoBitrate, config.BroadcastPreset,
|
"! mux.", url, config.AudioDevice, config.BroadcastAudioBitrate*1000, config.Display, config.BroadcastVideoBitrate, config.BroadcastPreset,
|
||||||
), nil
|
), nil
|
||||||
}, ""),
|
}, config.BroadcastUrl),
|
||||||
screencast: screencastNew(config.ScreencastEnabled, func() string {
|
screencast: screencastNew(config.ScreencastEnabled, func() string {
|
||||||
if config.ScreencastPipeline != "" {
|
if config.ScreencastPipeline != "" {
|
||||||
// replace {display} with valid display
|
// replace {display} with valid display
|
||||||
|
@ -28,6 +28,7 @@ type Capture struct {
|
|||||||
BroadcastVideoBitrate int
|
BroadcastVideoBitrate int
|
||||||
BroadcastPreset string
|
BroadcastPreset string
|
||||||
BroadcastPipeline string
|
BroadcastPipeline string
|
||||||
|
BroadcastUrl string
|
||||||
|
|
||||||
ScreencastEnabled bool
|
ScreencastEnabled bool
|
||||||
ScreencastRate string
|
ScreencastRate string
|
||||||
@ -97,6 +98,11 @@ func (Capture) Init(cmd *cobra.Command) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd.PersistentFlags().String("capture.broadcast.url", "", "initial URL for broadcasting, setting this value will automatically start broadcasting")
|
||||||
|
if err := viper.BindPFlag("capture.broadcast.url", cmd.PersistentFlags().Lookup("capture.broadcast.url")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// screencast
|
// screencast
|
||||||
cmd.PersistentFlags().Bool("capture.screencast.enabled", false, "enable screencast")
|
cmd.PersistentFlags().Bool("capture.screencast.enabled", false, "enable screencast")
|
||||||
if err := viper.BindPFlag("capture.screencast.enabled", cmd.PersistentFlags().Lookup("capture.screencast.enabled")); err != nil {
|
if err := viper.BindPFlag("capture.screencast.enabled", cmd.PersistentFlags().Lookup("capture.screencast.enabled")); err != nil {
|
||||||
@ -211,6 +217,7 @@ func (s *Capture) Set() {
|
|||||||
s.BroadcastVideoBitrate = viper.GetInt("capture.broadcast.video_bitrate")
|
s.BroadcastVideoBitrate = viper.GetInt("capture.broadcast.video_bitrate")
|
||||||
s.BroadcastPreset = viper.GetString("capture.broadcast.preset")
|
s.BroadcastPreset = viper.GetString("capture.broadcast.preset")
|
||||||
s.BroadcastPipeline = viper.GetString("capture.broadcast.pipeline")
|
s.BroadcastPipeline = viper.GetString("capture.broadcast.pipeline")
|
||||||
|
s.BroadcastUrl = viper.GetString("capture.broadcast.url")
|
||||||
|
|
||||||
// screencast
|
// screencast
|
||||||
s.ScreencastEnabled = viper.GetBool("capture.screencast.enabled")
|
s.ScreencastEnabled = viper.GetBool("capture.screencast.enabled")
|
||||||
|
Loading…
Reference in New Issue
Block a user