diff --git a/core/rtmp/rtmp.go b/core/rtmp/rtmp.go index f59fa3cb0..74587a1bd 100644 --- a/core/rtmp/rtmp.go +++ b/core/rtmp/rtmp.go @@ -10,8 +10,8 @@ import ( "time" "unsafe" - "github.com/nareix/joy5/av" "github.com/nareix/joy5/format/flv" + "github.com/nareix/joy5/format/flv/flvio" log "github.com/sirupsen/logrus" "github.com/gabek/owncast/config" @@ -62,6 +62,13 @@ func Start() { } func HandleConn(c *rtmp.Conn, nc net.Conn) { + c.LogTagEvent = func(isRead bool, t flvio.Tag) { + if t.Type == flvio.TAG_AMF0 { + log.Infof("%+v\n", t.DebugFields()) + } + + } + if _isConnected { log.Errorln("stream already running; can not overtake an existing stream") nc.Close() @@ -102,17 +109,10 @@ func HandleConn(c *rtmp.Conn, nc net.Conn) { return } - if pkt.Type == av.Metadata { - log.Traceln(string(pkt.Data)) + if pkt.Metadata != nil { + fmt.Println(string(pkt.Metadata)) } - // if pkt.Type == av.H264 { - // nalus, _ := h264.SplitNALUs(pkt.Data) - // annexb := h264.JoinNALUsAnnexb(nalus) - // avcc := h264.JoinNALUsAVCC([][]byte{annexb}) - // pkt.Data = avcc - // } - if err := w.WritePacket(pkt); err != nil { panic(err) } diff --git a/go.mod b/go.mod index efd0affb4..fe74b0a3f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/ipfs/go-ipfs-config v0.5.3 github.com/ipfs/go-ipfs-files v0.0.8 github.com/ipfs/interface-go-ipfs-core v0.2.7 - github.com/karalabe/xgo v0.0.0-20191115072854-c5ccff8648a7 // indirect github.com/libp2p/go-libp2p-peer v0.2.0 github.com/libp2p/go-libp2p-peerstore v0.2.6 github.com/mattn/go-sqlite3 v1.14.0 diff --git a/go.sum b/go.sum index 6cb9e78ed..5c3a505b0 100644 --- a/go.sum +++ b/go.sum @@ -415,8 +415,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= -github.com/karalabe/xgo v0.0.0-20191115072854-c5ccff8648a7 h1:AYzjK/SHz6m6mg5iuFwkrAhCc14jvCpW9d6frC9iDPE= -github.com/karalabe/xgo v0.0.0-20191115072854-c5ccff8648a7/go.mod h1:iYGcTYIPUvEWhFo6aKUuLchs+AV4ssYdyuBbQJZGcBk= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=