Introductory
Currently, the C3V Ubuntu rootfs has included the FFmpeg 4.4.4 prebuilt by default. It carries the commonly used elements and hardware media codec functions. If you don’t want to use it, you can disable the install in the file linux/rootfs/initramfs/build_disk.sh before running make config.
The prebuilt FFmpeg is located in the path linux/rootfs/initramfs/ubuntu/prebuilt-app-xxx. If your C3V system doesn’t have it or you feel that the provided does not meet your needs, you can recompile it as below.
...
Compile and install FFmpeg to the target version 4.4.4 with C3V Codec supported:
1 . Install the building package
Code Block |
---|
sudo apt update sudo apt install -y build-essential meson ninja-build python3-pip bison libglib2.0-dev flex git sudo apt install -y libmp3lame-dev libx264-dev libopus-dev libvpx-dev libssl-dev libfdk-aac-dev libv4l-dev sudo apt install -y nasm libsdl2-dev libxcb-xfixes0-dev libxcb-shm0-dev libsctp-dev libfdk-aac-dev liblz-dev liblzma-dev sudo pip3 install --upgrade meson |
2 . Build and install openh264 Openh264 :
Openh264 is a free software library for real-time encoding and decoding of video streams in the H.264/MPEG-4 AVC format. If you want to use it with ffmpegthe FFmpeg, you can do this step.
Get source code:
...
Code Block |
---|
cd openh264 meson build --prefix=/usr sudo ninja -C build/ install |
3 . Build ffmpeg FFmpeg and install it:
Gst source and extract it.
...
Patch files are below. Please download files and copy files to the root path of ffmpeg the FFmpeg code folder extracted in step 3.
...
View file | ||
---|---|---|
|
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 latest patch in the directory linux/rootfs/initramfs/buildroot/package/ffmpeg directly. |
Apply patch
Code Block |
---|
cd ~/code/ffmpeg-4.4.4 patch -p1 < 0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch patch -p1 < 0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch patch -p1 < 0003-libavutil-Fix-mips-build.patch patch -p1 < 0004-configure-add-extralibs-to-extralibs_xxx.patch patch -p1 < 0005-v4l2-hw-codec-support.patch patch -p1 < 0006-v4l2-enc-add-spspps-to-each-idr.patch |
5 . Configure, build, and install in prefix path “/home/sunplus/code/install-ffmpeg
"
...