main: updated logging in h264 file to mpegts file driver for revid

This commit is contained in:
saxon 2018-09-11 18:40:45 +09:30
parent 547e24da7d
commit 043ff7779a
1 changed files with 4 additions and 2 deletions

View File

@ -28,10 +28,10 @@ LICENSE
package main package main
import ( import (
"log"
"time" "time"
"bitbucket.org/ausocean/av/revid" "bitbucket.org/ausocean/av/revid"
"bitbucket.org/ausocean/utils/smartlogger"
) )
const ( const (
@ -39,6 +39,7 @@ const (
outputFile = "output.ts" outputFile = "output.ts"
frameRate = "25" frameRate = "25"
runDuration = 120 * time.Second runDuration = 120 * time.Second
logPath = "/var/log"
) )
// Test h264 inputfile to flv format into rtmp using librtmp c wrapper // Test h264 inputfile to flv format into rtmp using librtmp c wrapper
@ -51,10 +52,11 @@ func main() {
Output: revid.File, Output: revid.File,
OutputFileName: outputFile, OutputFileName: outputFile,
Packetization: revid.Mpegts, Packetization: revid.Mpegts,
Logger: smartlogger.New(smartlogger.Info, logPath),
} }
revidInst, err := revid.New(config, nil) revidInst, err := revid.New(config, nil)
if err != nil { if err != nil {
log.Printf("Should not of have got an error!: %v\n", err.Error()) config.Logger.Log(smartlogger.Error, "Should not have got an error!:", err.Error())
return return
} }
revidInst.Start() revidInst.Start()