소스 검색

command命令

Roc 5 달 전
부모
커밋
bfc1498ec8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      utils/common.go

+ 1 - 1
utils/common.go

@@ -545,7 +545,7 @@ func Sha1(data string) string {
 }
 
 func GetVideoPlaySeconds(videoPath string) (playSeconds float64, err error) {
-	cmd := `ffmpeg -i ` + videoPath + `  2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//`
+	cmd := fmt.Sprintf(`ffmpeg -i %s  2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//`, videoPath)
 	out, err := exec.Command("bash", "-c", cmd).Output()
 	if err != nil {
 		return