错误:ffmpeg退出代码1:

时间:2018-03-24 10:54:31

标签: ffmpeg

我正在使用videoshow节点包使用ffmpeg基于图像创建简单的视频幻灯片,以及音频等附加功能。我正在完全遵循文档,但是我收到以下错误:

  

错误:ffmpeg退出代码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

0 个答案:

没有答案
相关问题