mirror of
https://github.com/gowvp/gb28181.git
synced 2026-04-22 23:17:19 +08:00
22 lines
575 B
Go
22 lines
575 B
Go
package zlm
|
|
|
|
const (
|
|
getSnapshot = `/index/api/getSnap`
|
|
)
|
|
|
|
type GetSnapRequest struct {
|
|
URL string `json:"url"`
|
|
TimeoutSec int `json:"timeout_sec"` // 截图失败超时时间
|
|
ExpireSec int `json:"expire_sec"` // 截图过期时间
|
|
}
|
|
|
|
// GetSnap 获取截图或生成实时截图并返回
|
|
// https://docs.zlmediakit.com/zh/guide/media_server/restful_api.html#_23%E3%80%81-index-api-getsnap
|
|
func (e *Engine) GetSnap(in GetSnapRequest) ([]byte, error) {
|
|
body, err := struct2map(in)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return e.post2(getSnapshot, body)
|
|
}
|