V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
s451124894
V2EX  ›  Java

red5 接受 rtmp 流 使用 saveas 或者 record 方式推送 进行录制流问题

  •  
  •   s451124894 · 2016-03-05 14:03:15 +08:00 · 3049 次点击
    这是一个创建于 3214 天前的主题,其中的信息可能已经有所发展或是发生改变。

    red5 服务端接受 rtmp 流 h.264 编码 进行保存 报错 求解决办法
    @Override
    public void streamPublishStart(IBroadcastStream stream) {
    String streamName=stream.getPublishedName();
    iapp = new Application();
    iconn = Red5.getConnectionLocal();//得到当前的连接
    iscope = iconn.getScope();//一组连入服务器的客户
    iapp.connect(iconn,iscope,null);
    System.out.println("connection Established!");
    //注意 stream name ,在 flash 端也需要匹配
    istream = (ClientBroadcastStream)iapp.getBroadcastStream(iscope,streamName);
    System.out.println("The publisher's name is: "+stream.getPublishedName()+", created at: "+stream.getCreationTime());
    System.out.println("the stream Name is: "+streamName);
    try {
    istream.saveAs(streamName, false);
    System.out.println(istream.toString()+"__Sd");
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    super.streamPublishStart(stream);
    

    }
    报错内容
    [WARN] [Red5_Scheduler_Worker-12] org.red5.server.stream.consumer.FileConsumer - Exception waiting for write result. Timeout: 500ms
    java.util.concurrent.ExecutionException: java.nio.InvalidMarkException
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:262) ~[na:1.7.0]
    at java.util.concurrent.FutureTask.get(FutureTask.java:119) ~[na:1.7.0]
    at org.red5.server.stream.consumer.FileConsumer.acquireWriteFuture(FileConsumer.java:370) [red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at org.red5.server.stream.consumer.FileConsumer.writeQueuedDataSlice(FileConsumer.java:284) [red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at org.red5.server.stream.consumer.FileConsumer.pushMessage(FileConsumer.java:273) [red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at org.red5.server.stream.RecordingListener.processQueue(RecordingListener.java:303) [red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at org.red5.server.stream.RecordingListener.access$300(RecordingListener.java:57) [red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at org.red5.server.stream.RecordingListener$EventQueueJob.execute(RecordingListener.java:367) [red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at org.red5.server.scheduling.QuartzSchedulingServiceJob.executeInternal(QuartzSchedulingServiceJob.java:89) [red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:112) [spring-context-support-4.0.8.RELEASE.jar:4.0.8.RELEASE]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-2.1.7.jar:na]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz-2.1.7.jar:na]
    Caused by: java.nio.InvalidMarkException: null
    at java.nio.Buffer.reset(Buffer.java:298) ~[na:1.7.0]
    at org.apache.mina.core.buffer.AbstractIoBuffer.reset(AbstractIoBuffer.java:414) ~[mina-core-2.0.8.jar:na]
    at org.red5.io.flv.impl.FLVWriter.writeTag(FLVWriter.java:312) ~[red5-io-1.0.5-RELEASE.jar:na]
    at org.red5.server.stream.consumer.FileConsumer.write(FileConsumer.java:633) [red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at org.red5.server.stream.consumer.FileConsumer.doWrites(FileConsumer.java:541) [red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at org.red5.server.stream.consumer.FileConsumer$1.run(FileConsumer.java:289) ~[red5-server-common-1.0.5-RELEASE.jar:1.0.5-RELEASE]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.7.0]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.7.0]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) ~[na:1.7.0]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) ~[na:1.7.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) ~[na:1.7.0]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) ~[na:1.7.0]
    at java.lang.Thread.run(Thread.java:722) ~[na:1.7.0]

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2353 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 00:22 · PVG 08:22 · LAX 16:22 · JFK 19:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.