nareix / joy4

Golang audio/video library and streaming server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

fastfading opened this issue · comments

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

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