mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-10-20 16:15:17 +08:00
feat: transcode log by day
This commit is contained in:
6
api.go
6
api.go
@@ -323,7 +323,7 @@ func (s *Server) VideoTrackSnap(ctx context.Context, req *pb.StreamSnapRequest)
|
||||
res.Reader[sub.ID] = sub.VideoReader.Value.Sequence
|
||||
}
|
||||
pub.VideoTrack.Ring.Do(func(v *pkg.AVFrame) {
|
||||
if v.TryRLock() {
|
||||
//if v.TryRLock() {
|
||||
if len(v.Wraps) > 0 {
|
||||
var snap pb.TrackSnapShot
|
||||
snap.Sequence = v.Sequence
|
||||
@@ -341,8 +341,8 @@ func (s *Server) VideoTrackSnap(ctx context.Context, req *pb.StreamSnapRequest)
|
||||
}
|
||||
res.Ring = append(res.Ring, &snap)
|
||||
}
|
||||
v.RUnlock()
|
||||
}
|
||||
//v.RUnlock()
|
||||
//}
|
||||
})
|
||||
} else {
|
||||
err = pkg.ErrNotFound
|
||||
|
@@ -143,7 +143,7 @@ func (t *Transformer) Start() (err error) {
|
||||
t.SetDescription("cmd", args)
|
||||
t.SetDescription("config", t.TransRule)
|
||||
//t.BufReader.Dump, err = os.OpenFile("dump.flv", os.O_CREATE|os.O_WRONLY, 0644)
|
||||
t.logFileName = fmt.Sprintf("logs/transcode_%s_%s.log", strings.ReplaceAll(t.TransformJob.StreamPath, "/", "_"), time.Now().Format("20060102150405"))
|
||||
t.logFileName = fmt.Sprintf("logs/transcode_%s_%s.log", strings.ReplaceAll(t.TransformJob.StreamPath, "/", "_"), time.Now().Format("20060102"))
|
||||
t.ffmpeg = exec.CommandContext(t, "ffmpeg", args...)
|
||||
if t.logFileName != "" {
|
||||
t.SetDescription("log", t.logFileName)
|
||||
|
Reference in New Issue
Block a user