尝试使用ffmpeg将带图像的mp3转换为mp4时出错

时间:2012-10-24 05:09:06

标签: ffmpeg mp3 mp4

mp3里面有一张图片,也许还有一些专辑图片。当我使用ffmpeg将其转换为mp4时,它会出错。但如果我转换没有图像的mp3,它就会成功。

我的命令是这样的:

ffmpeg -i input.mp3 output.mp4

这是错误:

Stream mapping:
  Stream #0:1 -> #0:0 (mjpeg -> mpeg4)
  Stream #0:0 -> #0:1 (mp3 -> aac)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

以下是所有控制台输出:

ellodeiMac:mine ello$ ffmpeg -frames 0 -i 4.mp3 -y test.mp4
ffmpeg version 0.11.2 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct 24 2012 12:21:13 with llvm_gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
  configuration: --disable-yasm
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
[mp3 @ 0x7fa12301ae00] max_analyze_duration 5000000 reached at 5015510
Input #0, mp3, from '4.mp3':
  Metadata:
    artist          : 贵族乐团
    album           : 美声天籁
    title           : 肖邦离别曲
    Tagging time    : 2012-09-18T08:12:10
  Duration: 00:04:01.44, start: 0.000000, bitrate: 129 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
    Stream #0:1: Video: mjpeg, yuvj420p, 240x240 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      title           : e
      comment         : Cover (front)
[buffer @ 0x109115780] w:240 h:240 pixfmt:yuvj420p tb:1/90000 sar:1/1 sws_param:flags=2
[buffersink @ 0x109133720] No opaque field provided
[format @ 0x1091338e0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'format'
[scale @ 0x109133bc0] w:240 h:240 fmt:yuvj420p sar:1/1 -> w:240 h:240 fmt:yuv420p sar:1/1 flags:0x4
[mp4 @ 0x7fa123035c00] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
[aformat @ 0x109136ec0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'
[aresample @ 0x1091370c0] chl:stereo fmt:s16 r:44100Hz -> chl:stereo fmt:flt r:44100Hz
[mpeg4 @ 0x7fa12303be00] timebase 1/90000 not supported by MPEG 4 standard, the maximum 
admitted value for the timebase denominator is 65535
Output #0, mp4, to 'test.mp4':
  Metadata:
    artist          : 贵族乐团
    album           : 美声天籁
    title           : 肖邦离别曲
    Tagging time    : 2012-09-18T08:12:10
    Stream #0:0: Video: mpeg4, yuv420p, 240x240 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 90k tbn, 90k tbc
    Metadata:
      title           : e
      comment         : Cover (front)
    Stream #0:1: Audio: none, 44100 Hz, stereo, flt, 128 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (mjpeg -> mpeg4)
  Stream #0:0 -> #0:1 (mp3 -> aac)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

1 个答案:

答案 0 :(得分:2)

使用-vn删除视频流。

ffmpeg -i input.mp3 -vn output.mp4