Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

110
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda