Seize / joy4

Golang audio/video library and streaming server
MIT License
13 stars 4 forks source link

decode h264 to OpenCV mat #24

Open cedricve opened 5 years ago

cedricve commented 5 years ago

Hey great work,

I was wondering what has to be done to convert a h264 packet to a valid OpenCV Mat RGB image.

        var pkt av.Packet
    if pkt, err = infile.ReadPacket(); err != nil {
        break
    }

    //  fmt.Println("pkt", i, streams[pkt.Idx].Type(), "len", len(pkt.Data), "keyframe", pkt.IsKeyFrame)
    if streams[pkt.Idx].Type() == av.H264 && pkt.IsKeyFrame {
        start = true
        count++
    }