Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
Dynamically control the chunk size for uploading live videos to S3 multipart using MediaRecorder API

frontend: vue

I have been using MediaRecorder API to record videos in the frontend and using S3 multipart to upload the videos to S3 chunk by chunk
minimum limit in S3 multipart upload is 5MB unless it is the last part
Here I want to dynamically create a chunk for 5MB, but chunks are created on a time basis

this.mediaRecorder = new MediaRecorder(this.stream,{
                         videoBitsPerSecond: 2500000,
                         mimeType: 'video/webm'
                     }
this.mediaRecorder.start(5000) # => 5000 ms

For every 5 seconds, the `ondataavailable` method is called and the chunk is stored to an array

this.mediaRecorder.ondataavailable = event => {
    this.blobs.push(event.data)
    console.log(event.data.size) # => returns size
}

I gave 5 seconds initially but for 5 seconds it only create a blob with a size of ~0.6MB, so I increased the time to 50 seconds, now each blob is larger than 5MB, but what if the low-resolution camera or high-resolution camera is used?

Is there any workaround to achieve without giving static time?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!