|
@@ -24,7 +24,7 @@ public class VideoTool {
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
- public static Long fetchAllPic(Long videoId, String ffmpegPath,String videoFilePath, String saveTmpDir,String targetDir, Date shootEndTime) throws Exception {
|
|
|
|
|
|
+ public static Long fetchAllPic(Long vuid, String ffmpegPath,String videoFilePath, String saveTmpDir,String targetDir, Date shootEndTime) throws Exception {
|
|
Long endTime = shootEndTime.getTime() ;
|
|
Long endTime = shootEndTime.getTime() ;
|
|
|
|
|
|
//ms
|
|
//ms
|
|
@@ -40,12 +40,12 @@ public class VideoTool {
|
|
Process proc = Runtime.getRuntime().exec(cmd);
|
|
Process proc = Runtime.getRuntime().exec(cmd);
|
|
proc.waitFor();
|
|
proc.waitFor();
|
|
log.info("fetchAllPic end");
|
|
log.info("fetchAllPic end");
|
|
- moveFile(videoId,beginTime,saveTmpDir,targetDir,framRate);
|
|
|
|
|
|
+ moveFile(vuid,beginTime,saveTmpDir,targetDir,framRate);
|
|
|
|
|
|
return duration;
|
|
return duration;
|
|
}
|
|
}
|
|
|
|
|
|
- private static void moveFile(Long videoId, Long beginTime,String saveTmpDir,String targetDir, int framRate){
|
|
|
|
|
|
+ private static void moveFile(Long vuid, Long beginTime,String saveTmpDir,String targetDir, int framRate){
|
|
log.info("moveFile start");
|
|
log.info("moveFile start");
|
|
File saveTmpDirFile = new File(saveTmpDir);
|
|
File saveTmpDirFile = new File(saveTmpDir);
|
|
File[] tmpFiles = FileUtil.sortByName(saveTmpDirFile.listFiles());
|
|
File[] tmpFiles = FileUtil.sortByName(saveTmpDirFile.listFiles());
|
|
@@ -57,7 +57,7 @@ public class VideoTool {
|
|
String tmpFileName = tmpFile.getName();
|
|
String tmpFileName = tmpFile.getName();
|
|
String tmpFileExt = tmpFileName.substring(tmpFileName.lastIndexOf(".") + 1);
|
|
String tmpFileExt = tmpFileName.substring(tmpFileName.lastIndexOf(".") + 1);
|
|
long time = beginTime + (i * (1000/framRate));
|
|
long time = beginTime + (i * (1000/framRate));
|
|
- String targetFileNam = DateUtils.formatToDateStr(new Date(time),"yyyyMMddHHmmss") + "_" + UUID.randomUUID().toString() + "@" + videoId + "." + tmpFileExt;
|
|
|
|
|
|
+ String targetFileNam = DateUtils.formatToDateStr(new Date(time),"yyyyMMddHHmmss") + "_" + UUID.randomUUID().toString() + "@" + vuid + "." + tmpFileExt;
|
|
File targetFile = new File(targetDir,targetFileNam);
|
|
File targetFile = new File(targetDir,targetFileNam);
|
|
log.info("tmpNewFile ==" + targetFile.getAbsolutePath());
|
|
log.info("tmpNewFile ==" + targetFile.getAbsolutePath());
|
|
tmpFile.renameTo(targetFile);
|
|
tmpFile.renameTo(targetFile);
|