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

标签 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

最佳答案

使用-vn删除视频流。

ffmpeg -i input.mp3 -vn output.mp4

关于ffmpeg - 尝试使用 ffmpeg 将带图像的 mp3 转换为 mp4 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13043334/

相关文章:

url - 从 .f4m 流 url 获取 .mp4

c++ - OpenCV不会打开许多​​相同格式的视频的一些视频

video - ffmpeg 以特定间隔强制关键帧

iphone - 像 iPhone 一样从浏览器自动启动 Android 中的视频播放器

audio - 使用 FFMPEG 和静音检测来消除音频静音

ruby-on-rails-3 - 请求文件头信息

c++ - 带有 QT 内存泄漏的 FFMPEG

silverlight - 如何在零间隙的浏览器中循环播放 mp3?

c++ - 如何使用 QAudioOutput 和 QAudioDecoder 播放 mp3 文件?

audio - 什么是常见的声音频率->人类感知的信息密度图?