Compiling FFmpeg on Mac with Apple Silicon (requires MacPorts)

Install and Testing MacPorts on an M1 Mac: https://youtu.be/aZdx0tVrd0Q

Running FFmpeg on Mac with Apple Silicon (M1): https://youtu.be/wOZ7p7Zmz2s

FFmpeg Notes: https://www.rickmakes.com/ffmpeg-notes/

Update MacPorts
sudo port selfupdate
sudo port upgrade outdated
Install Libraries (using MacPorts)
sudo port -N install libass libfdk-aac lame libopus libtheora libogg libvorbis libbluray dav1d libmodplug libmodplug librsvg speex x265 XviD libsdl2 gnutls soxr openjpeg x264
Configure Command
./configure --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --disable-securetransport --mandir=/opt/local/share/man --enable-static --enable-pthreads --cc=/usr/bin/clang --enable-libdav1d --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfdk-aac --extra-ldflags=-L/opt/local/lib
Compile Code
make -j 12
Install Compiled Software
sudo make install
Sample FFmpeg Command with Software Encoding
time ffmpeg -i input_vid.MP4 -vf crop="in_w:in_w*9/16,scale=1920:1080" -vcodec libx264 -acodec copy -b:v 6200k -pix_fmt yuv420p out_sw.mov
Sample FFmpeg Command with Hardware Encoding
time ffmpeg -i input_vid.MP4 -vf crop="in_w:in_w*9/16,scale=1920:1080" -vcodec h264_videotoolbox -acodec copy -b:v 6200k -pix_fmt yuv420p out_hw.mov

Leave a comment

Your email address will not be published. Required fields are marked *