Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable voice for chrome when recording both audio/video #4

Closed
durimrexhaj opened this issue Jul 2, 2015 · 12 comments
Closed

Enable voice for chrome when recording both audio/video #4

durimrexhaj opened this issue Jul 2, 2015 · 12 comments
Labels

Comments

@durimrexhaj
Copy link

In chrome voice doesnt work. How can i fix it

@thijstriemstra
Copy link
Member

hi @durimrexhaj, can you please explain in detail why and what isn't working on what version/operating system?

@durimrexhaj
Copy link
Author

hiw @thijstriemstra I'm using windows and chrome Version 43.0.2357.130. Recorder doesn't get the voice. When i play video i can't here voice in chrome.

@thijstriemstra
Copy link
Member

@durimrexhaj I haven't tested it on windows chrome, so I'll give it a try and see what's going on.

@durimrexhaj
Copy link
Author

hi @thijstriemstra I have tested RecordRTC script and it worked well for me and i saw the videojs-record uses RecordRTC but I don't know why is not working with this plugin. Thanks a lot

@thijstriemstra
Copy link
Member

@durimrexhaj, what example did you use? Or what code are you using?

@pbojinov
Copy link

pbojinov commented Jul 9, 2015

I noticed the same issue on Chrome Version 43.0.2357.130 (64-bit) for OSX 10.10.3 using the examples/audio-video.html provided.

Here's the audo-video.html file hosted as is for testing purposes: http://pbojinov.github.io/videojs-record/examples/audio-video.html

The console.logs look normal

webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:92 started recording audio stream.
webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:1673 sample-rate 22050
webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:1674 buffer-size 4096
webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:92 started recording video stream.
webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:1963 canvas resolutions 320 * 240
webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:1964 video width/height 320 * 240
audio-video.html:46 started recording!
webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:149 Stopped recording audio stream.
webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:149 Stopped recording video stream.
webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:177 audio/wav -> 213 KB
audio-video.html:54 finished recording:  Blob
webrtcexperiment-webrtc.netdna-ssl.com/RecordRTC.js:177 video/webm -> 417 KB

@thijstriemstra
Copy link
Member

capture

I've also tested the examples and noticed the same on windows, linux and osx Chrome browsers. As noted in the README:

Note that recording both audio and video in a single WebM file is currently only supported in Mozilla Firefox >= 29. On other browsers the resulting file only contains video data.

This is a limitation of Chrome because it hasn't implemented MediaRecorder yet, and Firefox has. What RecordRTC.js does is record, stop stream, make audio data blob available, then make video data blob available. In Firefox it makes a single audio/video blob available after recording.

Now, I noticed that this line https://github.com/collab-project/videojs-record/blob/master/src/js/videojs.record.js#L441 causes only video-data to be made available, the audio blob is ignored. In a perfect world Chrome would stich the audio and video together in a webm blob, just like Firefox can.

So now, I guess it would be possible to trigger 2 'finishRecord' events, one for audio and one for video, but this would only be necessary in Chrome. And then there is also the issue of being able to playback of audio and video at the same time in Chrome. Any suggestions?

thijstriemstra added a commit that referenced this issue Jul 9, 2015
@thijstriemstra
Copy link
Member

I've commited a fix for Chrome that makes both audio and video blobs available when the finishRecord event fires.

capture

But during playback it will still only display the video stream and ignore the audio stream (because they're separate objects). I guess syncing the playback of the audio using WebAudio should be possible in that case.

@thijstriemstra thijstriemstra changed the title Enable voice for chrome Enable voice for chrome when recording both audio/video Jul 9, 2015
@thijstriemstra
Copy link
Member

I decided to add an extra audio element for chrome when recording audio and video that plays the recorded audio stream in sync with the video element.

Closing this ticket, please open a new one if there's still an issue.

@pbojinov
Copy link

pbojinov commented Jul 9, 2015

This is great, thank you 👍

@v3ss0n
Copy link

v3ss0n commented Sep 3, 2015

What is the format audio and videos are recorded with AUDIO_VIDEO flag? Is that Webm or WAV??

@thijstriemstra
Copy link
Member

Try it, document it and open a pull request please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants