吉安感知网项目-后端
xiebin
2026-01-06 d207a86cdf1ab52ef8cb7cd83bad8fceab8038cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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);
    }
}