mirror of
https://github.com/owncast/owncast.git
synced 2024-12-25 10:38:28 +03:00
34 lines
905 B
Go
34 lines
905 B
Go
package rtmp
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/nareix/joy5/format/flv/flvio"
|
|
"github.com/owncast/owncast/models"
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func setCurrentBroadcasterInfo(t flvio.Tag, remoteAddr string) {
|
|
data, err := getInboundDetailsFromMetadata(t.DebugFields())
|
|
if err != nil {
|
|
log.Traceln("Unable to parse inbound broadcaster details:", err)
|
|
}
|
|
|
|
broadcaster := models.Broadcaster{
|
|
RemoteAddr: remoteAddr,
|
|
Time: time.Now(),
|
|
StreamDetails: models.InboundStreamDetails{
|
|
Width: data.Width,
|
|
Height: data.Height,
|
|
VideoBitrate: int(data.VideoBitrate),
|
|
VideoCodec: getVideoCodec(data.VideoCodec),
|
|
VideoFramerate: data.VideoFramerate,
|
|
AudioBitrate: int(data.AudioBitrate),
|
|
AudioCodec: getAudioCodec(data.AudioCodec),
|
|
Encoder: data.Encoder,
|
|
VideoOnly: data.AudioCodec == nil,
|
|
},
|
|
}
|
|
|
|
_setBroadcaster(broadcaster)
|
|
}
|