breaking change: remove default ffmpeg args

This commit is contained in:
2024-10-27 22:53:25 +08:00
parent 048dfecbae
commit dcdbf84c8c
4 changed files with 21 additions and 89 deletions

View File

@@ -20,21 +20,11 @@ func buildFFmpegArgs(videoItem config.InputItem) []string {
args = append(args,
"-i", videoPath,
"-c:v", config.GlobalConfig.Play.VideoCodec,
"-preset", config.GlobalConfig.Play.Preset,
"-crf", fmt.Sprintf("%d", config.GlobalConfig.Play.CRF),
"-maxrate", config.GlobalConfig.Play.MaxRate,
"-bufsize", config.GlobalConfig.Play.BufSize,
"-vf", fmt.Sprintf("scale=%s", config.GlobalConfig.Play.Scale),
"-r", fmt.Sprintf("%d", config.GlobalConfig.Play.FrameRate),
"-c:a", config.GlobalConfig.Play.AudioCodec,
"-b:a", config.GlobalConfig.Play.AudioBitrate,
"-ar", fmt.Sprintf("%d", config.GlobalConfig.Play.AudioSampleRate),
"-f", config.GlobalConfig.Play.OutputFormat,
)
if len(config.GlobalConfig.Play.CustomArgs) != 0 {
args = append(args, config.GlobalConfig.Play.CustomArgs...)
for k, v := range config.GlobalConfig.Play {
args = append(args, k)
args = append(args, fmt.Sprint(v))
}
args = append(args, fmt.Sprintf("%s/%s", config.GlobalConfig.Output.RTMPServer, config.GlobalConfig.Output.StreamKey))

View File

@@ -56,11 +56,9 @@ func NewStreamer(videoList []config.InputItem) *Streamer {
func (s *Streamer) actorLoop() {
for msg := range s.mailbox {
if msg.messageType() != CloseMessage.messageType(CloseMessage{}) {
log.Printf("handle %s start\n", msg.messageType())
s.wg.Add(1)
s.handleMessage(msg)
s.wg.Done()
log.Printf("handle %s end\n", msg.messageType())
} else {
s.handleMessage(msg)
}