ffmpeg的音频持续时间错误


17

我尝试使用以下最简单的命令使用ffmpeg将m4a文件转换为mp3:

ffmpeg -i in.m4a out.mp3

转换后,持续时间似乎很奇怪。原始的m4a是4:06。但是对于新的mp3,OS X Finder和Google Play报告09:24,而iTunes仍然报告正确的4:06。

我想我之前也曾遇到过这个问题。为什么是这样?可以解决吗?

以下是的控制台输出ffmpeg,以防万一。

$ffmpeg -i in.m4a out.mp3
ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 12 2013 13:46:11 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb7a4013000] stream 0, timescale not set
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fb7a4013000] max_analyze_duration 5000000 reached at 5015510 microseconds
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.m4a':
  Metadata:
    major_brand     : M4A 
    minor_version   : 0
    compatible_brands: M4A mp42isom
    creation_time   : 2013-06-14 07:36:47
    title           : 小手拉大手
    artist          : 梁静茹
    album_artist    : 梁静茹
    album           : 亲亲
    genre           : Pop
    track           : 7/12
    disc            : 1/1
    date            : 2006
    gapless_playback: 0
    encoder         : iTunes 11.0.4
  Duration: 00:04:06.75, start: 0.000000, bitrate: 804 kb/s
    Stream #0:0(und): Audio: alac (alac / 0x63616C61), 44100 Hz, stereo, s16, 800 kb/s
    Metadata:
      creation_time   : 2013-06-14 07:36:47
    Stream #0:1: Video: png, rgba, 230x230, 90k tbr, 90k tbn, 90k tbc
[mp3 @ 0x7fb7a4044200] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
Output #0, mp3, to 'out.mp3':
  Metadata:
    major_brand     : M4A 
    minor_version   : 0
    compatible_brands: M4A mp42isom
    gapless_playback: 0
    TIT2            : 小手拉大手
    TPE1            : 梁静茹
    TPE2            : 梁静茹
    TALB            : 亲亲
    TCON            : Pop
    TRCK            : 7/12
    TPOS            : 1/1
    TDRL            : 2006
    TSSE            : Lavf54.63.104
    Stream #0:0: Video: png, rgba, 230x230, q=2-31, 200 kb/s, 90k tbn, 90k tbc
    Stream #0:1(und): Audio: mp3, 44100 Hz, stereo, s16p
    Metadata:
      creation_time   : 2013-06-14 07:36:47
Stream mapping:
  Stream #0:1 -> #0:0 (png -> png)
  Stream #0:0 -> #0:1 (alac -> libmp3lame)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:26.54 bitrate=   0.1kbits/sframe=    1 fps=1.0 q=0.0 size=       0kB time=00:00:53.57 bitrate=   0.0kbits/sframe=    1 fps=0.7 q=0.0 size=       0kB time=00:01:19.93 bitrate=   0.0kbits/sframe=    1 fps=0.5 q=0.0 size=       0kB time=00:01:47.07 bitrate=   0.0kbits/sframe=    1 fps=0.4 q=0.0 size=       0kB time=00:02:13.90 bitrate=   0.0kbits/sframe=    1 fps=0.3 q=0.0 size=       0kB time=00:02:40.57 bitrate=   0.0kbits/sframe=    1 fps=0.3 q=0.0 size=       0kB time=00:03:06.01 bitrate=   0.0kbits/sframe=    1 fps=0.2 q=0.0 size=       0kB time=00:03:31.56 bitrate=   0.0kbits/sframe=    1 fps=0.2 q=0.0 size=       0kB time=00:03:57.66 bitrate=   0.0kbits/sframe=    1 fps=0.2 q=0.0 Lsize=    3974kB time=00:04:06.75 bitrate= 131.9kbits/s    
video:118kB audio:3856kB subtitle:0 global headers:0kB muxing overhead 0.012681%

1.2.1是可用的最新版本,但是您可以尝试使用最新的git快照吗?有ffmpeg的建立对于OS X可以从Tessus,所以无需重新编译。您可能还会看到“视频”流(专辑封面)是否与该问题有关:ffmpeg -i in.m4a -an out.mp3
llogan 2013年

@LordNeckbeard感谢您的帮助。不幸的是,我删除了图稿并使用了最新快照,但是输出仍然是9:24 :(
4ae1e1

好的,谢谢测试。您可以提供样本输入文件吗?我想尝试重现该问题。这可能是一个已知的错误,但是我尚未拖曳FFmpeg错误跟踪程序。另外,您可以指定OS X,Google Play和iTunes版本吗?
llogan 2013年

@LordNeckbeard谢谢。这是指向输入文件的Google云端硬盘链接。我正在将OS X 10.8.4与iTunes 11.0.4和Google Play网络(不是Android)配合使用。
2013年

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.