2012-10-24 506 views
1

mp3中有一张图像,可能是某些专辑图像。当我使用ffmpeg将其转换为mp4时,它出错了。但是,如果我转换一个没有图像的MP3,它会成功。使用ffmpeg将图像转换为mp4时发生错误

我的命令是这样的:

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

请显示您的命令产生的完整ffmpeg控制台输出。它包含有用的信息;否则我们将不得不猜测。 – LordNeckbeard

+0

尝试删除视频编码(也许-vn或-frames:0会这样做?图像最有可能是300x300的大小,这不符合mpeg4规范IIRC。 –

+0

只是一个猜测,但足够聪明的程序应该能够“ffmpeg -i input.mp3 output.m4a”中的“guess”表示只有音频流是预期的,尽管该程序可以非常聪明地忽略扩展名,并试图分析输入文件中包含的所有流。 –

回答

2

使用-vn删除视频流。

ffmpeg -i input.mp3 -vn output.mp4 
相关问题