package org.sxkj.odm.controller;
|
|
import org.apache.logging.log4j.util.Strings;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
import org.sxkj.odm.utils.VideoConverterUtils;
|
|
import java.io.IOException;
|
|
/**
|
* 视频处理控制层
|
* @author zhongrj
|
* @date 2025-07-07
|
*/
|
@RestController
|
@RequestMapping("/video/handler")
|
public class VideoHandlerController {
|
|
/**
|
* mp4 转 图片
|
*/
|
@GetMapping("/mp4ToPic")
|
public void mp4ToPic(String inputPath) throws IOException, InterruptedException {
|
if (Strings.isBlank(inputPath)){
|
inputPath = "E:\\temp\\video\\浴场人员\\DJI_20250704190127_0004_V.mp4";
|
}
|
VideoConverterUtils.mp4ToJpg(inputPath, 60);
|
}
|
|
/**
|
* mp4 转 图片
|
*/
|
@GetMapping("/mp4ToPicRestriction")
|
public void mp4ToPicRestriction(String inputPath) throws IOException, InterruptedException {
|
if (Strings.isBlank(inputPath)){
|
inputPath = "E:\\temp\\video\\倾斜视频\\DJI_20250715142013_0001_V.mp4";
|
}
|
VideoConverterUtils.mp4ToJpgRestriction(inputPath, 15);
|
VideoConverterUtils.mp4ToCreateStr(inputPath);
|
}
|
}
|