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

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

问题描述

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

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

第一个问题是,当将MediaRecorder 输出设置为socket 时,流缺少一些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.

在这种情况下,常见的替代方法是使用 RTSP.它提供了一种类似的会话格式,拥有自己的 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、Wowza 和 Adob​​e Flash Player 进行录制和播放,与 Livu 开发者关于许可他们的客户.或者,您可以使用此客户端库及其完整的Android 记录器示例以构建您的客户端.

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天全站免登陆