FFMPEG:处理输入时发现无效数据

时间:2019-04-03 09:26:04

标签: ffmpeg mp3 mp4 video-thumbnails

我无法上传mp3或mp4,是否有任何特定的路径格式?这是我的代码。我也尝试过ffmpeg -i Video/" + Name + " -ss 01:30 -r 1 -an -vframes 1 -f mjpeg Video/" + Name + ".jpg

exec("ffmpeg -y -i Video/" + Name + " -map_metadata -1 -ab 192k Video/" + Name + ".jpg", function(err) {
            if (err) {console.log(err)}
        console.log('Done', {'Image' : 'Video/' + Name + '.jpg'});
        });

这是错误

{ Error: Command failed: ffmpeg -y -i Video/ac9358e25dd41a69e95a72d3e71e4881 -map_metadata -1 -ab 192k Video/ac9358e25dd41a69e95a72d3e71e4881.jpg
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20190212
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Video/ac9358e25dd41a69e95a72d3e71e4881: Invalid data found when processing input

    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:557:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'ffmpeg -y -i Video/ac9358e25dd41a69e95a72d3e71e4881 -map_metadata -1 -ab 192k Video/ac9358e25dd41a69e95a72d3e71e4881.jpg' }

1 个答案:

答案 0 :(得分:0)

尝试添加确切的文件扩展名,如果文件是mp4,则添加“ .mp4”