From d70c5a7818cb8b1fcf7273a2a39e57f8ab75eec3 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Thu, 22 Apr 2021 21:27:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E5=9B=BE=E4=BF=AE=E5=A4=8DFFmpeg?= =?UTF-8?q?=E5=BD=95=E5=88=B6=E7=BB=93=E6=9D=9F=E5=BC=82=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java b/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java index a847c14..0c92963 100644 --- a/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java +++ b/src/main/java/com/yutou/bilibili/BiliBili/Tools/SaveLive.java @@ -165,7 +165,7 @@ public class SaveLive { Process process=AppTools.exec(exec); InputStream inputStream = process.getErrorStream(); byte[] bytes = new byte[2048]; - while (inputStream.read(bytes) > -1) { + while (inputStream.read(bytes) > -1&&isSave) { //System.out.println(new String(bytes,StandardCharsets.UTF_8)); if(!isPrint){ com.yutou.bilibili.Tools.Log.i("开始录制:" + roomId); @@ -173,6 +173,7 @@ public class SaveLive { isPrint=true; } } + process.destroy(); System.out.println("----------------stop ffmpeg"); inputStream.close(); com.yutou.bilibili.Tools.Log.i("录制完成:" + roomId);