Issue in streaming audio with PeerJS - unity3d

I have a problem with PeerJS and audio. In particular, I use the stream coming from mediaDevices (both audio and video). In the transmitter page I can see the stream with both audio and video tracks. Instead in the receiver page I can see only the video, and the stream doesn't contain the audio track. What could be problem?
I'm working on Windows 11 with Edge browser, both transmitter and receiver websites are in the same network and I access them through ip.
Thank you!

Related

How to mute local audio playback while still receiving raw audio data with Agora API?

I'm trying to play back raw audio data from an Agora remote stream through an AudioSource in Unity. For this, I have to first disable the default playback method used by the Agora SDK. I have tried MuteAllRemoteAudioStreams but this stops the API from receiving remote audio data altogether.
I have also tried AdjustPlaybackSignalVolume and AdjustAudioMixingVolume, which successfully mute the audio playback but this also makes the OnPlaybackAudioFrameHandler callback receive empty audio frames, stopping me from accessing raw audio data.
SetAudioPlaybackDeviceMute simply mutes the playback device, which is not what I am looking for.
Is there a way to only mute the playback of remote streams while also being able to access raw audio data?
Try mRtcEngine.AdjustPlaybackSignalVolume(0);
This will turn the playback volume from the channel, but your AudioSource volume is not affected.
If you have other issues, please come chat with us and search for answers in our slack group:
https://agoraiodev.slack.com/messages/unity-help-me

How to stream video(local video file) from an android phone to different android phones

I am trying to establish multimedia streaming among multiple android devices. Where all of them play a synchronized video. An good example of my idea is Samsung video group play. Thanx in advance.
Google how to implement an RTSP server on the host device and then all of the client devices can connect to the RTSP stream. For the synchronization matter - either use multicast or server the same payload with adjusted timestamps to all the clients.

how to stream high quality video and audio from iPhone to remote server through Internet

I am seeking the following three items, which I cannot find on STACKOVERFLOW or anywhere:
sample code for AVFoundation capturing to file chunks (~10seconds) that are ready for compression?
sample code for compressing the video and audio for transmisison across the Internet?
ffmpeg?
sample code for HTTP Live Streaming sending files from iPhone to Internet server?
My goal is to use the iPhone as a high quality AV camcorder that streams to a remote server.
If the intervening data rate bogs down, files should buffer at the iPhone.
thanks.
You can use AVAssetWriter to encode a MP4 file of your desired length. The AV media will be encoded into the container in H264/AAC. You could then simply upload this to a remote server. If you wanted you could segment the video for HLS streaming, but keep in mind that HLS is designed as a server->client streaming protocol. There is no notion of push as far as I know. You would have to create a custom server to accept pushing of segmented video streams (which does not really make a lot of sense given the way HLS is designed. See the RFC Draft. A better approach might be to simply upload the MP4(s) via a TCP socket and have your server segment the video for streaming to client viewers. This could be easily done with FFmpeg either on the command line, or via a custom program.
I also wanted to add that if you try and stream 720p video over a cellular connection your app will more then likely get rejected for excessive data use.
Capture Video and Audio using AVFouncation. You can specify the Audio and Video codecs to kCMVideoCodecType_H264 and kAudioFormatMPEG4AAC, Frame sizes, Frame rates in AVCaptureformatDescription. It will give you Compressed H264 video and AAC aduio.
Encapsulate this and transmit to server using any RTP servers like Live555 Media.

Streaming audio from iPhone

Does anybody know of a way to stream audio from a file being played back in an app over the internet in a standardized streaming audio format? That is server up an Audio stream from the iPhone.
You need a http server on you device, multiple packet audio files, like:
http://your.com/audio1.mp3
http://your.com/audio2.mp3
http://your.com/audio3.mp3
And m3u file that shows the current realtime file... surely with a small delay, try 0.5 sec, the client opens http://your.com/play.m3u and plays with AVPlayer the stream. Like that.
In 4.0, just open the .m3u URL with the AVAudioPlayer. It was never simpler to stream audio.

Stream video from the server . {iPhone SDK}

I'm trying to stream video with static IP : http://38.117.88.148/GemTVLink
via iPhone. Can you show me some information as to how I could implement this? I see an apple video stream app but it seems it can show only .mp4 movies? Am I right?
I want my app to load the HTTP address and play the movie, that's it.
This link works on media player.
The iPhone does not support all streaming video formats.
You should start by reading HTTP Live Streaming Overview
iOS native video player (AVPlayer, MPMoviePlayerViewController ...) can stream from http server in m3u8 format.
I looked at the link, that you mentioned(GemTVLink), it's an mms stream, iOS can not stream from microsoft streaming servers (mms), if you want to do that, you should use ffmpeg library, as this library can connect any streaming server (supporting rtsp, mms, tcp, udp ,rtmp ...) and then draw pictures to the screen.. (for drawing you can use opengles or uiimage also works)
First of all, use avformat_open_input to connect to your ip address then use avcodec_find_decoder & avcodec_open2 to find codecs and to open them (you should call them for both audio & video)
Then, in a while loop read packets from server by using av_read_frame method When you get frame, if it is audio then sent it to AudioUnit or AudioQueue, if it is video, then convert it from yuv to rgb format by using sws_scale method and draw the picture to the screen.
That's all.
look at this wrapper also (http://www.videostreamsdk.com), it's written on ffmpeg library and supports iOS