question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Output blob size is 0 on Chrome when recording audio

See original GitHub issue

Description

When I try to record video + audio on Chrome the output blob for video has no data and there is no audio blob at all. It outputs a 2 MB blob if recording video-only, but when I set audio: true in the videojs options object, the output video blob is 0 MB. There is also no audio blob in the output.

Your audio-video demo also seems to have the same issue: screen shot 2017-03-02 at 4 23 20 pm

Steps to reproduce

This is my setup:

const player = videojs('video-player', {
  // video.js options
  controls: true,
  loop: false,
  width: $('#video-container').width() || 320,
  height: $('#video-container').height() || 240,
  plugins: {
    // videojs-record plugin options
    record: {
      maxLength: 5,
      debug: true,
      audio: true,  /* only works when this is false */
      video: {
        // video constraints: set resolution of camera
        mandatory: {
          minWidth: 1280,
          minHeight: 720,
        },
      },
      // dimensions of captured video frames
      frameWidth: 1280,
      frameHeight: 720
    }
  }
});

// error handling
player.on('deviceError', function() {
  console.log('device error:', player.deviceErrorCode);
});

player.on('error', function(error) {
  console.log('error:', error);
});

// user clicked the record button and started recording
player.on('startRecord', function() {
  console.log('started recording!');
});

// user completed recording and stream is available
player.on('finishRecord', function() {
  // the blob object contains the recorded data that
  // can be downloaded by the user, stored on server etc.
  debugger
  console.log('finished recording: ', player.recordedData);
});

Results

Expected

I’m expecting to see an object with a video and audio blob of an appropriate size for a 5s video/audio recording.

Actual

The video blob has a size of 0 and there is no audio blob.

Error output

VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported.

Additional Information

Please include any additional information necessary here. Including the following:

versions

videojs

videojs 5.16.0

browsers

Chrome 56

OSes

MacOS 10.12.3

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
maxpajcommented, Aug 22, 2017

@thijstriemstra kind of have to agree with you here… We’ve seen this bug appear very sporadically. If we could figure out a way of reproducing then it would be a different story.

In any case, I think this bug probably stems from RecordRTC. So for anyone interested in getting this fixed, I’d refer to the RecordRTC issues instead. https://github.com/muaz-khan/RecordRTC

1reaction
maxpajcommented, Aug 2, 2017

I can add that I’ve seen this as well in our live environment. But since I don’t know how to reproduce it I just don’t know where to begin…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why I am getting blob length 0 in MediaStream Recording API ...
Everything is working in desktop version but in mobile chrome browser the length of the blob is 0.
Read more >
Record audio and video with MediaRecorder
The MediaRecorder API enables you to record audio and video from a web app. ... that specifies the length of media to capture...
Read more >
WebRTC too large data size - Google Groups
Which means 1.4MB per 5 seconds. This is too much in size to upload on HTTP server. How we can reduce the size...
Read more >
Recording Audio from the User - web.dev
The easiest thing to do is simply ask the user for a pre-recorded file. Do this by creating a simple file input element...
Read more >
Blob - The Modern JavaScript Tutorial
That encoding represents binary data as a string of ultra-safe “readable” characters with ASCII-codes from 0 to 64. And what's more important – ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found