Ios Streaming to Wowza Media Server - ios

I am developing an iOS application to stream video to wowza media server. I used MediaCommuncation Library for iOS and RTSPStreamPublisher. I am unable to connect to server with following issue:
RTMPStreamPublisher[527:90315] RTMPClient -> eventFailed: code = -7, description = fault code = -1 < Input or/and Output Stream is not opened

You have to check your wowwza Source security setting. By default RTMP Source Authentication is turned on and this RTSPStreamPublisher does not take any username and password from you so wowza rejects connection.
try to go to wows stream engine-> live -> source Authentication -> open RTMP Protocol... and then restart your server....
After that try to run your RTSPStreamPublisher... Enjoy.. :-)

Related

iOS OpenTok audio-video call has video disabled with an undocumented reason on iOS Simulator and routed sessions

While testing on the iOS Simulator a vide call with routed sessions the user gets its video disabled with an undocumented reason.
On the latest version of OpenTok 2.15.3 we can see that the possible reasons for video being disabled are:
typedef NS_ENUM(int32_t, OTSubscriberVideoEventReason) {
OTSubscriberVideoEventPublisherPropertyChanged = 1,
OTSubscriberVideoEventSubscriberPropertyChanged = 2,
OTSubscriberVideoEventQualityChanged = 3
};
on the iOS 11 simulator, right after trying to subscribe I'm getting the video enabled with OTSubscriberVideoEventReason == 2, right after it gets disabled with OTSubscriberVideoEventReason == 4 and then I get the following error on subscriberDidDisconnectFromStream:
Internal error -- WebRTC subscriber error.
Failed to set remote offer sdp:
Session error code: ERROR_CONTENT.
Session error description: Failed to set remote video description send
parameters..
kPCFailureSetRemoteDescription
The docs suggested trying to resubscribe, or reconnect... resubscribing didn't work. Furthermore it's only happening on the simulator, which makes me think that there is nothing really wrong with the setup, but the real question here is, what is the OTSubscriberVideoEventReason == 4?
TokBox Developer Evangelist here.
Yes, unfortunately, we didn't publicly document this specific case(sorry about that). We plan on adding this in the 2.16.0 release.
The reason that OTSubscriberVideoEventReason=4 is dispatched is when the video in the subscriber stream was disabled because the stream uses a video codec (such as H.264) that's not supported on the simulator.

Self-hosted Signal iOS is unable to connect to internet

same issue, other person: https://github.com/signalapp/Signal-iOS/issues/2282
We've checked out the Signal-iOS repository and we're trying to make it connect to another server. We're running an instance of the server at signal.appcraft.nl. We've modified the defines in SignalServiceKit/src/TSConstants.h to match our server and we've changed the domains in App Transport Security Settings in /Signal/Signal-Info.plist
We also cloned the Android app and that one we managed to got working just fine. The iOS app seems not to be able to connect to the internet at all without a clear error. The first HTTP call that is done is GET https://signal.appcraft.nl/v1/accounts/sms/code/<MYNUMBER>?client=ios. When we invoke that URL using curl, we get a response (and SMS) just fine. From the app, we receive a Signal was unable to connect to the internet. Please try from another WiFi network or use mobile data. error. We also changed NSAllowsArbitraryLoads to Yes.
We've added a breakpoint in /Signal-iOS/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m:292
# /Signal-iOS/Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m:292
(lldb) expr error
(NSURLError *) $3 = 0x00000001c0244800 domain: #"NSURLErrorDomain" - code: 18446744073709550617
Please advise

Error when connecting Rosbridge (Web Sockets)

