视频样式转关键帧图片过程增加返回参数验证。
This commit is contained in:
@@ -15,6 +15,9 @@ import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import org.apache.commons.io.filefilter.IOFileFilter;
|
||||
import org.apache.tools.zip.ZipOutputStream;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
@@ -557,12 +560,32 @@ public class AvController extends BaseController {
|
||||
String shellName = Constants.VEDIO_TO_PICTURE_PROC;
|
||||
// String params = srcFileAllPath+" "+picFilePath+" 0.95 90.0 0.5";
|
||||
String params = srcFileAllPath+" "+picFilePath;
|
||||
logger.info("调用视频转关键帧图片程序输入参数:"+params);
|
||||
Map resultMap = avCfgService.execShell(shellName, params);
|
||||
if(resultMap.get("exitStatus").equals(0)){//调用外部程序成功
|
||||
String out = resultMap.get("out").toString();//输出参数
|
||||
JSONArray resArray =JSONArray.fromObject(out);
|
||||
JSONObject resObject = resArray.getJSONObject(0);
|
||||
logger.info("调用视频转关键帧图片程序输出参数:"+resObject);
|
||||
int state = resObject.getInt("state");
|
||||
if(state==1){
|
||||
//关键帧图片生成成功,删除原视频文件
|
||||
FileUtils.deleteFile(srcFileAllPath);
|
||||
map.put("status", 1);
|
||||
map.put("msg", "success");
|
||||
}else{
|
||||
if(StringUtil.isEmpty(resObject.getString("message"))){
|
||||
map.put("status", 0);
|
||||
map.put("msg", getMsgProp().getProperty("call_external_procedures_failed", "Call external procedures failed"));
|
||||
}else{
|
||||
map.put("status", 0);
|
||||
map.put("msg", resObject.getString("message"));
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
map.put("status", 0);
|
||||
map.put("msg", getMsgProp().getProperty("call_external_procedures_failed", "Call external procedures failed"));
|
||||
}
|
||||
}else{
|
||||
map.put("status", 0);
|
||||
|
||||
@@ -47,7 +47,8 @@ $(function(){
|
||||
});
|
||||
|
||||
$("#srcFile").on('change',function(){
|
||||
sampleFileValidate(fileType,$("#srcFile").val());
|
||||
if(sampleFileValidate(fileType,$("#srcFile").val())){
|
||||
//样例文件类型正确进行后续处理
|
||||
$("#srcFileInfo").val($("#srcFile").val());
|
||||
var videoToPicture = $("#videoToPicture").val();
|
||||
if(videoToPicture=="true"){
|
||||
@@ -72,10 +73,11 @@ $(function(){
|
||||
var url = "${ctx}/ntc/av/sample/selectVedioPicture?picFilePath="+encodeURIComponent(data.picFilePath);
|
||||
$.jBox("iframe:"+url, {
|
||||
title: "",
|
||||
width: 1350,
|
||||
height:800,
|
||||
dragLimit: true,
|
||||
buttons: { 'close': true,"ok":"ok" }
|
||||
top: '1%',
|
||||
draggable:false,
|
||||
width: 1000,
|
||||
height:500,
|
||||
buttons: { 'close': true }
|
||||
});
|
||||
}else{
|
||||
alert(data.msg);
|
||||
@@ -89,6 +91,7 @@ $(function(){
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
/* $("#uploadSample,#sampleFileInfo").on('click',function(){
|
||||
$("#sampleFile").trigger("click");
|
||||
|
||||
Reference in New Issue
Block a user