ffmpeg -i input.m4a -acodec pcm_s16le -ac 2 -ar 44100 output.wav
128k 可修改为 64k 32k
ffmpeg -i output.wav -c:a libfdk_aac -b:a 128k result.m4a
设置码率,参考wiki:Encode/AAC
ffmpeg -i input.m4a -b:a 192K -vn testing.mp3
ffmpeg -i testing.mp3 -c:a libfdk_aac -vbr 5 test_from_mp3.m4a
ffmpeg -i input.wav -f mp3 -acodec libmp3lame -y output.mp3
ffmpeg -i 长录音-2.m4a -c:a flac 长录音-2.flac
ffmpeg -i 长录音-2.flac -acodec alac 长录音-2-ffmpeg.m4a
视频处理工具 FFmpeg 常用实例详解
ffmpeg/ffprobe查看音频视频文件信息并输出为json格式
ffprobe --help
ffprobe -show_format error.m4a > error.format.txt
ffprobe -show_format success.m4a > success.format.txt
ffprobe -show_data -show_packets error.m4a > error.packets.txt
ffprobe -show_data -show_packets success.m4a > success.packets.txt
Mac OS上使用ffmpeg的“血泪”总结 音视频封装格式、编码格式
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ffmpeg
可用的第三方仓库有: homebrew-ffmpeg和varenc-homebrew-ffmpeg
如下:选择第三方仓库
github-homebrew-ffmpeg
github-varenc/ffmpeg
# tap 安装
# brew tap homebrew-ffmpeg/ffmpeg
# tap 移除
# brew untap homebrew-ffmpeg/ffmpeg
#brew tap varenc/ffmpeg
#brew untap varenc/ffmpeg
特别注意:
Note: If you already have ffmpeg installed from Homebrew core, you will receive an error. You need to first run brew uninstall ffmpeg before you can use this tap.
#brew options homebrew-ffmpeg/ffmpeg/ffmpeg
brew options varenc/ffmpeg/ffmpeg
ybf326@B-J2L6LVDL-1753 TODO-Send % brew options varenc/ffmpeg/ffmpeg
--with-chromaprint
Enable the Chromaprint audio fingerprinting library
--with-decklink
Enable DeckLink support
--with-fdk-aac
Enable the Fraunhofer FDK AAC library
--with-game-music-emu
Build with game-music-emu support
--with-libbluray
Build with libbluray support
--with-libbs2b
Build with libbs2b support
--with-libcaca
Build with libcaca support
--with-libgsm
Build with libgsm support
--with-libmodplug
Build with libmodplug support
--with-librsvg
Enable SVG files as inputs via librsvg
--with-libsoxr
Enable the soxr resample library
--with-libssh
Enable SFTP protocol via libssh
--with-libvidstab
Enable vid.stab support for video stabilization
--with-libvmaf
Enable libvmaf scoring library
--with-libxml2
Enable libxml2 library
Enable Opencore AMR NR/WB audio format
--with-openh264
Enable OpenH264 library
--with-openjpeg
Enable JPEG 2000 image format
--with-openssl
Enable SSL support
--with-rtmpdump
Build with rtmpdump support
--with-rubberband
Enable rubberband library
--with-speex
Build with speex support
--with-srt
Enable SRT library
--with-tesseract
Enable the tesseract OCR engine
--with-two-lame
Build with two-lame support
--with-wavpack
Build with wavpack support
--with-webp
Enable using libwebp to encode WEBP images
--with-xvid
Build with xvid support
--with-zeromq
Enable using libzeromq to receive cmds sent through a libzeromq client
--with-zimg
Enable z.lib zimg library
--HEAD
Install HEAD version
安装命令
brew cask install xquartz
异常
==> Installing ffmpeg from homebrew-ffmpeg/ffmpeg
imlib2: XQuartz 2.7.11 (or newer) is required to install this formula. X11Requirement unsatisfied!
You can install with Homebrew Cask:
brew cask install xquartz
You can download from:
https://xquartz.macosforge.org
Error: An unsatisfied requirement failed this build.
#brew install varenc/ffmpeg/ffmpeg --with-chromaprint --with-decklink --with-fdk-aac --with-game-music-emu --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-librsvg --with-libsoxr --with-libssh --with-libvidstab --with-libvmaf --with-libxml2 --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rtmpdump --with-rubberband --with-speex --with-srt --with-tesseract --with-two-lame --with-wavpack --with-webp --with-xvid --with-zeromq --with-zimg
#brew install homebrew-ffmpeg/ffmpeg/ffmpeg --HEAD --with-chromaprint --with-decklink --with-fdk-aac --with-game-music-emu --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-librsvg --with-libsoxr --with-libssh --with-libvidstab --with-libvmaf --with-libxml2 --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl [email protected] --with-rtmpdump --with-rubberband --with-speex --with-srt --with-tesseract --with-two-lame --with-wavpack --with-webp --with-xvid --with-zeromq --with-zimg
# brew uninstall homebrew-ffmpeg/ffmpeg/ffmpeg
#重新安装
# brew reinstall homebrew-ffmpeg/ffmpeg/ffmpeg --with-webp --with-fdk-aac --with-openjpeg
brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-webp --with-fdk-aac --with-openjpeg
brew install ffmpeg --with-chromaprint --with-fdk-aac --with-fontconfig --with-freetype --with-frei0r --with-libass --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-rubberband --with-schroedinger --with-sdl2 --with-snappy --with-speex --with-tesseract --with-theora --with-tools --with-two-lame --with-wavpack --with-webp --with-x265 --with-xz --with-zeromq --with-zimg
链接:https://www.jianshu.com/p/85fffceddf04
brew install ffmpeg --with-fdk-aac --with-fontconfig --with-freetype --with-frei0r --with-libass --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-rubberband --with-schroedinger --with-sdl2 --with-snappy --with-speex --with-tesseract --with-theora --with-tools --with-two-lame --with-wavpack --with-webp --with-x265 --with-xz --with-zeromq --with-zimg
brew install ffmpeg --debug --with-chromaprint --with-fdk-aac --with-fontconfig --with-freetype --with-frei0r --with-game-music-emu --with-libass --with-libbluray --with-libbs2b --with-libcaca --with-libebur128 --with-libgsm --with-libmodplug --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-rubberband --with-schroedinger --with-sdl2 --with-snappy --with-speex --with-tesseract --with-theora --with-tools --with-two-lame --with-wavpack --with-webp --with-x265 --with-xz --with-zeromq --with-zimg