mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 16:12:19 +00:00
Configure and test transcoder
This commit is contained in:
parent
23b6eeaa05
commit
09a3422d06
@ -82,16 +82,24 @@ telnet:
|
|||||||
#
|
#
|
||||||
#listenAddress: :8023
|
#listenAddress: :8023
|
||||||
|
|
||||||
# Size is in characters. It is recommended to keep a 16x9 format.
|
## Transcoders configuration ##
|
||||||
#
|
transcoder:
|
||||||
#width: 80
|
text:
|
||||||
#height: 45
|
# By default the text transcoder is disabled.
|
||||||
|
# You need to enable it to use telnet output.
|
||||||
|
#
|
||||||
|
#enabled: false
|
||||||
|
|
||||||
# Time in milliseconds between two images.
|
# Size is in characters. It is recommended to keep a 16x9 format.
|
||||||
# By default 50 ms, so 20 FPS.
|
#
|
||||||
# Displaying text takes time.
|
#width: 80
|
||||||
#
|
#height: 45
|
||||||
#delay: 50
|
|
||||||
|
# Time in milliseconds between two images.
|
||||||
|
# By default 50 ms, so 20 FPS.
|
||||||
|
# Displaying text takes time.
|
||||||
|
#
|
||||||
|
#delay: 50
|
||||||
|
|
||||||
## Web server ##
|
## Web server ##
|
||||||
# The web server serves a WebRTC player.
|
# The web server serves a WebRTC player.
|
||||||
|
@ -25,6 +25,7 @@ type Config struct {
|
|||||||
Monitoring monitoring.Options
|
Monitoring monitoring.Options
|
||||||
Srt srt.Options
|
Srt srt.Options
|
||||||
Telnet telnet.Options
|
Telnet telnet.Options
|
||||||
|
Transcoder transcoder.Options
|
||||||
Web web.Options
|
Web web.Options
|
||||||
WebRTC webrtc.Options
|
WebRTC webrtc.Options
|
||||||
}
|
}
|
||||||
|
2
main.go
2
main.go
@ -50,7 +50,7 @@ func main() {
|
|||||||
|
|
||||||
// Start routines
|
// Start routines
|
||||||
go transcoder.Init(streams, &cfg.Transcoder)
|
go transcoder.Init(streams, &cfg.Transcoder)
|
||||||
go forwarding.Serve(streams, &cfg.Forwarding)
|
go forwarding.Serve(streams, cfg.Forwarding)
|
||||||
go monitoring.Serve(&cfg.Monitoring)
|
go monitoring.Serve(&cfg.Monitoring)
|
||||||
go srt.Serve(streams, authBackend, &cfg.Srt)
|
go srt.Serve(streams, authBackend, &cfg.Srt)
|
||||||
go telnet.Serve(streams, &cfg.Telnet)
|
go telnet.Serve(streams, &cfg.Telnet)
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
// Package stream defines a structure to communication between inputs and outputs
|
// Package stream defines a structure to communication between inputs and outputs
|
||||||
package stream
|
package stream
|
||||||
|
|
||||||
import "sync"
|
import (
|
||||||
|
"sync"
|
||||||
|
)
|
||||||
|
|
||||||
// Stream makes packages able to subscribe to an incoming stream
|
// Stream makes packages able to subscribe to an incoming stream
|
||||||
type Stream struct {
|
type Stream struct {
|
||||||
@ -21,7 +23,7 @@ type Stream struct {
|
|||||||
// New creates a new stream.
|
// New creates a new stream.
|
||||||
func New() *Stream {
|
func New() *Stream {
|
||||||
s := &Stream{}
|
s := &Stream{}
|
||||||
broadcast := make(chan []byte, 64)
|
broadcast := make(chan []byte, 1024)
|
||||||
s.Broadcast = broadcast
|
s.Broadcast = broadcast
|
||||||
s.outputs = make(map[chan []byte]struct{})
|
s.outputs = make(map[chan []byte]struct{})
|
||||||
s.nbClients = 0
|
s.nbClients = 0
|
||||||
|
@ -65,7 +65,7 @@ func handleViewer(s *srtgo.SrtSocket, streams map[string]*stream.Stream, name st
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Register new output
|
// Register new output
|
||||||
c := make(chan []byte, 128)
|
c := make(chan []byte, 1024)
|
||||||
st.Register(c)
|
st.Register(c)
|
||||||
st.IncrementClientCount()
|
st.IncrementClientCount()
|
||||||
|
|
||||||
|
@ -69,6 +69,9 @@ func Serve(streams map[string]*stream.Stream, authBackend auth.Backend, cfg *Opt
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Flush socket
|
||||||
|
// Without this, the SRT buffer might get full before reading it
|
||||||
|
|
||||||
// streamid can be "name:password" for streamer or "name" for viewer
|
// streamid can be "name:password" for streamer or "name" for viewer
|
||||||
streamID, err := s.GetSockOptString(C.SRTO_STREAMID)
|
streamID, err := s.GetSockOptString(C.SRTO_STREAMID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
1
transcoder/transcoder_test.go
Normal file
1
transcoder/transcoder_test.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package transcoder
|
Loading…
Reference in New Issue
Block a user