简体   繁体   English

iOS直播到Azure媒体服务

[英]iOS broadcasting live to Azure Media Services

I am trying to make a Periscope-like app (not practically, but technical requirements are alike) where users can start streaming quickly from their iPhone to an unknown amount of users, both mobile. 我正在尝试制作一个类似Periscope的应用程序(实际上并不实用,但是技术要求是一样的),用户可以从他们的iPhone快速开始向不明数量的用户(无论是移动用户)流式传输。 I am trying to use Azure Media Services for live video streaming, but even after reading pages of documentation I'm stuck. 我正在尝试使用Azure Media Services进行实时视频流传输,但是即使阅读了文档页面之后,我仍然无法使用。

I'm using VideoCore ( https://github.com/jgh-/VideoCore ) to publish from iOS device to the RTMP server. 我正在使用VideoCore( https://github.com/jgh-/VideoCore )从iOS设备发布到RTMP服务器。 On local (using Wowza) I can just connect to the local server with my set username and password as shown: 在本地(使用Wowza)上,我可以使用设置的用户名和密码连接到本地服务器,如下所示:

vcSession = [[VCSimpleSession alloc] initWithVideoSize:CGSizeMake(1280, 720) frameRate:30 bitrate:1000000 useInterfaceOrientation:NO];
[self.view addSubview:vcSession.previewView];
vcSession.previewView.frame = self.view.bounds;
vcSession.delegate = self;
[vcSession startRtmpSessionWithURL:@"rtmp://172.20.10.2:1935/live?rtmpauth=test:test" andStreamKey:@"test"];

Where the rtmpauth parameter has the username:password format, which I've set both to test on my local server. rtmpauth参数具有username:password格式,我将两者都设置为在本地服务器上进行test It works. 有用。 In Azure, I've created a channel named test , and I've got the following Ingest URL: 在Azure中,我创建了一个名为test的通道,并且具有以下Ingest URL:

rtmp://test-myappname.channel.mediaservices.windows.net:1935/live/some-long-hexadecimal-string

In Wirecast, I'm able to stream to URL (though EXTREMELY slow and connection frequently lost, don't know why) by selecting Azure Media Services in Output Settings and typing that Ingest URL. 在Wirecast中,我可以通过在“输出设置”中选择“ Azure媒体服务”并键入该“接收URL”,以流式传输到URL(尽管速度极慢且连接经常丢失,不知道为什么)。 In iOS, I have no idea how to connect to Azure Media Services. 在iOS中,我不知道如何连接到Azure媒体服务。

In startRtmpSessionWithURL:andStreamKey: method, I've tried all the possible combinations of URL and a stream key, but no luck. startRtmpSessionWithURL:andStreamKey:方法中,我尝试了URL和流键的所有可能组合,但是没有运气。 I have no idea what my username/password is (nothing is given at the Azure side), what the stream key is (I've tried test , live , empty string) and what that long hexadecimal string is (some sources say that it's called a locator, though). 我不知道我的用户名/密码是什么(Azure端没有给出),流密钥是什么(我已经尝试过testlive ,空字符串)以及那个长十六进制字符串是什么(有些消息来源说这是不过称为定位器)。

What is the correct format of RTMP URL and stream key when connecting to Azure Media Services for streaming? 连接到Azure Media Services进行流传输时,RTMP URL和流密钥的正确格式是什么?

I'll find someone to help you. 我会找人帮你的。 I think you are just missing a stream name after the long hex string in the URL. 我认为您只是在URL中的长十六进制字符串之后缺少流名称。

rtmp://test-myappname.channel.mediaservices.windows.net:1935/live/some-long-hexadecimal-string/ [YOUR-CUSTOM-STREAM-NAME-Anything Really!] rtmp://test-myappname.channel.mediaservices.windows.net:1935 / live / some-long-hexadecimal-string / [您的自定义流名称-真的!!

Also, do you have any control over the encoding settings? 另外,您可以控制编码设置吗? Its possible that some encoding settings are not right. 某些编码设置可能不正确。 We have not tested with that VideoCore library, so it may also be that there is a slight variation in the RTMP protocol (since it is very poorly documented and there is a lot of missing information out there). 我们尚未使用该VideoCore库进行过测试,因此RTMP协议也可能存在细微差异(因为该文档的文献记录很差,并且那里缺少很多信息)。

I'm curious why your Wirecast setup is having trouble as well. 我很好奇为什么您的Wirecast设置也会遇到问题。 That doesn't sound good to start with. 一开始听起来并不好。 Network issue? 网络问题? Are you setting it to the proper Encoder preset with H.264 and NOT x264 set? 您是否将其设置为设置了H.264且未设置x264的正确编码器?

Review your settings in Wirecast against Cenk's blog post here: http://azure.microsoft.com/blog/2014/09/18/azure-media-services-rtmp-support-and-live-encoders/ 在此处针对Cenk的博客文章中查看Wirecast中的设置: http ://azure.microsoft.com/blog/2014/09/18/azure-media-services-rtmp-support-and-live-encoders/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM