ffmpeg实现MP3转ACC格式功能

$  ./ffmpeg -i qishi.mp3 -acodec aac qishi.aac

ffmpeg version N-89882-g4dbae00bac Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib 
  --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray 
  --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb 
  --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine 
  --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame 
  --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
  --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp 
  --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa 
  --enable-libspeex --enable-libxvid --enable-libmfx --enable-amf --enable-cuda 
  --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
  libavutil      56.  7.100 / 56.  7.100
  libavcodec     58.  9.100 / 58.  9.100
  libavformat    58.  5.101 / 58.  5.101
  libavdevice    58.  0.101 / 58.  0.101
  libavfilter     7. 11.101 /  7. 11.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Input #0, mp3, from 'qishi.mp3':
  Metadata:
    encoder         : Lavf56.4.101
    comment         : 163 key(Don't modify):L64FU3W4YxX3ZFTmbZ+8/SDFZQkBgnwmScKSpeGsgRuli4v+JZT0s+7ueAzf8Cmg39D37dcKzpZl33QT0Y5DOWfIo16qo4sTBYuvo0u5HeNxEt8AKtPmvC8diEmz6k+95ud94UqkZnY4zFyVb4N96Rg136s014agaLb9aILz/o6MqifItpuAq6N+sKwO9EzVwohHwi0yBtOV2BXOZP3Dcstp8g8GHYVB9pV39TSKd
    album           : 意外
    title           : 其实
    artist          : 薛之谦
    disc            : 1
    track           : 8
  Duration: 00:04:02.18, start: 0.025056, bitrate: 323 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
    Stream #0:1: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 640x640 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Media (e.g. label side of CD)
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, adts, to 'qishi.aac':
  Metadata:
    track           : 8
    comment         : 163 key(Don't modify):L64FU3W4YxX3ZFTmbZ+8/SDFZQkBgnwmScKSpeGsgRuli4v+JZT0s+7ueAzf8Cmg39D37dcKzpZl33QT0Y5DOWfIo16qo4sTBYuvo0u5HeNxEt8AKtPmvC8diEmz6k+95ud94UqkZnY4zFyVb4N96Rg136s014agaLb9aILz/o6MqifItpuAq6N+sKwO9EzVwohHwi0yBtOV2BXOZP3Dcstp8g8GHYVB9pV39TSKd
    album           : 意外
    title           : 其实
    artist          : 薛之谦
    disc            : 1
    encoder         : Lavf58.5.101
    Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.9.100 aac
size=    3866kB time=00:04:02.16 bitrate= 130.8kbits/s speed=60.9x
video:0kB audio:3794kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.879048%
[aac @ 0000000000345540] Qavg: 683.404

可以看到从官网下的exe里面已经包含了音视频常用的编解码器,功能比较齐全,直接使用即可。

你可能感兴趣的:(ffmpeg开发)