将视频输入流转换为RTMP [英] Convert video Input Stream to RTMP

查看:705
本文介绍了将视频输入流转换为RTMP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将视频记录从我的android手机流式传输到网络媒体服务器.

I want to stream video recording from my android phone to network media server.

第一个问题是,将MediaRecorder输出设置为套接字时,流缺少某些mdat大小的标头.可以通过对本地流进行预处理并将丢失的数据添加到流中以产生有效的输出流来解决此问题.

The first problem is that when setting MediaRecorder output to socket, the stream is missing some mdat size headers. This can be fixed by preprocessing that stream locally and adding missing data to stream in order to produce valid output stream.

问题是如何从那里继续.

The question is how to proceed from there.

如何将该流作为RTMP流输出?

How can I go about output that stream as an RTMP stream?

推荐答案

首先,让我们解决您的问题.如您所料,Android当前不支持 RTMP .您可以使用少量边库来添加支持,但是这些可能不是完整的实现,或者有其他不良影响和错误,导致它们无法满足您的需求.

First, let's unwind your question. As you've surmised, RTMP isn't currently supported by Android. You can use a few side libraries to add support, but these may not be full implementations or have other undesirable side effects and bugs that cause them to fail to meet your needs.

在这种情况下,常见的替代方法是使用具有自己的RFC ,并且与RTP结合使用时,其数据包结构为与您所需的协议非常相似(没有一些细节).您可以在此处执行必要的修复,以将RTP/RTSP转换为RTMP,但是如上所述,这种工作目前不在您的应用程序的开发范围之内.

The common alternative in this case is to use RTSP. It provides a comparable session format that has its own RFC, and its packet structure when combined with RTP is very similar (sans some details) to your desired protocol. You could perform the necessary fixups here to transmute RTP/RTSP into RTMP, but as mentioned, such effort is currently outside the development scope of your application.

因此,假设您要使用RTMP(使该线程无效)并且上面链接的库不能满足您的需求.

So, let's assume you would like to use RTMP (invalidating this thread) and that the above-linked library does not meet your needs.

例如,您可以 Livu进行交谈开发人员有关为其客户授予许可的信息.或者,您可以使用此客户端库及其完整的

You could, for example, follow this tutorial for recording and playback using Livu, Wowza, and Adobe Flash Player, talking with the Livu developer(s) about licensing their client. Or, you could use this client library and its full Android recorder example to build your client.

总结:

  • This thread, using Darwin Media Server, Windows Media Services, or VLC
  • This library,
  • This thread and this tutorial, using Livu, Wowza, and Adobe Flash Player
  • This client library and this example recorder

祝您应用程序好运.我承认我对所有这些库的理解还不够全面,但是在撰写本文时,这些似乎是该领域的标准解决方案.

Best of luck with your application. I admit that I have a less than comprehensive understanding of all of these libraries, but these appear to be the standard solutions in this space at the time of this writing.

根据OP,遍历RTMP库集:

According to the OP, walking the RTMP library set:

  • This library: He couldn't make the library demos work. More importantly, RTMP functionality is incomplete.
  • This thread and this tutorial, using Livu, Wowza, and Adobe Flash Player: This has a long tutorial on how to consume video, but its tutorial on publication is potentially terse and insufficient.
  • This client library and this example recorder: The given example only covers audio publication. More work is needed to make this complete.

简而言之:需要做更多的工作.这里还需要其他答案以及对这些示例的改进.

In short: more work is needed. Other answers, and improvements upon these examples, are what's needed here.

这篇关于将视频输入流转换为RTMP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