|
@@ -910,7 +910,39 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
|
|
|
*/
|
|
|
public void deleteTmpFlv(int num) {
|
|
|
log.info("find /opt/streams/record/flv/*/*/ -mmin +5 -name *.flv -exec rm -rf {} \\;");
|
|
|
- cmdCameraUtil.cmd("find /opt/streams/record/flv/*/*/ -mmin +5 -name *.flv -exec rm -rf {} \\;");
|
|
|
+// cmdCameraUtil.cmd("find /opt/streams/record/flv/*/*/ -mmin +5 -name *.flv -exec rm -rf {} \\;");
|
|
|
+
|
|
|
+ try {
|
|
|
+ Process proc = Runtime.getRuntime().exec("/bin/bash", null, null);
|
|
|
+ BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
|
|
|
+ PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())), true);
|
|
|
+ String commit = "find /opt/streams/record/flv/*/*/ -mmin +1 -name *.flv -exec rm -rf {} \\;";
|
|
|
+ List<String> commands = new ArrayList<>();
|
|
|
+
|
|
|
+ // 删除
|
|
|
+ commands.add(commit);
|
|
|
+ log.info("删除昨天的录像视频命令:{}", commands);
|
|
|
+ for (String line : commands) {
|
|
|
+ out.println(line);
|
|
|
+ }
|
|
|
+ out.println("exit");// 这个命令必须执行,否则in流不结束。
|
|
|
+ String rspLine = "";
|
|
|
+ while ((rspLine = in.readLine()) != null) {
|
|
|
+ System.out.println(rspLine);
|
|
|
+
|
|
|
+ }
|
|
|
+ int i = proc.waitFor();
|
|
|
+ log.info("执行结果:{}", i);
|
|
|
+
|
|
|
+ in.close();
|
|
|
+ out.close();
|
|
|
+ proc.destroy();
|
|
|
+ } catch (IOException e) {
|
|
|
+ log.error(e.getMessage());
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|