|
@@ -17,7 +17,7 @@ import java.io.IOException;
|
|
|
@Slf4j
|
|
|
public class FfmpegUtil implements Runnable {
|
|
|
|
|
|
- public String stream_url = "rtsp://124.70.58.209:8554/42010001541320000024/42010001541320000024";// 流地址 例如:rtmp://58.200.131.2:1935/livetv/hunantv 湖南卫视
|
|
|
+ public String stream_url;// 流地址 例如:rtmp://58.200.131.2:1935/livetv/hunantv 湖南卫视
|
|
|
public Long times_sec = 0L;// 停止录制时长 0为不限制时长
|
|
|
public String out_file_path;//输出路径
|
|
|
public String file_format = "mp4";//录制的文件格式
|
|
@@ -42,10 +42,10 @@ public class FfmpegUtil implements Runnable {
|
|
|
return;
|
|
|
}
|
|
|
// 流媒体输出地址,分辨率(长,高),是否录制音频(0:不录制/1:录制)
|
|
|
- recorder = new FFmpegFrameRecorder(out_file_path, frame.imageWidth, frame.imageHeight, is_audio ? 1 : 0);
|
|
|
+ recorder = new FFmpegFrameRecorder(out_file_path, 1024, 720, is_audio ? 1 : 0);
|
|
|
recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);//直播流格式
|
|
|
recorder.setFormat(file_format);//录制的视频格式
|
|
|
- recorder.setFrameRate(25);//帧数
|
|
|
+ recorder.setFrameRate(200);//帧数
|
|
|
recorder.start();//开始录制
|
|
|
// 计算结束时间
|
|
|
long endTime = System.currentTimeMillis() + times_sec * 1000;
|