【米尔MYD-YG2LX开发板】在多媒体应用场景的体验-ffmpeg环境搭建与性能测试
<div class='showpostmsg'><h1><b>前言</b></h1><p >瑞萨RZ/G2L是一款工业领域高性能、超高效的芯片,具备丰富多媒体功能,显示、摄像头、音频接口资源丰富,满足人机交互和图像采集需求,适用于工业HMI、医疗、工业自动化、电力、显控终端等场景。</p>
<p >本篇就以搭建ffmpeg开发环境以及性能的测试为例,体验该开发板在多媒体等领域的应用。</p>
<h1 ><b>准备</b></h1>
<p >以下基于WIN11+WSL2环境进行开发,需要安装必备的工具链比如aarch64-linux-gnu-等,这些不再赘述。</p>
<h1 ><b>下载代码</b></h1>
<div class="parsedown-markdown">
<p>git clone <a href="https://github.com/FFmpeg/FFmpeg.git"><u>https://github.com/FFmpeg/FFmpeg.git</u></a></p>
<p >cd FFmpeg/</p>
</div>
<h1 ><b>交叉编译</b></h1>
<div class="parsedown-markdown">./configure --cross-prefix=aarch64-linux-gnu- --enable-cross-compile --target-os=linux --cc=aarch64-linux-gnu-gcc --arch=arm64 --prefix=/home/lhj/opt/ffmpeg/board --enable-ffmpeg --disable-armv5te --disable-armv6 --disable-armv6t2</div>
<p >(注意要先创建/home/lhj/opt/ffmpeg/board文件夹)</p>
<p > </p>
<p >WARNING: aarch64-linux-gnu-pkg-config not found, library detection may fail.</p>
<div class="parsedown-markdown">
<p>make</p>
<p >make install</p>
</div>
<p > </p>
<p >文件如下</p>
<div class="parsedown-markdown">
<p>lhj@lhj:~/FFmpeg$ tree /home/lhj/opt/ffmpeg/board/</p>
<p >/home/lhj/opt/ffmpeg/board/</p>
<p >|-- bin</p>
<p >| |-- ffmpeg</p>
<p >| `-- ffprobe</p>
<p >|-- include</p>
<p >| |-- libavcodec</p>
<p >| | |-- ac3_parser.h</p>
<p >| | |-- adts_parser.h</p>
<p >| | |-- avcodec.h</p>
<p >| | |-- avdct.h</p>
<p >| | |-- avfft.h</p>
<p >| | |-- bsf.h</p>
<p >| | |-- codec.h</p>
<p >| | |-- codec_desc.h</p>
<p >| | |-- codec_id.h</p>
<p >| | |-- codec_par.h</p>
<p >| | |-- d3d11va.h</p>
<p >| | |-- defs.h</p>
<p >| | |-- dirac.h</p>
<p >| | |-- dv_profile.h</p>
<p >| | |-- dxva2.h</p>
<p >| | |-- jni.h</p>
<p >| | |-- mediacodec.h</p>
<p >| | |-- packet.h</p>
<p >| | |-- qsv.h</p>
<p >| | |-- vdpau.h</p>
<p >| | |-- version.h</p>
<p >| | |-- version_major.h</p>
<p >| | |-- videotoolbox.h</p>
<p >| | |-- vorbis_parser.h</p>
<p >| | `-- xvmc.h</p>
<p >| |-- libavdevice</p>
<p >| | |-- avdevice.h</p>
<p >| | |-- version.h</p>
<p >| | `-- version_major.h</p>
<p >| |-- libavfilter</p>
<p >| | |-- avfilter.h</p>
<p >| | |-- buffersink.h</p>
<p >| | |-- buffersrc.h</p>
<p >| | |-- version.h</p>
<p >| | `-- version_major.h</p>
<p >| |-- libavformat</p>
<p >| | |-- avformat.h</p>
<p >| | |-- avio.h</p>
<p >| | |-- version.h</p>
<p >| | `-- version_major.h</p>
<p >| |-- libavutil</p>
<p >| | |-- adler32.h</p>
<p >| | |-- aes.h</p>
<p >| | |-- aes_ctr.h</p>
<p >| | |-- ambient_viewing_environment.h</p>
<p >| | |-- attributes.h</p>
<p >| | |-- audio_fifo.h</p>
<p >| | |-- avassert.h</p>
<p >| | |-- avconfig.h</p>
<p >| | |-- avstring.h</p>
<p >| | |-- avutil.h</p>
<p >| | |-- base64.h</p>
<p >| | |-- blowfish.h</p>
<p >| | |-- bprint.h</p>
<p >| | |-- bswap.h</p>
<p >| | |-- buffer.h</p>
<p >| | |-- camellia.h</p>
<p >| | |-- cast5.h</p>
<p >| | |-- channel_layout.h</p>
<p >| | |-- common.h</p>
<p >| | |-- cpu.h</p>
<p >| | |-- crc.h</p>
<p >| | |-- csp.h</p>
<p >| | |-- des.h</p>
<p >| | |-- detection_bbox.h</p>
<p >| | |-- dict.h</p>
<p >| | |-- display.h</p>
<p >| | |-- dovi_meta.h</p>
<p >| | |-- downmix_info.h</p>
<p >| | |-- encryption_info.h</p>
<p >| | |-- error.h</p>
<p >| | |-- eval.h</p>
<p >| | |-- ffversion.h</p>
<p >| | |-- fifo.h</p>
<p >| | |-- file.h</p>
<p >| | |-- film_grain_params.h</p>
<p >| | |-- frame.h</p>
<p >| | |-- hash.h</p>
<p >| | |-- hdr_dynamic_metadata.h</p>
<p >| | |-- hdr_dynamic_vivid_metadata.h</p>
<p >| | |-- hmac.h</p>
<p >| | |-- hwcontext.h</p>
<p >| | |-- hwcontext_cuda.h</p>
<p >| | |-- hwcontext_d3d11va.h</p>
<p >| | |-- hwcontext_drm.h</p>
<p >| | |-- hwcontext_dxva2.h</p>
<p >| | |-- hwcontext_mediacodec.h</p>
<p >| | |-- hwcontext_opencl.h</p>
<p >| | |-- hwcontext_qsv.h</p>
<p >| | |-- hwcontext_vaapi.h</p>
<p >| | |-- hwcontext_vdpau.h</p>
<p >| | |-- hwcontext_videotoolbox.h</p>
<p >| | |-- hwcontext_vulkan.h</p>
<p >| | |-- imgutils.h</p>
<p >| | |-- intfloat.h</p>
<p >| | |-- intreadwrite.h</p>
<p >| | |-- lfg.h</p>
<p >| | |-- log.h</p>
<p >| | |-- lzo.h</p>
<p >| | |-- macros.h</p>
<p >| | |-- mastering_display_metadata.h</p>
<p >| | |-- mathematics.h</p>
<p >| | |-- md5.h</p>
<p >| | |-- mem.h</p>
<p >| | |-- motion_vector.h</p>
<p >| | |-- murmur3.h</p>
<p >| | |-- opt.h</p>
<p >| | |-- parseutils.h</p>
<p >| | |-- pixdesc.h</p>
<p >| | |-- pixelutils.h</p>
<p >| | |-- pixfmt.h</p>
<p >| | |-- random_seed.h</p>
<p >| | |-- rational.h</p>
<p >| | |-- rc4.h</p>
<p >| | |-- replaygain.h</p>
<p >| | |-- ripemd.h</p>
<p >| | |-- samplefmt.h</p>
<p >| | |-- sha.h</p>
<p >| | |-- sha512.h</p>
<p >| | |-- spherical.h</p>
<p >| | |-- stereo3d.h</p>
<p >| | |-- tea.h</p>
<p >| | |-- threadmessage.h</p>
<p >| | |-- time.h</p>
<p >| | |-- timecode.h</p>
<p >| | |-- timestamp.h</p>
<p >| | |-- tree.h</p>
<p >| | |-- twofish.h</p>
<p >| | |-- tx.h</p>
<p >| | |-- uuid.h</p>
<p >| | |-- version.h</p>
<p >| | |-- video_enc_params.h</p>
<p >| | `-- xtea.h</p>
<p >| |-- libswresample</p>
<p >| | |-- swresample.h</p>
<p >| | |-- version.h</p>
<p >| | `-- version_major.h</p>
<p >| `-- libswscale</p>
<p >| |-- swscale.h</p>
<p >| |-- version.h</p>
<p >| `-- version_major.h</p>
<p >|-- lib</p>
<p >| |-- libavcodec.a</p>
<p >| |-- libavdevice.a</p>
<p >| |-- libavfilter.a</p>
<p >| |-- libavformat.a</p>
<p >| |-- libavutil.a</p>
<p >| |-- libswresample.a</p>
<p >| |-- libswscale.a</p>
<p >| `-- pkgconfig</p>
<p >| |-- libavcodec.pc</p>
<p >| |-- libavdevice.pc</p>
<p >| |-- libavfilter.pc</p>
<p >| |-- libavformat.pc</p>
<p >| |-- libavutil.pc</p>
<p >| |-- libswresample.pc</p>
<p >| `-- libswscale.pc</p>
<p >`-- share</p>
<p > |-- doc</p>
<p > | `-- ffmpeg</p>
<p > | |-- bootstrap.min.css</p>
<p > | |-- community.html</p>
<p > | |-- default.css</p>
<p > | |-- developer.html</p>
<p > | |-- faq.html</p>
<p > | |-- fate.html</p>
<p > | |-- ffmpeg-all.html</p>
<p > | |-- ffmpeg-bitstream-filters.html</p>
<p > | |-- ffmpeg-codecs.html</p>
<p > | |-- ffmpeg-devices.html</p>
<p > | |-- ffmpeg-filters.html</p>
<p > | |-- ffmpeg-formats.html</p>
<p > | |-- ffmpeg-protocols.html</p>
<p > | |-- ffmpeg-resampler.html</p>
<p > | |-- ffmpeg-scaler.html</p>
<p > | |-- ffmpeg-utils.html</p>
<p > | |-- ffmpeg.html</p>
<p > | |-- ffprobe-all.html</p>
<p > | |-- ffprobe.html</p>
<p > | |-- general.html</p>
<p > | |-- git-howto.html</p>
<p > | |-- libavcodec.html</p>
<p > | |-- libavdevice.html</p>
<p > | |-- libavfilter.html</p>
<p > | |-- libavformat.html</p>
<p > | |-- libavutil.html</p>
<p > | |-- libswresample.html</p>
<p > | |-- libswscale.html</p>
<p > | |-- mailing-list-faq.html</p>
<p > | |-- nut.html</p>
<p > | |-- platform.html</p>
<p > | `-- style.min.css</p>
<p > |-- ffmpeg</p>
<p > | |-- examples</p>
<p > | | |-- Makefile</p>
<p > | | |-- README</p>
<p > | | |-- avio_http_serve_files.c</p>
<p > | | |-- avio_list_dir.c</p>
<p > | | |-- avio_read_callback.c</p>
<p > | | |-- decode_audio.c</p>
<p > | | |-- decode_filter_audio.c</p>
<p > | | |-- decode_filter_video.c</p>
<p > | | |-- decode_video.c</p>
<p > | | |-- demux_decode.c</p>
<p > | | |-- encode_audio.c</p>
<p > | | |-- encode_video.c</p>
<p > | | |-- extract_mvs.c</p>
<p > | | |-- filter_audio.c</p>
<p > | | |-- hw_decode.c</p>
<p > | | |-- mux.c</p>
<p > | | |-- qsv_decode.c</p>
<p > | | |-- qsv_transcode.c</p>
<p > | | |-- remux.c</p>
<p > | | |-- resample_audio.c</p>
<p > | | |-- scale_video.c</p>
<p > | | |-- show_metadata.c</p>
<p > | | |-- transcode.c</p>
<p > | | |-- transcode_aac.c</p>
<p > | | |-- vaapi_encode.c</p>
<p > | | `-- vaapi_transcode.c</p>
<p > | |-- ffprobe.xsd</p>
<p > | |-- libvpx-1080p.ffpreset</p>
<p > | |-- libvpx-1080p50_60.ffpreset</p>
<p > | |-- libvpx-360p.ffpreset</p>
<p > | |-- libvpx-720p.ffpreset</p>
<p > | `-- libvpx-720p50_60.ffpreset</p>
<p > `-- man</p>
<p > |-- man1</p>
<p > | |-- ffmpeg-all.1</p>
<p > | |-- ffmpeg-bitstream-filters.1</p>
<p > | |-- ffmpeg-codecs.1</p>
<p > | |-- ffmpeg-devices.1</p>
<p > | |-- ffmpeg-filters.1</p>
<p > | |-- ffmpeg-formats.1</p>
<p > | |-- ffmpeg-protocols.1</p>
<p > | |-- ffmpeg-resampler.1</p>
<p > | |-- ffmpeg-scaler.1</p>
<p > | |-- ffmpeg-utils.1</p>
<p > | |-- ffmpeg.1</p>
<p > | |-- ffprobe-all.1</p>
<p > | `-- ffprobe.1</p>
<p > `-- man3</p>
<p > |-- libavcodec.3</p>
<p > |-- libavdevice.3</p>
<p > |-- libavfilter.3</p>
<p > |-- libavformat.3</p>
<p > |-- libavutil.3</p>
<p > |-- libswresample.3</p>
<p > `-- libswscale.3</p>
<p > </p>
<p >19 directories, 235 files</p>
<p >lhj@lhj:~/FFmpeg$</p>
</div>
<p > </p>
<h1 ><b>PC编译</b></h1>
<div class="parsedown-markdown">
<p>make clean</p>
<p >./configure --disable-x86asm --prefix=/home/lhj/opt/ffmpeg/win --enable-shared</p>
<p >make -j8 && make install</p>
</div>
<p > </p>
<p >文件如下</p>
<div class="parsedown-markdown">
<p>lhj@lhj:~/FFmpeg$ tree /home/lhj/opt/ffmpeg/win/</p>
<p >/home/lhj/opt/ffmpeg/win/</p>
<p >|-- bin</p>
<p >| |-- ffmpeg</p>
<p >| |-- ffplay</p>
<p >| `-- ffprobe</p>
<p >|-- include</p>
<p >| |-- libavcodec</p>
<p >| | |-- ac3_parser.h</p>
<p >| | |-- adts_parser.h</p>
<p >| | |-- avcodec.h</p>
<p >| | |-- avdct.h</p>
<p >| | |-- avfft.h</p>
<p >| | |-- bsf.h</p>
<p >| | |-- codec.h</p>
<p >| | |-- codec_desc.h</p>
<p >| | |-- codec_id.h</p>
<p >| | |-- codec_par.h</p>
<p >| | |-- d3d11va.h</p>
<p >| | |-- defs.h</p>
<p >| | |-- dirac.h</p>
<p >| | |-- dv_profile.h</p>
<p >| | |-- dxva2.h</p>
<p >| | |-- jni.h</p>
<p >| | |-- mediacodec.h</p>
<p >| | |-- packet.h</p>
<p >| | |-- qsv.h</p>
<p >| | |-- vdpau.h</p>
<p >| | |-- version.h</p>
<p >| | |-- version_major.h</p>
<p >| | |-- videotoolbox.h</p>
<p >| | |-- vorbis_parser.h</p>
<p >| | `-- xvmc.h</p>
<p >| |-- libavdevice</p>
<p >| | |-- avdevice.h</p>
<p >| | |-- version.h</p>
<p >| | `-- version_major.h</p>
<p >| |-- libavfilter</p>
<p >| | |-- avfilter.h</p>
<p >| | |-- buffersink.h</p>
<p >| | |-- buffersrc.h</p>
<p >| | |-- version.h</p>
<p >| | `-- version_major.h</p>
<p >| |-- libavformat</p>
<p >| | |-- avformat.h</p>
<p >| | |-- avio.h</p>
<p >| | |-- version.h</p>
<p >| | `-- version_major.h</p>
<p >| |-- libavutil</p>
<p >| | |-- adler32.h</p>
<p >| | |-- aes.h</p>
<p >| | |-- aes_ctr.h</p>
<p >| | |-- ambient_viewing_environment.h</p>
<p >| | |-- attributes.h</p>
<p >| | |-- audio_fifo.h</p>
<p >| | |-- avassert.h</p>
<p >| | |-- avconfig.h</p>
<p >| | |-- avstring.h</p>
<p >| | |-- avutil.h</p>
<p >| | |-- base64.h</p>
<p >| | |-- blowfish.h</p>
<p >| | |-- bprint.h</p>
<p >| | |-- bswap.h</p>
<p >| | |-- buffer.h</p>
<p >| | |-- camellia.h</p>
<p >| | |-- cast5.h</p>
<p >| | |-- channel_layout.h</p>
<p >| | |-- common.h</p>
<p >| | |-- cpu.h</p>
<p >| | |-- crc.h</p>
<p >| | |-- csp.h</p>
<p >| | |-- des.h</p>
<p >| | |-- detection_bbox.h</p>
<p >| | |-- dict.h</p>
<p >| | |-- display.h</p>
<p >| | |-- dovi_meta.h</p>
<p >| | |-- downmix_info.h</p>
<p >| | |-- encryption_info.h</p>
<p >| | |-- error.h</p>
<p >| | |-- eval.h</p>
<p >| | |-- ffversion.h</p>
<p >| | |-- fifo.h</p>
<p >| | |-- file.h</p>
<p >| | |-- film_grain_params.h</p>
<p >| | |-- frame.h</p>
<p >| | |-- hash.h</p>
<p >| | |-- hdr_dynamic_metadata.h</p>
<p >| | |-- hdr_dynamic_vivid_metadata.h</p>
<p >| | |-- hmac.h</p>
<p >| | |-- hwcontext.h</p>
<p >| | |-- hwcontext_cuda.h</p>
<p >| | |-- hwcontext_d3d11va.h</p>
<p >| | |-- hwcontext_drm.h</p>
<p >| | |-- hwcontext_dxva2.h</p>
<p >| | |-- hwcontext_mediacodec.h</p>
<p >| | |-- hwcontext_opencl.h</p>
<p >| | |-- hwcontext_qsv.h</p>
<p >| | |-- hwcontext_vaapi.h</p>
<p >| | |-- hwcontext_vdpau.h</p>
<p >| | |-- hwcontext_videotoolbox.h</p>
<p >| | |-- hwcontext_vulkan.h</p>
<p >| | |-- imgutils.h</p>
<p >| | |-- intfloat.h</p>
<p >| | |-- intreadwrite.h</p>
<p >| | |-- lfg.h</p>
<p >| | |-- log.h</p>
<p >| | |-- lzo.h</p>
<p >| | |-- macros.h</p>
<p >| | |-- mastering_display_metadata.h</p>
<p >| | |-- mathematics.h</p>
<p >| | |-- md5.h</p>
<p >| | |-- mem.h</p>
<p >| | |-- motion_vector.h</p>
<p >| | |-- murmur3.h</p>
<p >| | |-- opt.h</p>
<p >| | |-- parseutils.h</p>
<p >| | |-- pixdesc.h</p>
<p >| | |-- pixelutils.h</p>
<p >| | |-- pixfmt.h</p>
<p >| | |-- random_seed.h</p>
<p >| | |-- rational.h</p>
<p >| | |-- rc4.h</p>
<p >| | |-- replaygain.h</p>
<p >| | |-- ripemd.h</p>
<p >| | |-- samplefmt.h</p>
<p >| | |-- sha.h</p>
<p >| | |-- sha512.h</p>
<p >| | |-- spherical.h</p>
<p >| | |-- stereo3d.h</p>
<p >| | |-- tea.h</p>
<p >| | |-- threadmessage.h</p>
<p >| | |-- time.h</p>
<p >| | |-- timecode.h</p>
<p >| | |-- timestamp.h</p>
<p >| | |-- tree.h</p>
<p >| | |-- twofish.h</p>
<p >| | |-- tx.h</p>
<p >| | |-- uuid.h</p>
<p >| | |-- version.h</p>
<p >| | |-- video_enc_params.h</p>
<p >| | `-- xtea.h</p>
<p >| |-- libswresample</p>
<p >| | |-- swresample.h</p>
<p >| | |-- version.h</p>
<p >| | `-- version_major.h</p>
<p >| `-- libswscale</p>
<p >| |-- swscale.h</p>
<p >| |-- version.h</p>
<p >| `-- version_major.h</p>
<p >|-- lib</p>
<p >| |-- libavcodec.a</p>
<p >| |-- libavcodec.so -> libavcodec.so.60.6.100</p>
<p >| |-- libavcodec.so.60 -> libavcodec.so.60.6.100</p>
<p >| |-- libavcodec.so.60.6.100</p>
<p >| |-- libavdevice.a</p>
<p >| |-- libavdevice.so -> libavdevice.so.60.2.100</p>
<p >| |-- libavdevice.so.60 -> libavdevice.so.60.2.100</p>
<p >| |-- libavdevice.so.60.2.100</p>
<p >| |-- libavfilter.a</p>
<p >| |-- libavfilter.so -> libavfilter.so.9.4.100</p>
<p >| |-- libavfilter.so.9 -> libavfilter.so.9.4.100</p>
<p >| |-- libavfilter.so.9.4.100</p>
<p >| |-- libavformat.a</p>
<p >| |-- libavformat.so -> libavformat.so.60.4.100</p>
<p >| |-- libavformat.so.60 -> libavformat.so.60.4.100</p>
<p >| |-- libavformat.so.60.4.100</p>
<p >| |-- libavutil.a</p>
<p >| |-- libavutil.so -> libavutil.so.58.3.100</p>
<p >| |-- libavutil.so.58 -> libavutil.so.58.3.100</p>
<p >| |-- libavutil.so.58.3.100</p>
<p >| |-- libswresample.a</p>
<p >| |-- libswresample.so -> libswresample.so.4.11.100</p>
<p >| |-- libswresample.so.4 -> libswresample.so.4.11.100</p>
<p >| |-- libswresample.so.4.11.100</p>
<p >| |-- libswscale.a</p>
<p >| |-- libswscale.so -> libswscale.so.7.2.100</p>
<p >| |-- libswscale.so.7 -> libswscale.so.7.2.100</p>
<p >| |-- libswscale.so.7.2.100</p>
<p >| `-- pkgconfig</p>
<p >| |-- libavcodec.pc</p>
<p >| |-- libavdevice.pc</p>
<p >| |-- libavfilter.pc</p>
<p >| |-- libavformat.pc</p>
<p >| |-- libavutil.pc</p>
<p >| |-- libswresample.pc</p>
<p >| `-- libswscale.pc</p>
<p >`-- share</p>
<p > |-- doc</p>
<p > | `-- ffmpeg</p>
<p > | |-- bootstrap.min.css</p>
<p > | |-- community.html</p>
<p > | |-- default.css</p>
<p > | |-- developer.html</p>
<p > | |-- faq.html</p>
<p > | |-- fate.html</p>
<p > | |-- ffmpeg-all.html</p>
<p > | |-- ffmpeg-bitstream-filters.html</p>
<p > | |-- ffmpeg-codecs.html</p>
<p > | |-- ffmpeg-devices.html</p>
<p > | |-- ffmpeg-filters.html</p>
<p > | |-- ffmpeg-formats.html</p>
<p > | |-- ffmpeg-protocols.html</p>
<p > | |-- ffmpeg-resampler.html</p>
<p > | |-- ffmpeg-scaler.html</p>
<p > | |-- ffmpeg-utils.html</p>
<p > | |-- ffmpeg.html</p>
<p > | |-- ffplay-all.html</p>
<p > | |-- ffplay.html</p>
<p > | |-- ffprobe-all.html</p>
<p > | |-- ffprobe.html</p>
<p > | |-- general.html</p>
<p > | |-- git-howto.html</p>
<p > | |-- libavcodec.html</p>
<p > | |-- libavdevice.html</p>
<p > | |-- libavfilter.html</p>
<p > | |-- libavformat.html</p>
<p > | |-- libavutil.html</p>
<p > | |-- libswresample.html</p>
<p > | |-- libswscale.html</p>
<p > | |-- mailing-list-faq.html</p>
<p > | |-- nut.html</p>
<p > | |-- platform.html</p>
<p > | `-- style.min.css</p>
<p > |-- ffmpeg</p>
<p > | |-- examples</p>
<p > | | |-- Makefile</p>
<p > | | |-- README</p>
<p > | | |-- avio_http_serve_files.c</p>
<p > | | |-- avio_list_dir.c</p>
<p > | | |-- avio_read_callback.c</p>
<p > | | |-- decode_audio.c</p>
<p > | | |-- decode_filter_audio.c</p>
<p > | | |-- decode_filter_video.c</p>
<p > | | |-- decode_video.c</p>
<p > | | |-- demux_decode.c</p>
<p > | | |-- encode_audio.c</p>
<p > | | |-- encode_video.c</p>
<p > | | |-- extract_mvs.c</p>
<p > | | |-- filter_audio.c</p>
<p > | | |-- hw_decode.c</p>
<p > | | |-- mux.c</p>
<p > | | |-- qsv_decode.c</p>
<p > | | |-- qsv_transcode.c</p>
<p > | | |-- remux.c</p>
<p > | | |-- resample_audio.c</p>
<p > | | |-- scale_video.c</p>
<p > | | |-- show_metadata.c</p>
<p > | | |-- transcode.c</p>
<p > | | |-- transcode_aac.c</p>
<p > | | |-- vaapi_encode.c</p>
<p > | | `-- vaapi_transcode.c</p>
<p > | |-- ffprobe.xsd</p>
<p > | |-- libvpx-1080p.ffpreset</p>
<p > | |-- libvpx-1080p50_60.ffpreset</p>
<p > | |-- libvpx-360p.ffpreset</p>
<p > | |-- libvpx-720p.ffpreset</p>
<p > | `-- libvpx-720p50_60.ffpreset</p>
<p > `-- man</p>
<p > |-- man1</p>
<p > | |-- ffmpeg-all.1</p>
<p > | |-- ffmpeg-bitstream-filters.1</p>
<p > | |-- ffmpeg-codecs.1</p>
<p > | |-- ffmpeg-devices.1</p>
<p > | |-- ffmpeg-filters.1</p>
<p > | |-- ffmpeg-formats.1</p>
<p > | |-- ffmpeg-protocols.1</p>
<p > | |-- ffmpeg-resampler.1</p>
<p > | |-- ffmpeg-scaler.1</p>
<p > | |-- ffmpeg-utils.1</p>
<p > | |-- ffmpeg.1</p>
<p > | |-- ffplay-all.1</p>
<p > | |-- ffplay.1</p>
<p > | |-- ffprobe-all.1</p>
<p > | `-- ffprobe.1</p>
<p > `-- man3</p>
<p > |-- libavcodec.3</p>
<p > |-- libavdevice.3</p>
<p > |-- libavfilter.3</p>
<p > |-- libavformat.3</p>
<p > |-- libavutil.3</p>
<p > |-- libswresample.3</p>
<p > `-- libswscale.3</p>
<p > </p>
<p >19 directories, 261 files</p>
<p >lhj@lhj:~/FFmpeg$</p>
</div>
<p > </p>
<h1 ><b>开发板上部署</b></h1>
<p >将生成的bin文件复制到windows下</p>
<div class="parsedown-markdown">cp /home/lhj/opt/ffmpeg/board/bin/* /mnt/d</div>
<p > </p>
<p >将生成的lib文件复制到windows下</p>
<div class="parsedown-markdown">cp /home/lhj/opt/ffmpeg/board/lib/* /mnt/d</div>
<p > </p>
<p >再将上述lib文件*.a,通过ssh登录使用rz导入到开发板的/usr/lib目录下</p>
<p > </p>
<p >将ffmpeg和ffprobe通过ssh登录使用rz导入到开发板~目录下</p>
<p > </p>
<p > </p>
<p > </p>
<h1 ><b>测试</b></h1>
<p > </p>
<div class="parsedown-markdown">
<p>chmod +x ffmpeg ffprobe</p>
<p >root@myir-yg2lx:~# chmod +x ffmpeg ffprobe</p>
<p >root@myir-yg2lx:~# ./ffmpeg</p>
<p >ffmpeg version N-109968-gcc76e8340d Copyright (c) 2000-2023 the FFmpeg developers</p>
<p > built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)</p>
<p > configuration: --cross-prefix=aarch64-linux-gnu- --enable-cross-compile --target-os=linux --cc=aarch64-linux-gnu-gcc --arch=arm64 --prefix=/home/lhj/opt/ffmpeg/board --enable-ffmpeg --disable-armv5te --disable-armv6 --disable-armv6t2</p>
<p > libavutil 58. 3.100 / 58. 3.100</p>
<p > libavcodec 60. 6.100 / 60. 6.100</p>
<p > libavformat 60. 4.100 / 60. 4.100</p>
<p > libavdevice 60. 2.100 / 60. 2.100</p>
<p > libavfilter 9. 4.100 / 9. 4.100</p>
<p > libswscale 7. 2.100 / 7. 2.100</p>
<p > libswresample 4. 11.100 / 4. 11.100</p>
<p >Hyper fast Audio and Video encoder</p>
<p >usage: ffmpeg [ -i infile]... { outfile}...</p>
<p > </p>
<p >Use -h to get full help or, even better, run 'man ffmpeg'</p>
<p >root@myir-yg2lx:~# ./ffprobe</p>
<p >ffprobe version N-109968-gcc76e8340d Copyright (c) 2007-2023 the FFmpeg developers</p>
<p > built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)</p>
<p > configuration: --cross-prefix=aarch64-linux-gnu- --enable-cross-compile --target-os=linux --cc=aarch64-linux-gnu-gcc --arch=arm64 --prefix=/home/lhj/opt/ffmpeg/board --enable-ffmpeg --disable-armv5te --disable-armv6 --disable-armv6t2</p>
<p > libavutil 58. 3.100 / 58. 3.100</p>
<p > libavcodec 60. 6.100 / 60. 6.100</p>
<p > libavformat 60. 4.100 / 60. 4.100</p>
<p > libavdevice 60. 2.100 / 60. 2.100</p>
<p > libavfilter 9. 4.100 / 9. 4.100</p>
<p > libswscale 7. 2.100 / 7. 2.100</p>
<p > libswresample 4. 11.100 / 4. 11.100</p>
<p >Simple multimedia streams analyzer</p>
<p >usage: ffprobe INPUT_FILE</p>
<p > </p>
<p >You have to specify one input file.</p>
<p >Use -h to get full help or, even better, run 'man ffprobe'.</p>
<p >root@myir-yg2lx:~#</p>
</div>
<p > </p>
<p > </p>
<h2 ><b>性能测试</b></h2>
<p ><a href="https://www.sample-videos.com/index.php#sample-mp4-video下下测试mp4视频"><u>https://www.sample-videos.com/index.php#sample-mp4-video下下测试mp4视频</u></a></p>
<p >这里下载的是big_buck_bunny_720p_10mb.mp4。</p>
<p > </p>
<h3 ><b>开发板上</b></h3>
<p >cd ~</p>
<p >导入视频big_buck_bunny_720p_10mb.mp4到开发板。</p>
<p > </p>
<div class="parsedown-markdown">
<p>root@myir-yg2lx:~# ffmpeg -benchmark -i big_buck_bunny_720p_10mb.mp4 -f null -</p>
<p >ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers</p>
<p > built with gcc 8.3.0 (GCC)</p>
<p > configuration: --disable-stripping --enable-pic --enable-shared --enable-pthreads --cross-prefix=aarch64-poky-linux- --ld='aarch64-poky-linux-gcc -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --cc='aarch64-poky-linux-gcc -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --cxx='aarch64-poky-linux-g++ -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --arch=aarch64 --target-os=linux --enable-cross-compile --extra-cflags=' -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map==/usr/src/debug/ffmpeg/4.2.2-r0 -fdebug-prefix-map==/usr/src/debug/ffmpeg/4.2.2-r0 -fdebug-prefix-map=/recipe-sysroot= -fdebug-prefix-map=/recipe-sysroot-native= -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --extra-ldflags='-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now' --sysroot=/recipe-sysroot --libdir=/usr/lib64 --shlibdir=/usr/lib64 --datadir=/usr/share/ffmpeg --disable-mipsdsp --disable-mipsdspr2 --cpu=generic --pkg-config=pkg-config --disable-static --enable-alsa --enable-avcodec --enable-avdevice --enable-avfilter --enable-avformat --enable-avresample --enable-bzlib --disable-libfdk-aac --enable-gpl --disable-libgsm --disable-indev=jack --disable-libvorbis --enable-lzma --disable-libmfx --disable-libmp3lame --disable-openssl --enable-postproc --disable-sdl2 --disable-libspeex --enable-swresample --enable-swscale --enable-libtheora --disable-vaapi --disable-vdpau --disable-libvpx --enable-libx264 --disable-libx265 --disable-libxcb --disable-outdev=xv --enable-zlib</p>
<p > libavutil 56. 31.100 / 56. 31.100</p>
<p > libavcodec 58. 54.100 / 58. 54.100</p>
<p > libavformat 58. 29.100 / 58. 29.100</p>
<p > libavdevice 58. 8.100 / 58. 8.100</p>
<p > libavfilter 7. 57.100 / 7. 57.100</p>
<p > libavresample 4. 0. 0 / 4. 0. 0</p>
<p > libswscale 5. 5.100 / 5. 5.100</p>
<p > libswresample 3. 5.100 / 3. 5.100</p>
<p > libpostproc 55. 5.100 / 55. 5.100</p>
<p >Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'big_buck_bunny_720p_10mb.mp4':</p>
<p > Metadata:</p>
<p > major_brand : isom</p>
<p > minor_version : 512</p>
<p > compatible_brands: isomiso2avc1mp41</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > encoder : Lavf53.24.2</p>
<p > Duration: 00:01:02.32, start: 0.000000, bitrate: 1347 kb/s</p>
<p > Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 , 959 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)</p>
<p > Metadata:</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > handler_name : VideoHandler</p>
<p > Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)</p>
<p > Metadata:</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > handler_name : SoundHandler</p>
<p >Stream mapping:</p>
<p > Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))</p>
<p > Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))</p>
<p >Press to stop, [?] for help</p>
<p >Output #0, null, to 'pipe:':</p>
<p > Metadata:</p>
<p > major_brand : isom</p>
<p > minor_version : 512</p>
<p > compatible_brands: isomiso2avc1mp41</p>
<p > encoder : Lavf58.29.100</p>
<p > Stream #0:0(und): Video: wrapped_avframe, yuv420p, 1280x720 , q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)</p>
<p > Metadata:</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > handler_name : VideoHandler</p>
<p > encoder : Lavc58.54.100 wrapped_avframe</p>
<p > Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, 5.1, s16, 4608 kb/s (default)</p>
<p > Metadata:</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > handler_name : SoundHandler</p>
<p > encoder : Lavc58.54.100 pcm_s16le</p>
<p >frame= 1557 fps= 41 q=-0.0 Lsize=N/A time=00:01:02.31 bitrate=N/A speed=1.65x </p>
<p >video:815kB audio:35052kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown</p>
<p >bench: utime=32.622s stime=2.285s rtime=37.798s</p>
<p >bench: maxrss=28804kB</p>
</div>
<p > </p>
<h3 ><b>PC机上</b><b> </b></h3>
<div class="parsedown-markdown">
<p>lhj@lhj:~$ ffmpeg -benchmark -i big_buck_bunny_720p_10mb.mp4 -f null -</p>
<p >ffmpeg version N-109734-g806ecace91 Copyright (c) 2000-2023 the FFmpeg developers</p>
<p > built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)</p>
<p > configuration: --disable-x86asm</p>
<p > libavutil 57. 44.100 / 57. 44.100</p>
<p > libavcodec 59. 60.100 / 59. 60.100</p>
<p > libavformat 59. 37.100 / 59. 37.100</p>
<p > libavdevice 59. 8.101 / 59. 8.101</p>
<p > libavfilter 8. 56.100 / 8. 56.100</p>
<p > libswscale 6. 8.112 / 6. 8.112</p>
<p > libswresample 4. 9.100 / 4. 9.100</p>
<p >Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'big_buck_bunny_720p_10mb.mp4':</p>
<p > Metadata:</p>
<p > major_brand : isom</p>
<p > minor_version : 512</p>
<p > compatible_brands: isomiso2avc1mp41</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > encoder : Lavf53.24.2</p>
<p > Duration: 00:01:02.31, start: 0.000000, bitrate: 1347 kb/s</p>
<p > Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 , 959 kb/s, 25 fps, 25 tbr, 12800 tbn (default)</p>
<p > Metadata:</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > handler_name : VideoHandler</p>
<p > vendor_id : </p>
<p > Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)</p>
<p > Metadata:</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > handler_name : SoundHandler</p>
<p > vendor_id : </p>
<p >Stream mapping:</p>
<p > Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))</p>
<p > Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))</p>
<p >Press to stop, [?] for help</p>
<p >Output #0, null, to 'pipe:':</p>
<p > Metadata:</p>
<p > major_brand : isom</p>
<p > minor_version : 512</p>
<p > compatible_brands: isomiso2avc1mp41</p>
<p > encoder : Lavf59.37.100</p>
<p > Stream #0:0(und): Video: wrapped_avframe, yuv420p(progressive), 1280x720 , q=2-31, 200 kb/s, 25 fps, 25 tbn (default)</p>
<p > Metadata:</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > handler_name : VideoHandler</p>
<p > vendor_id : </p>
<p > encoder : Lavc59.60.100 wrapped_avframe</p>
<p > Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, 5.1, s16, 4608 kb/s (default)</p>
<p > Metadata:</p>
<p > creation_time : 1970-01-01T00:00:00.000000Z</p>
<p > handler_name : SoundHandler</p>
<p > vendor_id : </p>
<p > encoder : Lavc59.60.100 pcm_s16le</p>
<p >frame= 1557 fps=0.0 q=-0.0 Lsize=N/A time=00:01:02.29 bitrate=N/A speed=67.5x</p>
<p >video:730kB audio:35052kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown</p>
<p >bench: utime=5.981s stime=0.833s rtime=0.929s</p>
<p >bench: maxrss=94204kB</p>
<p >lhj@lhj:~$</p>
</div>
<p > </p>
<h3 ><b>测试结果对比</b></h3>
<p >可以看到开发板720p,40帧处理没问题。</p>
<p >和PC相比差距10多倍,这相对于桌面级的DDR,SSD和CPU的综合环境来说,开发板的性能已经非常不错了。</p>
<table style="border-collapse:collapse; border:none;Times New Roman"">
<tbody>
<tr>
<td style="border-bottom:1px solid black; border-top:1px solid black; border-right:1px solid black; border-left:1px solid black" valign="top">
<p > </p>
</td>
<td style="border-bottom:1px solid black; border-top:1px solid black; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >开发板</p>
</td>
<td style="border-bottom:1px solid black; border-top:1px solid black; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >PC</p>
</td>
<td style="border-bottom:1px solid black; border-top:1px solid black; border-right:1px solid black; border-left:1px solid black" valign="top">
<p > </p>
</td>
</tr>
<tr>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >CPU</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >1/2xCortex-A55@1.2GHz</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >th Gen Intel(R) Core(TM) i5-12500H 2.50 GHz</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p > </p>
</td>
</tr>
<tr>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >maxrss</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >28804kB</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >94204kB</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p > </p>
</td>
</tr>
<tr>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >utime</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >32.622s</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >5.981s</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p > </p>
</td>
</tr>
<tr>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >Stime</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >2.285s</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >0.833s</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p > </p>
</td>
</tr>
<tr>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >Rtime</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >37.798s</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p >0.929s</p>
</td>
<td style="border-bottom:1px solid black; border-top:none; border-right:1px solid black; border-left:1px solid black" valign="top">
<p > </p>
</td>
</tr>
</tbody>
</table>
<p > </p>
<p > </p>
<h1 ><b>总结</b></h1>
<p >本文进行了ffmpeg开发环境的搭建,并在开发板上测试了ffmpeg的性能。综上可以看出开发板的多媒体性能也是不错的,页非常适合多媒体终端的应用场景。</p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <p>感觉ffmpeg开发环境的搭建还是稍微有点麻烦</p>
页:
[1]