Initial POC works with IPFS

This commit is contained in:
Gabe Kangas
2020-05-29 18:08:33 -07:00
parent cc48f86b85
commit af698063bd
40 changed files with 826 additions and 29 deletions

View File

@@ -7,6 +7,7 @@ import (
"log"
"os"
"path/filepath"
"syscall"
"github.com/pkg/errors"
"github.com/yutopp/go-flv"
@@ -47,11 +48,11 @@ func (h *Handler) OnPublish(timestamp uint32, cmd *rtmpmsg.NetStreamPublish) err
// Record streams as FLV!
p := filepath.Join(
filepath.Clean(filepath.Join("./", fmt.Sprintf("%s.flv", cmd.PublishingName))),
filepath.Clean(filepath.Join("./", fmt.Sprintf("%s.flv", "streampipe"))),
)
fmt.Println(p)
f, err := os.OpenFile(p, os.O_CREATE|os.O_WRONLY, 0666)
syscall.Mkfifo(p, 0666)
f, err := os.OpenFile(p, os.O_RDWR, os.ModeNamedPipe)
if err != nil {
return errors.Wrap(err, "Failed to create flv file")
}
@@ -64,6 +65,8 @@ func (h *Handler) OnPublish(timestamp uint32, cmd *rtmpmsg.NetStreamPublish) err
}
h.flvEnc = enc
go pipeTest()
return nil
}