0

Add additional logging of ffmpeg output to file. Help troubleshoot #34

This commit is contained in:
Gabe Kangas 2020-07-08 18:27:24 -07:00
parent 0a3691e25e
commit f54d1eba38
5 changed files with 21 additions and 12 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@ webroot/hls
webroot/static/content.md webroot/static/content.md
hls/ hls/
dist/ dist/
transcoder.log

View File

@ -14,17 +14,18 @@ import (
var Config *config var Config *config
type config struct { type config struct {
IPFS ipfs `yaml:"ipfs"` IPFS ipfs `yaml:"ipfs"`
PublicHLSPath string `yaml:"publicHLSPath"` PublicHLSPath string `yaml:"publicHLSPath"`
PrivateHLSPath string `yaml:"privateHLSPath"` PrivateHLSPath string `yaml:"privateHLSPath"`
VideoSettings videoSettings `yaml:"videoSettings"` VideoSettings videoSettings `yaml:"videoSettings"`
Files files `yaml:"files"` Files files `yaml:"files"`
FFMpegPath string `yaml:"ffmpegPath"` FFMpegPath string `yaml:"ffmpegPath"`
WebServerPort int `yaml:"webServerPort"` WebServerPort int `yaml:"webServerPort"`
S3 s3 `yaml:"s3"` S3 s3 `yaml:"s3"`
InstanceDetails InstanceDetails `yaml:"instanceDetails"` InstanceDetails InstanceDetails `yaml:"instanceDetails"`
VersionInfo string `yaml:"-"` VersionInfo string `yaml:"-"`
DisableWebFeatures bool `yaml:"disableWebFeatures"` DisableWebFeatures bool `yaml:"disableWebFeatures"`
EnableDebugFeatures bool `yaml:"-"`
} }
// InstanceDetails defines the user-visible information about this particular instance. // InstanceDetails defines the user-visible information about this particular instance.

View File

@ -67,8 +67,13 @@ func (t *Transcoder) Start() {
log.Tracef("Video transcoder started with %d stream variants.", len(t.variants)) 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() _, err := exec.Command("sh", "-c", command).Output()
if err != nil { if err != nil {
log.Errorln("Transcoder error. See transcoder.log for full output to debug.")
log.Panicln(err, command) 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 "-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 "-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 path.Join(t.segmentOutputPath, "/%v/stream.m3u8"), // Each variant's playlist
"2> transcoder.log",
} }
return strings.Join(ffmpegFlags, " ") return strings.Join(ffmpegFlags, " ")

View File

@ -41,7 +41,7 @@ func Start() {
if error != nil { if error != nil {
log.Panicln(error) 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) { func handlePublish(conn *rtmp.Conn) {

View File

@ -46,6 +46,7 @@ func main() {
if err := config.Load(*configFile, getVersion()); err != nil { if err := config.Load(*configFile, getVersion()); err != nil {
panic(err) panic(err)
} }
config.Config.EnableDebugFeatures = *enableDebugOptions
// starts the core // starts the core
if err := core.Start(); err != nil { if err := core.Start(); err != nil {