I am developing an app for iOS with Swift 3, this application search with the Bonjour service some robots in the local network which use a specific service, for example robot.local and show them in a list. The Bonjour service gives me the domain of the device. This is a example of the domains searched.
Ex.:
robot1.local
robot2.local
The next step, is when the user click an element of the list. This action start a connection by web sockets with the device and connect it for control it with the Iphone. I am using a library called RBManager which use RocketSocket library for connect. This library helps me to connect to RosBridge.
I use this code for connect:
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:#"wss://192.168.0.100:9090"]];
self.socket = [[SRWebSocket alloc] initWithURLRequest:request];
self.socket.delegate = self;
[self.socket open];
The problem is when I am install the app by Xcode I have not any problem but when I am install the app by an ipa file or by TestFlight the connection is rejected and shows this error:
managerDidFailWithError Optional(ErrorDomain=NSOSTatusErrorDomain
Code=-9807 "(null)" UserInfo={_kCFStreamErrorDomainKey=3,
_kCFStreamErrorCodeKey=-9807})
I found this issue in the library but is not the solution that I need.
I am deactive ATS in the info.plist but I not know how to solve this error. Could anyone help me?
I found the problem. The problem was that my RosBridge backend run with TLS and I didn't implement it.
The solution is implement the authentication in the client and all works :D

How to create an HTTPS server on IOS using cocoaHTTPServer?

I made a javascript cloud app that runs on a webpage in a webview on my iPad app that communicates via WebSocket connection but it only works when im on my http site and not https or else I get an CFNetwork SSLHandshake failed (-9806) error in Xcode and on the website it says time out during handshake.
Is this because the webserver on the iPad is running on HTTP instead of HTTPS?
JAVASCRIPT CLOUD APP
This part in the cloud is working for HTTP when connecting to the web server on the iPad.
var protocol = "ws";
if (this.useSecureConnection)
protocol = "wss";
var url = protocol+'://localhost:'+this.port+'/service';
this.connection = new WebSocket(url);
Xcode iOS iPad App (Objective-C)
I thought that was the issue so I tried to enable HTTPS but I am not sure what to create for the "sslIdentityAndCertificates" method.
- (BOOL)isSecureServer
{
HTTPLogTrace();
// Override me to create an https server...
return YES;
}
/**
* This method is expected to returns an array appropriate for use in kCFStreamSSLCertificates SSL Settings.
* It should be an array of SecCertificateRefs except for the first element in the array, which is a SecIdentityRef.
**/
- (NSArray *)sslIdentityAndCertificates
{
HTTPLogTrace();
return nil;
}
Some of the other posts I have seen use APIs that are only available on Mac and not iOS.
I tried several combinations of ATS permissions as well. All resulted in HTTPS not allowing for WebSocket connection.
Any help is greatly appreciated! :)

Cordova | Get live stream from microphone on iOS

I am trying to build a voice calendar app that needs to use live stream from the microphone for speech recognition.
So you have a button that starts listening to the microphone and stops automatically when the user stops speaking.
I have already explored Cordova Media API that allows me to record the data to a wav file. This works but makes the process very slow since I need to wait for the recording to be finished.
I used the https://api.ai as a starting point to build the 1st version of the app which works quite well. It took care of all the "listening" part!
Next phase for me is to integrate with a few different speech recognition APIs.
The major issue for me has been the lack of native development skills, so are there any cordova plugins that can help me do this?
Update 1 - 1st April 2016
Found this https://subvisual.co/blog/posts/39-tutorial-html-audio-capture-streaming-to-node-js-no-browser-extensions
Will be trying to implement this in cordova through webrtc.
Update 2 - 1st April 2016
Installed https://github.com/eface2face/cordova-plugin-iosrtc to utilize webrtc
Update 3 - 2nd April 2016
Stuck at AudioContext.createMediaStreamSource is not a function on iOS!
AudioContext.createMediaStreamSource alternative for iOS?
Update 4 - 6th April 2016
Going Native - Time to learn iOS Development!
Sorry to hear that you gave up on Cordova, but if you still are interested: I've created a cordova plugin for iOS and Android, that enables you to capture microphone data and forward it to the web layer of your application. You can either rely on the Web Audio API to handle the incoming sound, or use any other way to encode and save the raw sound data:
https://github.com/edimuj/cordova-plugin-audioinput
Example usage:
function onAudioInput( evt ) {
// 'evt.data' is an integer array containing raw audio data
console.log( "Audio data received: " + evt.data.length + " samples" );
// ... do something with the evt.data array ...
}
// Listen to audioinput events
window.addEventListener( "audioinput", onAudioInput, false );
// Start capturing audio from the microphone
audioinput.start();

Resources