Issue metadata
Sign in to add a comment
|
MediaRecorder produces sound with gaps when recording video with hogged main thread
Reported by
w0rs...@gmail.com,
Dec 20 2017
|
||||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Steps to reproduce the problem: 1. Open the page, allow mic and cam access. 2. Click record, make some sound and click Compute to hog the main thread. 3. Click stop. The resulting video plays back with no sound gaps. 4. Click download and play that file in something other than Chrome - Vlc, Firefox etc. The sound distorts/stops when main thread was hogged. What is the expected behavior? The sound plays back normally in any player. What went wrong? I when recording videos with MediaRecorder whenever I had some heavy js running during recording I got distorted audio in the resulting file. I also ran the resulting audio through opusinfo utility and got warnings like these: WARNING: Sample count ahead of granule (146880>146832) in stream 1 WARNING: Sample count ahead of granule (195840>195792) in stream 1 WARNING: Sample count behind granule (204480<268848) in stream 1 WARNING: Sample count ahead of granule (319680>319632) in stream 1 WARNING: Sample count ahead of granule (417600>417552) in stream 1 WARNING: Sample count ahead of granule (466560>466512) in stream 1 If I run the same test in Firefox (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:58.0) Gecko/20100101 Firefox/58.0) I have no problems with sound. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 63.0.3239.84 Channel: stable OS Version: OS X 10.13.2 Flash Version:
,
Dec 20 2017
,
Dec 29 2017
Unable to reproduce the issue on reported chrome version 63.0.3239.84 and latest canary 65.0.3306.0 using Mac 10.13.1 with steps mentioned below Steps followed to reproduce the issue: 1) Launched chrome reported version 2) Downloaded the attachment provided in comment#0 3) Ran the file and allowed camera and mic access 4) Clicked on record then compute and then stop, then played the video, video played normally 5) Downloaded the video (downloaded video is in webem format,as firefox didn't allowed webem format to play, so converted it to MP4 and played it in firefox) and played it 6) video played normally @Reporter: Please find the attached videos for your reference and let us know if we have missed anything in reproducing the issue, try to test the issue by creating new person with no extensions and apps in it and le us know if the issue still persists. 1) Video.webem is the direct downloaded file and 2) webem to mp4.mp4 is the converted file Thanks!
,
Dec 29 2017
,
Jan 7 2018
We're experiencing the same issue. Audio will play back seemingly fine (in Chrome), but the audio moves out of sync over time (due to dropped frames). To know whether the file is actually okay, run the opusinfo utility on it. Could it possibly help to increment the timeslice supplied in MediaRecorder#start?
,
Feb 7 2018
Hmm we should be managing (in particular the compression of) audio and video on background threads, so they should not be influenced by a hogging of the Render main thread (unless this overloads the whole CPU). Could you please make a simplified codepen.io or some such and add it to the bug?
,
Feb 8 2018
There is already a simplified case in html page attached. Here it is on codepen https://codepen.io/anon/pen/bLByWr The important thing I think I have to state one more time, is that I get sound gaps when I try to play or decode the resulting file in something other than Chrome.
,
Feb 8 2018
Thank you for providing more feedback. Adding requester "sc00335628@techmahindra.com" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Feb 8 2018
#7 ah, hmm, so chrome plays back the file fine (no gaps) but other browsers and external players play it with gaps. dalecurtis@, flim@, any ideas what could be going on?
,
Feb 8 2018
Not sure why you'd get audio gaps, the audio should eventually arrive IIRC how you're doing this (post-task audio as it arrives). If the processor is hogged enough that audio or video are underflowing though the media pipeline will drop video/audio frames before MR ever sees them.
,
Feb 9 2018
Would that be of any help if I send an example video file with sound issues?
,
Feb 15 2018
Thanks for the codepen example. We took a look and saw that audio frames aren't being dropped, instead multiple frames were generated consecutively with the same timestamp. The total length of these additional frames correspond to the audio gap heard in other browsers/players. The issue might be that when the capture/muxer becomes unblocked after "Compute", it releases a bunch of buffered audio frames with the same timestamp. It also looks like Chrome playback isn't taking the timing of these frames into consideration.
,
Feb 15 2018
The NextAction date has arrived: 2018-02-15
,
Feb 15 2018
The standard playback path doesn't use timestamps for audio packets, its clock is driven purely by the number of samples.
,
Apr 26 2018
Ping for triaging.
,
May 23 2018
Retried the issue on Mac OS 10.13.3 on the latest Stable 66.0.3359.181 and Canary 68.0.3438.0 and unable to reproduce the issue by following the below steps. 1. Launched Chrome and navigated to the given codepen https://codepen.io/anon/pen/bLByWr in comment #7. 2. Recorded a video, downloaded it and played it on Firefox. 3. Can observe that the file is playing without any issues and no distortions are observed. w0rse.t@ request you to update chrome to the latest Stable 66.0.3359.181, retry the issue and update the thread with the observations, which will help in further triaging. Thanks..
,
May 23 2018
I'm still able to reproduce the bug with a codepen case on Mac OS 10.13.4 in latest Chrome stable 66.0.3359.181 One deviation from your steps is, I'm unable to playback the downloaded file in Firefox - it gives me "No video with supported format and MIME type found" error. Instead I use VLC to play the file. There's no sound in places where I pressed Compute button during video recording. Have you pressed Compute button during video recording? As before, the same codepen produces video file with no sound gaps when run in Firefox.
,
May 23 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
May 24 2018
Able to reproduce the issue on Mac 10.13.3 and Win-10 using chrome latest stable #66.0.3359.181 and latest canary #68.0.3438.0. Note: Unable to test the issue on ubuntu 17.10 as on computing the recorded video did not produce any sound. This is a non-regression issue as it is observed from M60 old builds. Hence, marking it as untriaged to get more inputs from dev team. Thanks...!!
,
May 25 2018
,
Jan 8
Issue 761840 has been merged into this issue.
,
Jan 8
,
Jan 9
w0rse.t@gmail.com, let's continue the conversation in Issue 873963 |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by mlamouri@chromium.org
, Dec 20 2017