新增FFmpeg转码功能

This commit is contained in:
yutou
2021-04-01 18:47:14 +08:00
parent ef87b719fd
commit 51a0a3d111
7 changed files with 256 additions and 21 deletions

View File

@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
@Controller
public class SystemConfigController {
@@ -61,5 +63,25 @@ public class SystemConfigController {
json.put("data",data);
return json;
}
@ResponseBody
@RequestMapping("/system/set/ffmpeg.do")
public JSONObject setFFmpeg(String ffmpeg) throws UnsupportedEncodingException {
ffmpeg= URLDecoder.decode(ffmpeg,"UTF-8");
configService.setConfig(Config.SYSTEM_VIDEO_FFMPEG,ffmpeg);
JSONObject json=new JSONObject();
json.put("code",0);
json.put("msg","ok");
return json;
}
@ResponseBody
@RequestMapping("/system/get/ffmpeg.do")
public JSONObject getFFmpeg(){
JSONObject json = new JSONObject();
JSONObject data=new JSONObject();
String reg = configService.getConfig(Config.SYSTEM_VIDEO_FFMPEG);
data.put(Config.SYSTEM_VIDEO_FFMPEG, reg);
json.put("code",0);
json.put("data",data);
return json;
}
}