mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-23 19:49:02 +02:00
Use openh264 for broadcast
This commit is contained in:
parent
d298d0c97b
commit
c0c8b05be2
6 changed files with 32 additions and 9 deletions
|
@ -41,7 +41,11 @@ func New(desktop types.DesktopManager, config *config.Capture) *CaptureManagerCt
|
|||
if config.VideoMaxFPS > 0 && config.VideoMaxFPS < fps {
|
||||
fps = config.VideoMaxFPS
|
||||
}
|
||||
return NewVideoPipeline(config.VideoCodec, config.Display, config.VideoPipeline, fps, config.VideoBitrate, config.VideoHWEnc)
|
||||
pipelineStr, err := NewVideoPipeline(config.VideoCodec, config.Display, config.VideoPipeline, fps, config.VideoBitrate, config.VideoHWEnc)
|
||||
|
||||
logger.Info().Msgf("pipelineStr: %s", pipelineStr)
|
||||
|
||||
return pipelineStr, err
|
||||
}, "video"),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,9 +47,9 @@ func NewBroadcastPipeline(device string, display string, pipelineSrc string, url
|
|||
// replace display
|
||||
pipelineStr = strings.Replace(pipelineStr, "{display}", display, -1)
|
||||
} else {
|
||||
birate := 5000
|
||||
pipelineStr = fmt.Sprintf("flvmux name=mux ! rtmpsink location='%s live=1 subscribe=stream-neko buffer=1200000' %s audio/x-raw,channels=2 ! audioconvert ! voaacenc ! mux. %s video/x-raw,format=NV12 ! nvh264enc name=encoder rc-lookahead=20 preset=2 gop-size=120 temporal-aq=true bitrate=%d vbv-buffer-size=%d rc-mode=cbr bframes=0 ! h264parse config-interval=-1 ! mux.", url, audio, video, birate, birate)
|
||||
// pipelineStr = fmt.Sprintf("flvmux name=mux ! rtmpsink location='%s live=1 subscribe=stream-neko buffer=1200000' %s audio/x-raw,channels=2 ! audioconvert ! voaacenc ! mux. %s video/x-raw,format=NV12 ! openh264enc name=encoder bitrate=%d vbv-buffer-size=%d ! h264parse config-interval=-1 ! mux.", url, audio, video, birate, birate)
|
||||
bitrate := 4000
|
||||
// pipelineStr = fmt.Sprintf("flvmux name=mux ! rtmpsink location='%s live=1 subscribe=stream-neko buffer=1200000' %s audio/x-raw,channels=2 ! audioconvert ! voaacenc ! mux. %s video/x-raw,format=NV12 ! nvh264enc name=encoder rc-lookahead=20 preset=2 gop-size=120 temporal-aq=true bitrate=%d vbv-buffer-size=%d rc-mode=cbr bframes=0 ! h264parse config-interval=-1 ! mux.", url, audio, video, bitrate, bitrate)
|
||||
pipelineStr = fmt.Sprintf("flvmux name=mux ! rtmpsink location='%s live=1 subscribe=stream-neko' %s audio/x-raw,channels=2 ! audioconvert ! voaacenc ! mux. %s video/x-raw ! videoconvert ! queue ! openh264enc multi-thread=2 complexity=medium bitrate=%d max-bitrate=%d ! h264parse config-interval=-1 ! mux.", url, audio, video, bitrate*1000, (bitrate+1024)*1000)
|
||||
}
|
||||
|
||||
return pipelineStr, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue