How do I extract and record audio in webRTC on Firefox? - firefox

I implemented one to one webRTC video chat (Both audio and video)
navigator.getUserMedia({
audio: true,
video:true
}, function (stream) {
}, function(err){
})
But i want to record only audio of the chat session. In chrome i am able to record by using RecordRTC, But in Firefox i am getting video+audio file (webM).
How do I extract audio in Firefox from audio+video stream?

you have one of two ways to do it, when you make new recording, you do new RecordRTC(stream, config):
currently the stream you are passing must be videostream, you can change it to audiostream as stream.getAudioTracks()[0], I have not tried this, but guessing that it should work.
or as part of config, add an attribute recorderType: window.StereoRecorder, now it would use StereoRecorder and not firefox's own MediaStreamRecorder.
p.s: have you tried recording remote stream in chrome, because chrome supports recording only stereo mode and webrtc provides audio in mono mode.

Related

RecordRTC - Playing recordings on Safari fails

I am using RecordRTC to allow my application user to record their video and upload. This works perfectly fine with Chrome and Mozila Firefox but Safari having trouble playing recorded videos.
I research for the same and found mimeType: 'video/webm\;codecs=vp8' to be used for safari. However this still won't work on Safari browsers. (mac OS x and iOS)
Can someone please help me with this? I have multiple users working on different operating systems and working on different browsers and I want to make sure RecordRTC works for all of them.
I am open to change/ switch to any other alternative if available to implement this feature with cross-browser support of course.
I found Twilio but I am not sure whether Twilio supports standalone recordings or not? I mean I just want single user to go on a page record a video and upload.
Please see below my RecordRTC configuration if it helps:
const options = {
type: 'video',
mimeType: 'video/webm\;codecs=vp8',
bitsPerSecond: 128000,
timeSlice: 1000
};
After user completes the recording, I am converting it to a blob and append it to the formData to save it to the server:
var recordedBlob: Blob = recordRTC.getBlob();
formData.append('files', recordedBlob, this.courseComponent?.courseComponent?.name + '.webm');
This recorded video plays fine in Chrome and Firefox but in Safari it Fails.
Please if you can guide me through this it will be great help to me.
Thanks.
Below are the console log snaps:
1.browser does not support media recorder api
when tried to play the recorded video
says browser does not support media recorder api and try using whammyRecorder

How can I pass/create a fake media stream to Edge/IE WebDriver?

There are some flags to create a fake media stream for web camera recording. For example:
'--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream' (Chrome);
'make.navigator.streams.fake' (Firefox).
Are there any flags for Edge/IE browser to pass them to WebDriver capability (Selenium::WebDriver.new :remote, { url: url, desired_caps: caps })?
Currently, there is no such BrowserStack specific custom capability to pass fake media stream on IE and edge. However, you can use the same on chrome and firefox as you have mentioned above. The Chrome Option 'use-fake-device-for-media-stream' is used to grant camera access. However, you can use the 'use-fake-ui-for-media-stream' Chrome Option that will handle the scenarios for 'use-fake-device-for-media-stream' as well('Use you Microphone' OR 'Use your camera' popup).

Convert mp3 to ogg via Paperclip (S3) on Heroku

I have a media attribute (from paperclip) that can be audio or image. I use an HTML5 audio player (jplayer) for an audio player on the front-end which works well in Chrome and Safari but Firefox has trouble with mp3 and needs a ogg format file. I see usage of ffmpeg but am unsure how to implement to also work on Heroku. I have tried using paperclip-ffmpeg like below but it hasn't been re-formatting the file (have tried format as 'ogv' and 'ogg'):
has_attached_file :media, styles: { ogg: { format: 'ogv' } }, processors: [:ffmpeg]
Any ideas?

Can not play local rtsp URL using FFmpeg in iOS

I am using FFmpeg for stream rtsp URL in iOS.
I am trying to stream a local url but my app is failed to open url
avformat_open_input method always return -5
I have played the same url rtsp://172.16.1.226:5544/1 on VLC media player on my iPhone and macbook it works on both.
After few research i have found there is some problem with rtsp_transport
I was using av_dict_set(&serverOpt, "rtsp_transport", "tcp", 0); for the server configuration while opening url and the result is can not open feed.
When I changed it to av_dict_set(&serverOpt, "rtsp_transport", "udp", 1);
I am able to open url successfully but I continuously getting error rtsp 1 missing packet and so on.
Can anybody help what should be the right configuration while opening a local rtsp url using ffmpeg.
Should i need to update av_dict_set(&serverOpt, "rtsp_transport", "udp", 1)
Thanks in advance
Yes you can use UDP means av_dict_set(&serverOpt, "rtsp_transport", "udp", 0) in your code it will work.
You can also skip this step. I am playing local and remote both RTSP URL and setting nothing.
Direct open the URL using avformat_open_input without specify the rtsp_transport.

Video streaming on windows phone gives "3100 An error has occurred"

Initial data:
windows phone 7.1 application;
video streaming (video: MPEG‐4 AVC (part 10) (H.264); audio: MPEG AAC Audio (mp4a));
not a smooth streaming;
opened in VLC with any problems;
all capabilities are included (ID_CAP_MEDIALIB, ID_CAP_MICROPHONE, ID_CAP_NETWORKING and other).
I am using a MediaElement for opening video stream with custom http url:
media.Source = new Uri("streaming url");
media.DownloadProgressChanged += this.media_DownloadProgressChanged;
media.MediaFailed += this.media_MediaFailed;
media.MediaEnded += this.media_MediaEnded;
media.Play();
MediaFailed gives "3100 An error has occurred" error without any additional description.
Seems like listed codecs are supported.
Also I tried this code:
var mediaPlayerLauncher = new MediaPlayerLauncher
{
Location = MediaLocationType.Install,
Media = new Uri("streaming url", UriKind.Absolute),
Controls = MediaPlaybackControls.All,
};
mediaPlayerLauncher.Show();
but media player was not able to play video.
What can cause a problem? How to test whether video stream is compatible with Windows Phone?
Thanks in advance.

Resources