Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何将rtmp url发布到red5?_Java_Red5_Xuggle - Fatal编程技术网

Java 如何将rtmp url发布到red5?

Java 如何将rtmp url发布到red5?,java,red5,xuggle,Java,Red5,Xuggle,我正在尝试使用xuggle和red5在浏览器中生成流式视频。作为第一步,我只是尝试通过xuggle运行一个视频,并将其显示在我的red5服务器上。问题是我不知道如何配置red5来连接我的java代码。我这里有这个代码: private static String outputUrl = "rtmp://localhost:5080/oflaDemo/"; private static String inputFilename = "/home/usr/jworkspace1/GetContain

我正在尝试使用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?

我认为端口5080是http端口

港口 默认情况下,Red5打开以下端口:

  • 5080(HTTP端口-嵌入式Tomcat)
  • 1935年(RTMP港)
  • 8443(RTMPS端口)
  • 9980(JMX端口-管理和关闭)
您应该使用端口1935进行rtmp