Pipe to transcoder instead of file

This commit is contained in:
Muaz Ahmad 2023-09-22 12:33:55 +05:00
parent 96b9895735
commit 77c36a689a

View file

@ -4,15 +4,15 @@ import (
"os"
"io"
"strings"
"stream_server/transcoder"
)
func NewWriter(stream_key string) (io.WriteCloser, error) {
base_dir, _ := os.UserHomeDir()
file, err := os.Create(base_dir + "/live/" + stream_key + "/rawdump.ts")
transcoder_in, err := transcoder.NewTranscoder(stream_key)
if err != nil {
return nil, err
}
return file, nil
return transcoder_in, nil
}
func CheckStreamID(stream_id []byte) (io.WriteCloser, bool) {