mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-12-24 13:48:04 +08:00
feat: mp4 conert to ts format
This commit is contained in:
@@ -42,10 +42,8 @@ func (c *AVFrameConvert[T]) ConvertFromAVFrame(avFrame *AVFrame) (to T, err erro
|
||||
return
|
||||
}
|
||||
}
|
||||
if avFrame.Raw == nil {
|
||||
if err = avFrame.Demux(c.FromTrack.ICodecCtx); err != nil {
|
||||
return
|
||||
}
|
||||
if err = avFrame.Demux(c.FromTrack.ICodecCtx); err != nil {
|
||||
return
|
||||
}
|
||||
to.SetAllocator(avFrame.Wraps[0].GetAllocator())
|
||||
to.Mux(c.ToTrack.ICodecCtx, avFrame)
|
||||
@@ -67,10 +65,8 @@ func (c *AVFrameConvert[T]) Convert(frame IAVFrame) (to T, err error) {
|
||||
}
|
||||
}
|
||||
c.lastFromCodecCtx = c.FromTrack.ICodecCtx
|
||||
if c.FromTrack.Value.Raw == nil {
|
||||
if c.FromTrack.Value.Raw, err = frame.Demux(c.FromTrack.ICodecCtx); err != nil {
|
||||
return
|
||||
}
|
||||
if c.FromTrack.Value.Raw, err = frame.Demux(c.FromTrack.ICodecCtx); err != nil {
|
||||
return
|
||||
}
|
||||
to.SetAllocator(frame.GetAllocator())
|
||||
to.Mux(c.ToTrack.ICodecCtx, &c.FromTrack.Value)
|
||||
|
||||
@@ -86,8 +86,6 @@ func NewAVTrack(args ...any) (t *AVTrack) {
|
||||
t.RingWriter.SLogger = t.Logger
|
||||
case *util.Promise:
|
||||
t.ready = v
|
||||
case codec.ICodecCtx:
|
||||
t.ICodecCtx = v
|
||||
}
|
||||
}
|
||||
//t.ready = util.NewPromise(struct{}{})
|
||||
|
||||
Reference in New Issue
Block a user