gpt4 book ai didi

ffmpeg - 错误 : ffmpeg exited with code 1:

转载 作者:行者123 更新时间:2023-12-04 23:02:48 24 4
gpt4 key购买 nike

我正在使用 videoshow 节点包根据使用 ffmpeg 的图像创建简单的视频幻灯片。 ,具有附加功能,例如音频。我完全按照文档进行操作,但出现以下错误:

Error: ffmpeg exited with code 1:



这是代码:
    var videoshow = require('videoshow')
const ffmpeg = require('@ffmpeg-installer/ffmpeg');


var images = [
'image1.jpg',
'image1.jpg',
'image1.jpg'

]
var videoOptions = {
fps: 25,
loop: 5, // seconds
transition: true,
transitionDuration: 1, // seconds
videoBitrate: 1024,
videoCodec: 'libx264',
size: '640x640',
audioBitrate: '128k',
audioChannels: 2,
format: 'mp4',
pixelFormat: 'yuv420p'
}

var videoOptions = {
fps: 24,
transition: false,
videoBitrate: 1024 ,
videoCodec: 'libx264',
size: '640x640',
outputOptions: ['-pix_fmt yuv420p'],
format: 'mp4'
}
videoshow(images, videoOptions)
.audio('nd.mp3')
.save('/home/jibran/Desktop/video.avi')
.on('start', function (command) {
console.log('ffmpeg process started:', command)
})
.on('error', function (err, stdout, stderr) {
console.error('Error:', err)
console.error('ffmpeg stderr:', stderr)
console.error('ffmpeg stdeout:', stdout)
})
.on('end', function (output) {
console.error('Video created in:', output)
})

and on a console I get

ffmpeg process started: ffmpeg -i /tmp/videoshow-44a65b07-0949-4b1b-8a6e-bf8a71d5f5ca -i /tmp/videoshow-c7dd4222-385d-406e-8f10-c4160df3db17 -i /tmp/videoshow-2324c514-1738-4c6b-96dc-ab1cc3551d67 -y -filter_complex concat=n=3:v=1:a=0 /home/jibran/Desktop/video.avi

ffmpeg process started: ffmpeg -i /tmp/videoshow-0ff6909b-db19-4ba1-91ba-dc961127317f -i nd.mp3 -y -r 24 -b:v 1024k -vcodec libx264 -filter:v scale=w=640:h=640 -pix_fmt yuv420p -f mp4 -map 0:0 -map 1:0 -t 15 -af afade=t=in:ss=0:st=0:d=3 -af afade=t=out:st=12:d=3 /home/jibran/Desktop/video.avi
Error: Error: ffmpeg exited with code 1:
at ChildProcess.<anonymous> (/home/jibran/Desktop/hello-world/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
at ChildProcess.emit (events.js:127:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
ffmpeg stderr: undefined
ffmpeg stdeout: undefined

最佳答案

.format("h264") √
.format("mp4") ×
或添加
.outputOptions(['-movflags isml+frag_keyframe'])
.format("mp4")

关于ffmpeg - 错误 : ffmpeg exited with code 1:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49463843/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com