直播视频流的Andr​​oid应用 [英] Live video streaming application on Android

查看:211
本文介绍了直播视频流的Andr​​oid应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立从Android的流视频直播实时视频流应用程序。

I am trying to build a live video streaming application that streams live video from Android.

使用MediaRecorder类,我能够捕捉到的视频数据3GP的形式,与H263 codeCS。

Using the MediaRecorder class, I am able to capture the video data in the form of 3gp, with h263 codecs.

然而,当我跑我的应用程序,流媒体,我得到一个2-3秒的延迟,在服务器端。

However, when I run my application and stream media, I get a 2-3 second delay at the server side.

为什么会出现这种延迟?是否有任何内部缓冲区,我需要刷新?是否有使用MediaRecorder类除了视频流的其他方式?

Why am I getting this delay? Are there any internal buffers that I need to flush? Are there other ways of streaming video apart from using MediaRecorder class?

推荐答案

如果您对RTMP流从Android的正在设置,最好的解决办法是的媒体codeC + FFmpeg的+ librtmp。这避免了哈克的字节流中检测NAL单元的业务,但需要的Andr​​oid 4.3。滑板,其中冰球是怎么回事...

If you're set on RTMP streaming from Android, the best solution is MediaCodec + FFmpeg + librtmp. This avoids any hacky "detect the NAL Unit within the bytestream" business but requires Android 4.3. Skate where the puck is going...

我已经开发了一个开源SDK 演示RTMP流用的 FFmpeg的+ librtmp为pre-内置共享库。该SDK是专注于HLS流,但RTMP支持是present。

I've developed an open source SDK that demonstrates RTMP streaming with FFmpeg + librtmp as pre-built shared libraries. The SDK is focused on HLS streaming, but RTMP support is present.

如果你想帮助建设的FFmpeg自己为Android(带或不带librtmp),看看我的指南

If you'd like help building FFmpeg yourself for Android (with or without librtmp), check out my guide.

这篇关于直播视频流的Andr​​oid应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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