xuxiuxi
2019-07-10 04ea121a6588096ce5410f31c609441326bc7b47
fix snapshot
1个文件已修改
11 ■■■■■ 已修改文件
service/CamraUpdatesnashot.go 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/CamraUpdatesnashot.go
@@ -103,13 +103,16 @@
    if err != nil {
        return "", nil
    }
    piclocal := fmt.Sprintf("%s%s.jpg", *storelocal, time.Now().String())
    cmd := exec.Command("ffmpeg", "-i", caminfo.Rtsp, "-y", "-f", "image2", "-t", "0.001", "-vf", "select='eq(pict_type\\,I)',setpts='N/(25*TB)'", "-s", "1920*1080", piclocal)
    //piclocal := fmt.Sprintf("%s%s.jpg", *storelocal, time.Now().String())
    piclocal := fmt.Sprintf("%s%s.jpg", *storelocal, time.Now().Format("2006-01-02_15_04_05.000000000"))
    cmd := exec.Command("ffmpeg", "-i", caminfo.Rtsp,
        //"-y", "-f", "image2", "-t", "0.001",
        //"-vf", "select='eq(pict_type\\,I)',setpts='N/(25*TB)'",
        "-s", "1920*1080", piclocal)
    err = cmd.Run()
    if err != nil {
        return "", err
        //return "", err //ignore error
    }
    return piclocal, nil
}