对于Android UDP或RTP流媒体解决方案 [英] UDP or RTP streaming solution for android

查看:408
本文介绍了对于Android UDP或RTP流媒体解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要建立一个Android应用程序,以显示电视直播饲料。 该应用应该从DVB网关的一个多播播放实况视频流,并根据所述网关供应商它可以流出UDP或RTP。 我设置了VLC我的电脑上,以流出来UDP和RTP,并打破了我的手指试图让Android的玩家,向他们展示。一段时间后,我发现,机器人只支持HTTP / S和RTSP实时流。我尝试了所有FFmpeg的解决方案和不同的媒体播放器,但没有成功呢。我不是一个视频专家,但我的理解RTSP是RTP的封装,可我的RTP饲料包裹和流(甚至通过代理)?没有人知道的工作UDP的解决方案?

I need to create an android app to display a live TV feed. the app is supposed to play live video streams from a Multicast of a DVB gateway, according to the gateway vendor it can stream out UDP or RTP. I set up vlc on my computer to stream out UDP and RTP and broke my fingers trying to get the android player to show them. after a while I found out that android only supports HTTP/S and RTSP live streams. I tried all the FFMPEG solutions and different media players with no success yet. I am not a video expert but to my understanding RTSP is an encapsulation of RTP, can my RTP feed be wrapped and streamed (even via proxy) ? does anyone know of a working UDP solution ?

感谢

我开始写一个隧道传递来自1234端口本地UDP流,在端口8888,我用VLC测试TCP连接,UDP有效载荷看起来是正确的,我能看到VLC初始化HTTP连接当我等待的TCP监听器接受连接。但还是VLC不会打造成HTTP流, 我的code:

I started writing a tunnel that passes a local UDP stream from port 1234, to a TCP connection on port 8888. I am testing with VLC, the UDP payload looks correct, and I am able to see the VLC init the http connection when I wait for the TCP listener to accept the connection. but still VLC wont play the resulting HTTP stream, my code:

public void Bridge()
    {
        //endpoints
        IPEndPoint myRemoteEndpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 1234);

        //communications objects
        UdpClient myUdpClient = new UdpClient(myRemoteEndpoint);
        TcpListener myTcpListener = new TcpListener(IPAddress.Any, 8888);

        //buffer
        byte[] buffer = new byte[2048];

        //start tcp listener
        myTcpListener.Start();
        Socket tcpAcceptedSocket = myTcpListener.AcceptSocket();            

        while (true)
        {
            try
            {
                //get data from UDP client
                buffer = myUdpClient.Receive(ref myRemoteEndpoint);

                //send bytes received from UDP over TCP
                tcpAcceptedSocket.Send(buffer);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }

        //close sockets
        myUdpClient.Close();
        myTcpListener.Stop();

    }

什么想法?

推荐答案

希望的你已经解决了这个了吗?

Hopefully you've solved this already?

我首先想到的是你怎么退出了,而(真)循环?笑

My first thought was "how do you exit that while (true) loop?" lol

RTP加入到Android SDK的API级别12:

RTP was added to the Android SDK in API level 12:

http://developer.android.com/reference/安卓/ NET / RTP /包summary.html

也许你可以用 android.net.rtp 来引起你的视频流。似乎有一个显著缺乏这方面的教程,所以如果你没有/做得到这个工作,我敢肯定,迅速写了能飞起来的大G的搜索结果;更不要说帮助了超过600对的StackOverflow的其他问题,提出了在机器人UDP RTP搜索海报。

Perhaps you can use android.net.rtp to catch your streaming video. There seems to be a significant lack of tutorials in this area, so if you did/do get this working I'm sure a quick write-up could fly up the big G search results; not to mention helping out the posters of 600+ other questions on stackoverflow that come up in an "android udp rtp" search.

从博客邻球:

http://burcudogan.com / 2011/06/05 / Android的RTP-实现的基础上,UDP /

我会折腾的一个插件,以实现WebRTC,因为它看起来很有希望:

And I'll toss in a plug for WebRTC because it looks promising:

http://www.html5rocks.com/en/tutorials/webrtc/basics /

这篇关于对于Android UDP或RTP流媒体解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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