Это моя логика, сначала прослушайте rtmp-канал, чтобы записать видео и аудио в файл
Код: Выделить всё
if(msg instanceof VideoMessage vm){
byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.writeBytes(vm.getVideoData());
File file = new File("tmp/video_" + i);
FileOutputStream fos = new FileOutputStream(file);
fos.write(byteArrayOutputStream.toByteArray());
fos.close();
}
Код: Выделить всё
FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(input);
grabber.setFormat("h264");
grabber.start();
FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(outputFilePath, grabber.getImageWidth(), grabber.getImageHeight());
recorder.start();
while ((frame = grabber.grab()) != null) {
recorder.record(frame);
}
grabber.stop();
grabber.release();
recorder.stop();
recorder.release();
}
Код: Выделить всё
data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
Подробнее здесь: https://stackoverflow.com/questions/787 ... o-secondly