diff --git a/.gitignore b/.gitignore index 00bf51bb9..753c0bd95 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ webroot/hls webroot/static/content.md hls/ dist/ +transcoder.log diff --git a/config/config.go b/config/config.go index 53badff3f..246e16ca0 100644 --- a/config/config.go +++ b/config/config.go @@ -14,17 +14,18 @@ import ( var Config *config type config struct { - IPFS ipfs `yaml:"ipfs"` - PublicHLSPath string `yaml:"publicHLSPath"` - PrivateHLSPath string `yaml:"privateHLSPath"` - VideoSettings videoSettings `yaml:"videoSettings"` - Files files `yaml:"files"` - FFMpegPath string `yaml:"ffmpegPath"` - WebServerPort int `yaml:"webServerPort"` - S3 s3 `yaml:"s3"` - InstanceDetails InstanceDetails `yaml:"instanceDetails"` - VersionInfo string `yaml:"-"` - DisableWebFeatures bool `yaml:"disableWebFeatures"` + IPFS ipfs `yaml:"ipfs"` + PublicHLSPath string `yaml:"publicHLSPath"` + PrivateHLSPath string `yaml:"privateHLSPath"` + VideoSettings videoSettings `yaml:"videoSettings"` + Files files `yaml:"files"` + FFMpegPath string `yaml:"ffmpegPath"` + WebServerPort int `yaml:"webServerPort"` + S3 s3 `yaml:"s3"` + InstanceDetails InstanceDetails `yaml:"instanceDetails"` + VersionInfo string `yaml:"-"` + DisableWebFeatures bool `yaml:"disableWebFeatures"` + EnableDebugFeatures bool `yaml:"-"` } // InstanceDetails defines the user-visible information about this particular instance. diff --git a/core/ffmpeg/transcoder.go b/core/ffmpeg/transcoder.go index cae4bd5d3..ee646cc7e 100644 --- a/core/ffmpeg/transcoder.go +++ b/core/ffmpeg/transcoder.go @@ -67,8 +67,13 @@ func (t *Transcoder) Start() { log.Tracef("Video transcoder started with %d stream variants.", len(t.variants)) + if config.Config.EnableDebugFeatures { + log.Println(command) + } + _, err := exec.Command("sh", "-c", command).Output() if err != nil { + log.Errorln("Transcoder error. See transcoder.log for full output to debug.") log.Panicln(err, command) } @@ -111,6 +116,7 @@ func (t *Transcoder) getString() string { "-hls_segment_filename", path.Join(t.segmentOutputPath, "/%v/stream-%s.ts"), // Each segment's filename "-max_muxing_queue_size", "400", // Workaround for Too many packets error: https://trac.ffmpeg.org/ticket/6375?cversion=0 path.Join(t.segmentOutputPath, "/%v/stream.m3u8"), // Each variant's playlist + "2> transcoder.log", } return strings.Join(ffmpegFlags, " ") diff --git a/core/rtmp/rtmp.go b/core/rtmp/rtmp.go index e85c1cf25..1a6b3d169 100644 --- a/core/rtmp/rtmp.go +++ b/core/rtmp/rtmp.go @@ -41,7 +41,7 @@ func Start() { if error != nil { log.Panicln(error) } - log.Printf("RTMP server is listening for incoming stream on port: %d", port) + log.Infof("RTMP server is listening for incoming stream on port: %d", port) } func handlePublish(conn *rtmp.Conn) { diff --git a/main.go b/main.go index 292a74e2b..b3fe12854 100644 --- a/main.go +++ b/main.go @@ -46,6 +46,7 @@ func main() { if err := config.Load(*configFile, getVersion()); err != nil { panic(err) } + config.Config.EnableDebugFeatures = *enableDebugOptions // starts the core if err := core.Start(); err != nil {