Wrong NetStatusEvent for Flash multicast - actionscript-3

I have created a simple multicast player using actinscript 3 which works fine and plays multicast stream well . Although when stream should fail . Or even if I stop Flash Media server it returns success codes : "NetConnection.Connect.Success" ,"NetStream.Connect.Success" and "NetStream.Play.Start" . I cant detect it when multicast stream fails in flash player. I need to switch to unicast stream if multicast fails and I cant detect a failure because of wrong status.
Why I am getting wrong status ?

I was finally able to figure this out from this link http://forums.adobe.com/message/4999537#4999537 . I now use NetStream.MulticastStream.Reset along with a timeout of 10 seconds .

Related

WebRTC : while creating second peer connection - fail to navigator.mediaDevices.getUserMedia

I am working on webrtc chat app.
system1 : peer1, peer3 | system2 : peer2, peer4
What I did ?
For video call, I am creating one peer1, peer2, and that peer1 very successfully communicate with peer2 (consider video call only).
What I want to do?
I want, peer3 can communicate with new peer4(meanwhile I don't want to disconnect peer1-->peer2).
What happening ?
When I am creating peer3, on that time " navigator.mediaDevices.getUserMedia " getting errors !!!! (I am not using SSL) and new peer3 can't create !.
So, please tell me your suggestions regarding above problem.
It is possible to only peer1 can communicate with other any peer(bidirectional communication)??
This could be the browser failing to capture video from the webcam if it's already in use by another browser or another tab in the same browser. For example, Firefox 57 on my Ubuntu 16.04 machine exhibits this behavior (Chrome does not).

AS3 ServerSocket / Socket dropping intermittently

Making a game that uses an android tablet as a controller. Both the game and the controller being written in Flash / AS3.
Mostly it is working well. However, on occasion, the controller will just stop sending data. The server is receiving messages they are just blank.
I am using the accelerometer on the device to control the game, and send the 'angle' at 50ms intervals. Sometimes I can play through all three game levels 10 times with no issue. And then once in a while I'll be playing and the accel data is blank.
Not sure what is happening... I'm not getting a disconnect or other error - the server keeps replying showing that the clientMessage handler is being called - it just shows blank data.

View h264 from rtmpsrc via gstreamer

I want to play flash media server stream via gstreamer. My video is published from camera to FMS with h264 encoding (720x480 Main,3.0).
My command for ubuntu is:
gst-launch-1.0 rtmpsrc
location="rtmp://192.168.1.153:1935/appname/mp4:cameraFeed44.mp4
live=1" ! decodebin name=decoder decoder. ! queue ! videoconvert !
queue ! xvimagesink
For resolution 720x480 it throws:
ERROR: from element /GstPipeline:pipeline0/GstRTMPSrc:rtmpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2812): gst_base_src_loop (): /GstPipeline:pipeline0/ GstRTMPSrc:rtmpsrc0:
streaming task paused, reason error (-5)
ERROR: pipeline doesn't want to preroll.
However it works fine for low resolution, like: 320x240. But I need even more than FullHD.
Thanks,
Stan

flash media server (FMS) reattach camera to new stream

I'm using flash media server and trying to record the stream but having a problem as I've outlined below. Thanks for taking the time to read this post.
How do I detach my camera from one stream and attach it to a new stream? What I'm trying to do is record the camera stream for 10 seconds and then play it live on a different stream..I try to netstream.close and then netstream.attachCamera(cam0) but it won't let me attach it to the second new stream. What's wrong?
You dont have to close the stream. You can use the attachCamera method with a null argument.
netstream.attachCamera(null);

Captured audio buffers are all silent on Windows Phone 8

I'm trying to capture audio using WASAPI. My code is largely based on the ChatterBox VoIP sample app. I'm getting audio buffers, but they are all silent (flagged AUDCLNT_BUFFERFLAGS_SILENT).
I'm using Visual Studio Express 2012 for Windows Phone. Running on the emulator.
I had the exact same problem and managed to reproduce it in the ChatterBox sample app if I set Visual Studio to native debugging and at any point stepped through the code.
Also, closing the App without going through the "Stop" procedure and stopping the AudioClient will require you to restart the emulator/device before being able to capture audio data again.
It nearly drove me nuts before I figured out the before mentioned problems but I finally got it working.
So..
1. Be sure to NOT do native debugging
2. Always call IAudioClient->Stop(); before terminating the App.
3. Make sure you pass the correct parameters to IAudioClient->Initialize();
I've included a piece of code that works 100% of the time for me. I've left out error checking for clarity..
LPCWSTR pwstrDefaultCaptureDeviceId =
GetDefaultAudioCaptureId(AudioDeviceRole::Communications);
HRESULT hr = ActivateAudioInterface(pwstrDefaultCaptureDeviceId,
__uuidof(IAudioClient2), (void**)&m_pAudioClient);
hr = m_pAudioClient->GetMixFormat(&m_pwfx);
m_frameSizeInBytes = (m_pwfx->wBitsPerSample / 8) * m_pwfx->nChannels;
hr = m_pAudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,
AUDCLNT_STREAMFLAGS_NOPERSIST | AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
latency * 10000, 0, m_pwfx, NULL);
hr = m_pAudioClient->SetEventHandle(m_hCaptureEvent);
hr = m_pAudioClient->GetService(__uuidof(IAudioCaptureClient),
(void**)&m_pCaptureClient);
And that's it.. Before calling this code I've started a worker thread that will listen to m_hCaptureEvent and call IAudioCaptureClient->GetBuffer(); whenever the capture event is triggered.
Of course using Microsoft.XNA.Audio.Microphone works fine to, but it's not always an option to reference the XNA framework.. :)
It was a really annoying problem which waste about 2 complete days of mine.My problem was solved by setting AudioClientProperties.eCatagory to AudioCategory_Communications instead of AudioCategory_Other.
After this long try and error period I am not sure that the problem won't repeat in the future because the API doesn't act very stable and every run may return a different result.
Edit:Yeah my guess was true.Restarting the wp emulator makes the buffer silent again.But changing the AudioClientProperties.eCatagory back to AudioCategory_Other again solve it.I still don't know what is wrong with it and what is the final solution.
Again I encounter the same problem and this time commenting (removing) the
properties.eCategory = AudioCategory_Communications;
solve the problem.
I can add my piece of advice for Windows Phone 8.1.
I made the following experiment.
Open capture device. Buffers are not silent.
Open render device with AudioDeviceRole::Communications. Buffers immediately go silent.
Close render device. Buffers are not silent.
Then I opened capture device with AudioDeviceRole::Communications and capture device works fine all the time.
For Windows 10 capture device works all the time, no matter if you open it with AudioDeviceRole::Communications or not.
I've had the same problem. It seems like you can either use only AudioCategory_Other or create an instance of VoipPhoneCall and use only AudioCategory_Communications.
So the solution in my case was to use AudioCategory_Communications and create an outgoing VoipPhoneCall. You should implement the background agents as in Chatterbox VoIP sample app for the VoipCallCoordinator to work .