0

I am trying no matter what format of video my clients upload to convert them into three different formats:

 var videoExtensions = ['mp4', 'webm', 'ogg'];

    var ffmpeg = require('fluent-ffmpeg');
videoExtensions.forEach(function (extension) {
    var proc = new ffmpeg({source: media.file.path, nolog: false})
        .withVideoCodec('libx264')
        .withVideoBitrate(800)
        .withAudioCodec('libvo_aacenc')
        .withAudioBitrate('128k')
        .withAudioChannels(2)
        .toFormat(extension)
        .saveToFile(media.targetDir + media.getName() + '.' + extension,
        function (retcode, error) {
            console.log('file has been converted succesfully');
        });
});

On my local machine I am able to open and play the videos no problem

However as soon as I load them as resources into my browser it simply will not play.

If I however instead of converting just move the file I have no problem opening the file in my browser however then I will not be able to get the file in all three formats.

My question is am I doing something wrong in the above code or why is my browser "rejecting" the files so to speak?

shammelburg
  • 6,974
  • 7
  • 26
  • 34
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
  • There are too many factors here to provide an answer. What `ffmpeg` commands were used to create the videos? What does the complete `ffmpeg` console output show for each encoding command? How are you trying to get the browsers to play the videos? Can you provide samples of the videos that do not play? – llogan Jun 03 '15 at 16:16
  • Hmm there is no real console output – Marc Rasmussen Jun 03 '15 at 16:19

0 Answers0