我试着让我的android设备把它的摄像头实时传输到网络浏览器上。我在androidhive上读了一篇很棒的教程,讲到如何使用wowza来做到这一点。然而,我正在寻找一个自由的解决方案。我决定在本地机器上安装一个带有rtmp模块的nginx服务器,该服务器可以从局域网外部访问。我可以在没有问题的情况下使用OBS流我的屏幕。
我的设置:
在nginx中,我使用以下conf:
rtmp {
server {
listen 1935;
allow play all;
chunk_size 4000;
application live {
live on;
allow publish all;
allow play all;
exec_pull c:/nginx/ffmpeg -i "rtsp://127.0.0.1:1935/live/test" -f flv -r -s -an "rtmp://127.0.0.1:1935/live/pc"
#enable HLS
hls on;
hls_path "c:/nginx/www/hls";
hls_fragment 3;
hls_playlist_length 60;
}
}
}我真的很不确定关于芬伯的话.
在我的android应用程序中,它很简单,我从androidhive教程中学到了这个类:http://www.androidhive.info/2014/06/android-streaming-live-camera-video-to-web-page/,我在使用android for android:https://github.com/fyhertz/libstreaming
因此,我只需使用以下行创建一个RTSP客户端:
Matcher m = uri.matcher("rtsp://127.0.0.1:1935/live/test");它应该创建一个RTSP客户端,用RTSP协议连接到127.0.0.1:1935,并将摄像机流到"test“通道中的"live”应用程序。因此,我的nginx应该在1935年端口上接收一些东西,并使用ffmpeg将RTSP转换为RTMP,对吗?
我错过了什么让整件事运转起来的东西?我真的被困住了,没有办法去尝试
谢谢!
发布于 2017-08-21 03:33:58
使用10.0.2.2 -主机循环后接口的特殊别名(127.0.0.1)
变化
Matcher m = uri.matcher("rtsp://127.0.0.1:1935/live/test");至
Matcher m = uri.matcher("rtsp://10.0.2.2:1935/live/test");https://stackoverflow.com/questions/44473205
复制相似问题