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

89
Visualizações
Saving videos directly to storage with ffmpeg

So I'm creating an app that will have video upload. In there I plan to create thumbnails from videos with fluent-ffmpeg library. My question is, is there a way I could do this without saving the files on the local machine and then deleting them, how can I directly upload the files to storage? I tried finding a buffer solution, but I'm not sure I understand it completely.

So far I created the transcoder for the videos, currently it will save videos to a directory called transcoded:

const transcodeVideo = async (fileName, filePath) => {
      return new Promise((resolve, reject) => {
        ffmpeg(filePath)
          .videoCodec('libx264')
          .audioCodec('libmp3lame')
          .format('mp4')
          .size('720x?')
          .on('error', function (err) {
            reject(err);
          })
          .on('end', function () {
            ffmpeg(filePath)
              .screenshots({
                timestamps: ['10%'], 
                folder: './transcoded',
                filename: `${fileName}.mp4.png`,
                size: '720x?',
              })
              .on('error', function (err) {
                reject(err);
              })
              .on('end', function () {
                resolve();
              });
          })
          .save(`./transcoded/${fileName}.mp4`);
      });
    };

The thing is I would like to store it separately in the storage, so that I can consume it on the frontend. Any ideas?

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