Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Cross-compiling FFmpeg for MIPS Architecture

Tech Apr 24 9

FFmpeg Cross-compilation Configuraton

Initial configuration for cross-compiling FFmpeg targeting MIPS architecture:

./configure \
--prefix=$(pwd)/output \
--enable-cross-compile --arch=mips --target-os=linux \
--cross-prefix=mips-linux-gnu- --cc=mips-linux-gnu-gcc-7.2.0 \
--disable-everything \
--disable-autodetect \
--enable-avdevice \
--enable-avfilter \
--disable-msa \
--disable-debug \
--disable-protocols --enable-protocol=file \
--disable-demuxers --enable-demuxer=mov \
--disable-muxers --enable-muxer=mp4 --enable-muxer=mov \
--disable-decoders --enable-decoder=pcm_alaw --enable-decoder=h264 --enable-decoder=mpeg4 \
--disable-encoders --enable-encoder=pcm_s16le \
--disable-bsfs --enable-bsf=h264_mp4toannexb \
--enable-static --enable-shared \
--disable-programs --enable-ffmpeg \
--extra-cflags=-muclibc --extra-cxxflags=-muclibc \
--enable-small

Resolving Compilation Issues

After encountering linking errors, the configuration was adjusted:

./configure \
--prefix=$(pwd)/output \
--enable-cross-compile --arch=mips --target-os=linux \
--cross-prefix=mips-linux-gnu- --cc=mips-linux-gnu-gcc \
--disable-mipsdsp --disable-mipsdspr2 --disable-mips32r2 --disable-mipsfpu --disable-mips64r2 --disable-mips32r6 \
--disable-everything \
--disable-autodetect \
--enable-avdevice \
--enable-avfilter \
--disable-msa \
--disable-debug \
--disable-protocols --enable-protocol=file \
--disable-demuxers --enable-demuxer=mov \
--disable-muxers --enable-muxer=mp4 --enable-muxer=mov \
--disable-decoders --enable-decoder=pcm_s16le --enable-decoder=pcm_alaw --enable-decoder=h264 --enable-decoder=mpeg4 \
--disable-encoders --enable-encoder=pcm_s16le \
--disable-bsfs --enable-bsf=h264_mp4toannexb \
--enable-static --disable-shared \
--disable-programs --enable-ffmpeg \
--extra-cflags=-muclibc --extra-cxxflags=-muclibc \
--enable-small

Minimal Build Configuraton

Further optimization led to a streamlined configuration excluding unnecessary components:

./configure \
--prefix=$(pwd)/output \
--enable-cross-compile --arch=mips --target-os=linux \
--cross-prefix=mips-linux-gnu- --cc=mips-linux-gnu-gcc \
--disable-mipsdsp --disable-mipsdspr2 --disable-mips32r2 --disable-mipsfpu --disable-mips64r2 --disable-mips32r6 \
--enable-avdevice \
--enable-avfilter \
--disable-msa \
--disable-debug \
--disable-protocols --enable-protocol=file \
--disable-decoders --enable-decoder=pcm_s16le \
--disable-encoders --enable-encoder=pcm_s16le \
--enable-static --disable-shared \
--disable-programs --enable-ffmpeg \
--disable-doc \
--extra-cflags=-muclibc --extra-cxxflags=-muclibc \
--enable-small

Missing Function Definitions

To resolve undefined function references, add the following macros to common.h:

#define fmin(x, y) ((x) > (y) ? (y) : ((x) == (x) ? (x) : (y)))
#define fmax(x, y) ((x) < (y) ? (y) : ((x) == (x) ? (x) : (y)))
#define fminf(x, y) fmin(x, y)
#define fmaxf(x, y) fmax(x, y)

Related Articles

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

SBUS Signal Analysis and Communication Implementation Using STM32 with Fus Remote Controller

Overview In a recent project, I utilized the SBUS protocol with the Fus remote controller to control a vehicle's basic operations, including movement, lights, and mode switching. This article is aimed...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.