Skip to content

Commit

Permalink
perf: 获取视频封面
Browse files Browse the repository at this point in the history
  • Loading branch information
jamebal committed Apr 30, 2024
1 parent 9dca76f commit 9e4493c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ private static ProcessBuilder getVideoCoverProcessBuilder(String videoPath, Stri
log.info("\r\n videoPath: {}, formattedTimestamp: {}", videoPath, formattedTimestamp);
ProcessBuilder processBuilder = new ProcessBuilder(
Constants.FFMPEG,
"-y",
"-ss", formattedTimestamp,
"-i", videoPath,
"-vf", "scale='min(320,iw)':-1",
Expand Down Expand Up @@ -282,7 +283,7 @@ private void videoToM3U8(String fileId, String username, String relativePath, St
startConvert(username, relativePath, fileName, fileId);
}
} else {
printErrorInfo(processBuilder);
printErrorInfo(processBuilder, process);
}
}

Expand Down Expand Up @@ -482,7 +483,7 @@ private VideoInfo getVideoInfo(String videoPath) {

int exitCode = process.waitFor();
if (exitCode != 0) {
printErrorInfo(processBuilder);
printErrorInfo(processBuilder, process);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
Expand Down

0 comments on commit 9e4493c

Please sign in to comment.