nareix / joy4

Golang audio/video library and streaming server
MIT License
2.66k stars 501 forks source link

bug: avutil.CopyFile not ok for for xxx.ts input file #113

Open fastfading opened 4 years ago

fastfading commented 4 years ago
func Mp4Mux(srcFile, dstFile string) {
    demuxer, err := avutil.Open(srcFile)
    if err != nil {
        log.Fatalln(" srcFile:", srcFile, "error", err)
    }
    defer demuxer.Close()

    muxer, _ := avutil.Create(dstFile)
    defer muxer.Close()

    // CopyFile(muxer, demuxer)
    avutil.CopyFile(muxer, demuxer)
}

this is ok for mp4 file , but not ok for for xxx.ts input file.
output file can not be played

fastfading commented 4 years ago

image

image this will happen when there are 2 I frame in ts each I frame in different ts packet seems not work well in multi-slice mode