1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2024-12-22 13:52:19 +00:00

Optimize FFMPEG parameters to reduce CPU charge

This commit is contained in:
Yohann D'ANELLO 2020-09-30 00:36:58 +02:00
parent 9049935ee4
commit 5efbe309ac

View File

@ -31,10 +31,8 @@ func RegisterStream(streamKey string) {
params := []string{"-re", "-i", "pipe:0"}
for _, stream := range options.Outputs[streamKey] {
// TODO Set optimal parameters
params = append(params, "-f", "flv", "-c:v", "libx264", "-preset",
"veryfast", "-maxrate", "3000k", "-bufsize", "6000k", "-pix_fmt", "yuv420p", "-g", "50", "-c:a", "aac",
"-b:a", "160k", "-ac", "2", "-ar", "44100", stream)
params = append(params, "-f", "flv", "-preset", "ultrafast", "-tune", "zerolatency",
"-c", "copy", stream)
}
// Launch FFMPEG instance
ffmpeg := exec.Command("ffmpeg", params...)