FFmpeg video conversion wont play in my browser
2021腾讯云限时秒杀,爆款1核2G云服务器298元/3年!(领取2860元代金券),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1062
2021阿里云最低价产品入口+领取代金券(老用户3折起),
入口地址:https://www.aliyun.com/minisite/goods
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?
video ffmpeg video-conversionedited Jun 3 '15 at 15:23 shammelburg 1,332 2 6 19 asked Jun 3 '15 at 14:58 Marc Rasmussen 3,959 30 87 167 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? –
LordNeckbeard Jun 3 '15 at 16:16 Hmm there is no real console output –
Marc Rasmussen Jun 3 '15 at 16:19
|
Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.
相关阅读排行
- 1FFmpeg源代码简单分析:avcodec_encode_video()
- 2ffmpeg 频中分离 video audio 截取片断
- 3AForge.Video.FFMPEG库使用注意事项
- 4FFMPeg代码分析:avcodec_decode_video2函数
- 5ffmpeg avcodec_encode_video2 前面10多帧不能实时编码