我正在尝试使用 xuggle 和 red5 在浏览器中生成流式视频。作为第一步,我只是尝试通过 xuggle 运行视频并将其显示在我的 red5 服务器上。问题是我不知道如何配置 red5 来连接我的 java 代码。我在这里有这段代码:
private static String outputUrl = "rtmp://localhost:5080/oflaDemo/";
private static String inputFilename = "/home/usr/jworkspace1/GetContainerInfo/aaa.ogg";
public static void main(String[] args)
{
IMediaReader mediaReader = ToolFactory.makeReader(inputFilename);
// create a media writer
IMediaWriter mediaWriter = ToolFactory.makeWriter(outputUrl, mediaReader);
// add a writer to the reader, to create the output file
mediaReader.addListener(mediaWriter);
// create a media viewer with stats enabled
IMediaViewer mediaViewer = ToolFactory.makeViewer(true);
// add a viewer to the reader, to see the decoded media
mediaReader.addListener(mediaViewer);
// read and decode packets from the source file and
// and dispatch decoded audio and video to the writer
while (mediaReader.readPacket() == null)
{
;
}
}
这给了我一个错误,上面写着:
java.lang.IllegalArgumentException: could not open: rtmp://localhost:5080/oflaDemo/
我的问题是如何打开 red5 以从我的 java 程序接收 rtmp?