nareix / joy4

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

Bug in reading TS files #49

Open phsm opened 6 years ago

phsm commented 6 years ago

Seems that small fix helps to read mpegts files.

How to reproduce the bug it seems to fix:

  1. Pick any videofile in any format (I used mkv with h264 codec stream)
  2. Convert it into mpegts: ffmpeg -i video.mkv -codec copy -f mpegts video.ts
  3. Use the following code to check
    
    package main

import ( "github.com/nareix/joy4/format/ts" "os" "log" )

func main() { file, err := os.Open("/home/user/video.ts") if err != nil { log.Fatalln(err) } demux := ts.NewDemuxer(file)

streams, err := demux.Streams()
if err != nil {
    fmt.Printf("error getting streams: %s\n", err)
    os.Exit(1)
}

}


It should throw an error: "error getting streams: invalid PMT"
argon338 commented 2 years ago

Thnx bro my ass was on fire.

phsm commented 2 years ago

Thnx bro my ass was on fire.

I'd advise you to refrain from using this software anyway, as it seems to be an abandonware. You can take a look at OvenMediaEngine instead

argon338 commented 2 years ago

Thnx bro my ass was on fire.

I'd advise you to refrain from using this software anyway, as it seems to be an abandonware. You can take a look at OvenMediaEngine instead

Thanks a lot for your advice. But I'm on another side of service. I need to read flv and ts to decompose packets and gather statistics for our service purpose. So I'm kind a client. Using joy4 I can decompose both formats using one module. If you know another ways I will be thankful.