ffmpeg:无法将有效的mp4和mp3合并在一起

时间:2018-12-03 14:45:53

标签: ffmpeg

我尝试合并2个文件 1 mp4视频+ 1 mp3文件(都可以,并且可以在chrome或Firefox中播放)

mediainfo yarek.mp4
General
Complete name                            : yarek.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 86.7 KiB
Duration                                 : 5 s 263 ms

mediainfo yarek.mp3
General
Complete name                            : yarek.mp3
Format                                   : MPEG Audio
File size                                : 83.9 KiB
Overall bit rate mode                    : Variable
Writing library                          : Lavf57.56.101

我跑步:

ffmpeg -i yarek.mp4 -i yarek.mp3 output.mp4

给我那个错误:

buffer @ 0x55656c11b0e0] Unable to parse option value "-1" as pixel format
    Last message repeated 1 times
[buffer @ 0x55656c11b0e0] Error setting option pix_fmt to value -1.
[graph 0 input from stream 0:0 @ 0x55656c11aa40] Error applying options to the filter.

当我尝试从mp4中提取JPEG时出现相同的问题(mp4有效,可以在VLC或Chrome或Firefow中打开)

/var/www/html/record# ffmpeg -y -i "yarek.mp4" -ss "1" -vframes 1 -q:v 2 output.jpg
ffmpeg version 3.2.12-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55d221642ee0] Missing key frame while reordering index according to edit list
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55d221642ee0] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 640x480, 128 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'yarek.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.56.101
    comment         : {"t": "v", "c": "h264", "s": 1543853355450975, "u": 1543853355472477}
  Duration: 00:00:22.73, bitrate: 130 kb/s
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 640x480, 128 kb/s, 14.69 fps, 15 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      handler_name    : VideoHandler
[buffer @ 0x55d221663420] Unable to parse option value "-1" as pixel format
    Last message repeated 1 times
[buffer @ 0x55d221663420] Error setting option pix_fmt to value -1.
[graph 0 input from stream 0:0 @ 0x55d221642d60] Error applying options to the filter.
Error opening filters!

0 个答案:

没有答案