video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-07-30 a6f5c0ca80b2fdd53351d5957a659a939f530fc2
goffmpeg.go
@@ -160,6 +160,7 @@
   return int(i), path
}
// GetRecID get rec id
func (h *GoFFMPEG) GetRecID(p string) string {
   pt := C.CString(p)
   defer C.free(unsafe.Pointer(pt))
@@ -179,20 +180,21 @@
}
// GetPicDecoder get pic from decoder
func (h *GoFFMPEG) GetPicDecoder() ([]byte, int, int) {
func (h *GoFFMPEG) GetPicDecoder() ([]byte, int, int, int64) {
   var width C.int
   var height C.int
   var fid C.longlong
   p := C.wrap_fn_decoder_pic(h.ffmpeg, &width, &height)
   p := C.wrap_fn_decoder_pic(h.ffmpeg, &width, &height, &fid)
   if width == 0 && height == 0 {
      return nil, 0, 0
      return nil, 0, 0, 0
   }
   defer C.free(unsafe.Pointer(p))
   d := C.GoBytes(p, width*height*3)
   wid := int(width)
   hei := int(height)
   return d, wid, hei
   gfid := int64(fid)
   return d, wid, hei, gfid
}
//GetAVPacket get AVPacket