아래 코드를 red5 앱의 Application 클래스에 추가하십시오. 녹음을 시작하고, 녹음을 디스크에 저장하고 중지하는 코드가 있습니다.
/*
*Start the recording
*/
public void recordVideo() {
IConnection conn = Red5.getConnectionLocal();
//get the stream published by the id "publishId"
ClientBroadcastStream stream = (ClientBroadcastStream) getBroadcastStream(conn.getScope(), "publishId");
try {
// Save the stream to disk.
stream.saveAs("streamName", false);
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
/*
*Stop the recording
*/
public void stopRecording(){
IConnection conn = Red5.getConnectionLocal();
ClientBroadcastStream stream = (ClientBroadcastStream) getBroadcastStream(conn.getScope(), "publishId");
// Stop recording.
stream.stopRecording();
stream.stop();
}
JUV RTMP은 RTMP 프로토콜 용 Java 클라이언트입니다. 이 (서버에서 지원)
재생 및 오디오/비디오 스트림을 게시
:하지만 모든 오디오/비디오 스트리밍을위한 코덱을 제공하지 않습니다 (! 오디오/비디오 코덱 구현이 포함되어 있지 않습니다!)
자바 클라이언트에서 red5로 스트리밍해야합니까? 아니면 red5로 스트리밍을 녹화 하시겠습니까? – fmodos
사실, 둘 다,하지만, 우선, 나는 녹음에 관심이 있어요. –
방금 시작 가이드와 함께 답변을 게시했지만 지금까지는 비디오를 게시 할 자바 rtmp 클라이언트를 얻을 수 없었습니다. – fmodos