| | |
| | | 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 |
| | |
| | | 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 { |
| | |
| | | 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 |
| | | } |