Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introductory

Currently, the C3V Ubuntu rootfs have included the FFmpeg 4.4.4 prebuilt for version 20.04/22.04 and FFmpeg 6.1.1 for version 24.04 by default. It carries the commonly used elements and hardware media codec functions. If you don’t want to use it, disable the install in the file <C3V_PRJ>/linux/rootfs/initramfs/build_disk.sh before running make config.

The prebuilt FFmpeg is located in the path <C3V_PRJ>/linux/rootfs/initramfs/ubuntu/prebuilt-app-xxx. If your C3V system doesn’t have it or you feel the provided does not meet your needs, you can recompile it as below.

...

View file
nameffmpeg-4.4.4-patch.7ztar.gz

Extract patch files: patch files will be extracted in ~/code/ffmpeg

Code Block
7ztar xzxvf ffmpeg-4.4.4-patch.7ztar.gz
Info

The patches in this document may not be up to date, if you are using the latest code of C3V, you can get the newest patch in the directory <C3V_PRJ>/linux/rootfs/initramfs/buildroot/package/ffmpeg directly.

Apply patch

Code Block
cd ~/code/ffmpeg-4.4.4
patch -p1 < ../ffmpeg/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch
patch -p1 < ../ffmpeg/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch
patch -p1 < ../ffmpeg/0003-libavutil-Fix-mips-build.patch
patch -p1 < ../ffmpeg/0004-configure-add-extralibs-to-extralibs_xxx.patch
patch -p1 < ../ffmpeg/0005-Fixes-assembling-with-binutils-as-2.41.patch
patch -p1 < ../ffmpeg/0006-v4l2-hw-codec-support.patch
patch -p1 < ../ffmpeg/0007-v4l2-enc-add-spspps-to-each-idr.patch
patch -p1 < ../ffmpeg/0008-use-v4l2-codec-default-if-find-by-id.patch
patch -p1 < ../ffmpeg/0009-adddma-optionscopy-toand-hwremap-codecoptions-to-use-dma-copyvideocodec.patch

5 . Configure, build, and install in prefix path “/home/sunplus/code/install-ffmpeg"

...

The steps for installing FFmpeg 6.1.1 are the same as for FFmpeg 4.4.4, here is the patch for FFmpeg 6.1.1.

View file
nameffmpeg-6.1.1-20250207-patch.7z

Note

If you are using Ubuntu version 24.04, it is recommended to use FFmpeg 6.1.1, otherwise when installing some packages such as OpenCV via apt install, it will download FFmpe 6.1.1 packages to replace the lower version already installed.