chenshijun
2019-12-04 89c923cf2abe98354998f2887bd3f1df8c2b1dbf
capture.go
@@ -38,8 +38,8 @@
   InvalidFileExt PicExt = PicExt("")
)
// Capture pic
func CaptureGB28181(soFile string, url string, maxTry int) ([]byte, error) {
// capture pic
func captureGB28181(soFile string, url string, maxTry int) ([]byte, error) {
   var ret []byte
   var err error
@@ -49,7 +49,7 @@
      return nil, err
   }
   reterr := errors.New(fmt.Sprintf("try %d times to capture image, is url correct?", maxTry))
   reterr := errors.New(fmt.Sprintf("gb28181 try %d times to capture image, is url correct?", maxTry))
   for i := 0; i < maxTry; i++ {
      ret = goffmpeg.GetGBJpg(url)
      if len(ret) > 0 {
@@ -69,6 +69,10 @@
      return nil, errors.New("there is no this mode, try capture.Rtsp/capture.GB28181")
   }
   if m == GB28181 {
      return captureGB28181(soFile, url, maxTry)
   }
   if ext == InvalidFileExt {
      ext = JPEGFileExt
   }