Events
Trade Shows
Seminars
Product Updates
 
          Home > News Center > Product Updates
 

Network Video Playback Terminal based on ffmpeg - Demonstration on MYD-JX8MMA7 ARM+FPGA Board

 
2023-7-11   18:19:6     Click: 838
 

This evaluation report is provided by developer "qinyunti" from ElecFans. The evaluation platform used is MYD-JX8MMA7 Development Board from MYIR.



1. Overview

This MYD-JX8MMA7 development board has high-performance ARM MPU with powerful multimedia capabilities, making it particularly suitable for multimedia terminal development. This article focuses on building an ffmpeg development environment and conducting performance testing, video playback, and demonstrating network video players.

MYD-JX8MMA7 Development Board

2. Compile process

Cross compilation

Download Code

git clone https://github.com/FFmpeg/FFmpeg.git

cd FFmpeg/


Cross compilation

./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

WARNING: aarch64-linux-gnu-pkg-config not found, library detection may fail.

make

make install


The generated file is as follows:

lhj@lhj:~/FFmpeg$ tree /home/lhj/opt/ffmpeg/board/
/home/lhj/opt/ffmpeg/board/
|-- bin
|   |-- ffmpeg
|   `-- ffprobe
|-- include
|   |-- libavcodec
|   |   |-- ac3_parser.h
|   |   |-- adts_parser.h
|   |   |-- avcodec.h
|   |   |-- avdct.h
|   |   |-- avfft.h
|   |   |-- bsf.h
|   |   |-- codec.h
|   |   |-- codec_desc.h
|   |   |-- codec_id.h
|   |   |-- codec_par.h
|   |   |-- d3d11va.h
|   |   |-- defs.h
|   |   |-- dirac.h
|   |   |-- dv_profile.h
|   |   |-- dxva2.h
|   |   |-- jni.h
|   |   |-- mediacodec.h
|   |   |-- packet.h
|   |   |-- qsv.h
|   |   |-- vdpau.h
|   |   |-- version.h
|   |   |-- version_major.h
|   |   |-- videotoolbox.h
|   |   |-- vorbis_parser.h
|   |   `-- xvmc.h
|   |-- libavdevice
|   |   |-- avdevice.h
|   |   |-- version.h
|   |   `-- version_major.h
|   |-- libavfilter
|   |   |-- avfilter.h
|   |   |-- buffersink.h
|   |   |-- buffersrc.h
|   |   |-- version.h
|   |   `-- version_major.h
|   |-- libavformat
|   |   |-- avformat.h
|   |   |-- avio.h
|   |   |-- version.h
|   |   `-- version_major.h
|   |-- libavutil
|   |   |-- adler32.h
|   |   |-- aes.h
|   |   |-- aes_ctr.h
|   |   |-- ambient_viewing_environment.h
|   |   |-- attributes.h
|   |   |-- audio_fifo.h
|   |   |-- avassert.h
|   |   |-- avconfig.h
|   |   |-- avstring.h
|   |   |-- avutil.h
|   |   |-- base64.h
|   |   |-- blowfish.h
|   |   |-- bprint.h
|   |   |-- bswap.h
|   |   |-- buffer.h
|   |   |-- camellia.h
|   |   |-- cast5.h
|   |   |-- channel_layout.h
|   |   |-- common.h
|   |   |-- cpu.h
|   |   |-- crc.h
|   |   |-- csp.h
|   |   |-- des.h
|   |   |-- detection_bbox.h
|   |   |-- dict.h
|   |   |-- display.h
|   |   |-- dovi_meta.h
|   |   |-- downmix_info.h
|   |   |-- encryption_info.h
|   |   |-- error.h
|   |   |-- eval.h
|   |   |-- ffversion.h
|   |   |-- fifo.h
|   |   |-- file.h
|   |   |-- film_grain_params.h
|   |   |-- frame.h
|   |   |-- hash.h
|   |   |-- hdr_dynamic_metadata.h
|   |   |-- hdr_dynamic_vivid_metadata.h
|   |   |-- hmac.h
|   |   |-- hwcontext.h
|   |   |-- hwcontext_cuda.h
|   |   |-- hwcontext_d3d11va.h
|   |   |-- hwcontext_drm.h
|   |   |-- hwcontext_dxva2.h
|   |   |-- hwcontext_mediacodec.h
|   |   |-- hwcontext_opencl.h
|   |   |-- hwcontext_qsv.h
|   |   |-- hwcontext_vaapi.h
|   |   |-- hwcontext_vdpau.h
|   |   |-- hwcontext_videotoolbox.h
|   |   |-- hwcontext_vulkan.h
|   |   |-- imgutils.h
|   |   |-- intfloat.h
|   |   |-- intreadwrite.h
|   |   |-- lfg.h
|   |   |-- log.h
|   |   |-- lzo.h
|   |   |-- macros.h
|   |   |-- mastering_display_metadata.h
|   |   |-- mathematics.h
|   |   |-- md5.h
|   |   |-- mem.h
|   |   |-- motion_vector.h
|   |   |-- murmur3.h
|   |   |-- opt.h
|   |   |-- parseutils.h
|   |   |-- pixdesc.h
|   |   |-- pixelutils.h
|   |   |-- pixfmt.h
|   |   |-- random_seed.h
|   |   |-- rational.h
|   |   |-- rc4.h
|   |   |-- replaygain.h
|   |   |-- ripemd.h
|   |   |-- samplefmt.h
|   |   |-- sha.h
|   |   |-- sha512.h
|   |   |-- spherical.h
|   |   |-- stereo3d.h
|   |   |-- tea.h
|   |   |-- threadmessage.h
|   |   |-- time.h
|   |   |-- timecode.h
|   |   |-- timestamp.h
|   |   |-- tree.h
|   |   |-- twofish.h
|   |   |-- tx.h
|   |   |-- uuid.h
|   |   |-- version.h
|   |   |-- video_enc_params.h
|   |   `-- xtea.h
|   |-- libswresample
|   |   |-- swresample.h
|   |   |-- version.h
|   |   `-- version_major.h
|   `-- libswscale
|       |-- swscale.h
|       |-- version.h
|       `-- version_major.h
|-- lib
|   |-- libavcodec.a
|   |-- libavdevice.a
|   |-- libavfilter.a
|   |-- libavformat.a
|   |-- libavutil.a
|   |-- libswresample.a
|   |-- libswscale.a
|   `-- pkgconfig
|       |-- libavcodec.pc
|       |-- libavdevice.pc
|       |-- libavfilter.pc
|       |-- libavformat.pc
|       |-- libavutil.pc
|       |-- libswresample.pc
|       `-- libswscale.pc
`-- share
|-- doc
|   `-- ffmpeg
|       |-- bootstrap.min.css
|       |-- default.css
|       |-- developer.html
|       |-- faq.html
|       |-- fate.html
|       |-- ffmpeg-all.html
|       |-- ffmpeg-bitstream-filters.html
|       |-- ffmpeg-codecs.html
|       |-- ffmpeg-devices.html
|       |-- ffmpeg-filters.html
|       |-- ffmpeg-formats.html
|       |-- ffmpeg-protocols.html
|       |-- ffmpeg-resampler.html
|       |-- ffmpeg-scaler.html
|       |-- ffmpeg-utils.html
|       |-- ffmpeg.html
|       |-- ffprobe-all.html
|       |-- ffprobe.html
|       |-- general.html
|       |-- git-howto.html
|       |-- libavcodec.html
|       |-- libavdevice.html
|       |-- libavfilter.html
|       |-- libavformat.html
|       |-- libavutil.html
|       |-- libswresample.html
|       |-- libswscale.html
|       |-- mailing-list-faq.html
|       |-- nut.html
|       |-- platform.html
|       `-- style.min.css
|-- ffmpeg
|   |-- examples
|   |   |-- Makefile
|   |   |-- README
|   |   |-- avio_list_dir.c
|   |   |-- avio_reading.c
|   |   |-- decode_audio.c
|   |   |-- decode_video.c
|   |   |-- demuxing_decoding.c
|   |   |-- encode_audio.c
|   |   |-- encode_video.c
|   |   |-- extract_mvs.c
|   |   |-- filter_audio.c
|   |   |-- filtering_audio.c
|   |   |-- filtering_video.c
|   |   |-- http_multiclient.c
|   |   |-- hw_decode.c
|   |   |-- metadata.c
|   |   |-- muxing.c
|   |   |-- qsv_transcode.c
|   |   |-- qsvdec.c
|   |   |-- remuxing.c
|   |   |-- resampling_audio.c
|   |   |-- scaling_video.c
|   |   |-- transcode_aac.c
|   |   |-- transcoding.c
|   |   |-- vaapi_encode.c
|   |   `-- vaapi_transcode.c
|   |-- ffprobe.xsd
|   |-- libvpx-1080p.ffpreset
|   |-- libvpx-1080p50_60.ffpreset
|   |-- libvpx-360p.ffpreset
|   |-- libvpx-720p.ffpreset
|   `-- libvpx-720p50_60.ffpreset
`-- man
|-- man1
|   |-- ffmpeg-all.1
|   |-- ffmpeg-bitstream-filters.1
|   |-- ffmpeg-codecs.1
|   |-- ffmpeg-devices.1
|   |-- ffmpeg-filters.1
|   |-- ffmpeg-formats.1
|   |-- ffmpeg-protocols.1
|   |-- ffmpeg-resampler.1
|   |-- ffmpeg-scaler.1
|   |-- ffmpeg-utils.1
|   |-- ffmpeg.1
|   |-- ffprobe-all.1
|   `-- ffprobe.1
`-- man3
|-- libavcodec.3
|-- libavdevice.3
|-- libavfilter.3
|-- libavformat.3
|-- libavutil.3
|-- libswresample.3
`-- libswscale.3

19 directories, 234 files
lhj@lhj:~/FFmpeg$


Deployment on the development board

Copy the bin file to Windows

cp/home/lhj/opt/ffmpeg/board/bin/*/mnt/d

Copy the lib file to Windows

cp/home/lhj/opt/ffmpeg/board/lib/*/mnt/d

Then import the above lib file *. a into the/usr/lib directory of the development board

Import ffmpeg and ffprobe into the~directory


Test

chmod +x ffmpeg ffprobe

root@myd-jx8mma7:~# ./ffmpeg
ffmpeg version N-109734-g806ecace91 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
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
libavutil 57. 44.100 / 57. 44.100
libavcodec 59. 60.100 / 59. 60.100
libavformat 59. 37.100 / 59. 37.100
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 56.100 / 8. 56.100
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'
root@myd-jx8mma7:~#


root@myd-jx8mma7:~# ./ffprobe
ffprobe version N-109734-g806ecace91 Copyright (c) 2007-2023 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
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
libavutil 57. 44.100 / 57. 44.100
libavcodec 59. 60.100 / 59. 60.100
libavformat 59. 37.100 / 59. 37.100
libavdevice 59.  8.101 / 59.  8.101
libavfilter 8. 56.100 /  8. 56.100
libswscale 6.  8.112 /  6.  8.112
libswresample 4.  9.100 /  4.  9.100
Simple multimedia streams analyzer
usage: ffprobe [OPTIONS] INPUT_FILE

You have to specify one input file.
Use -h to get full help or, even better, run 'man ffprobe'.
root@myd-jx8mma7:~#


Performance testing

https://www.sample-videos.com/index.php#sample-mp4-videodownload the test video and rename it as test.mp4 to import to the development board.

./ffmpeg -benchmark -i test.mp4 -f null -

Print as follows:


root@myd-jx8mma7:~# ffmpeg -benchmark -i test.mp4 -f null -
-sh: ffmpeg: command not found
root@myd-jx8mma7:~# ./ffmpeg -benchmark -i test.mp4 -f null -
ffmpeg version N-109734-g806ecace91 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
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
libavutil 57. 44.100 / 57. 44.100
libavcodec 59. 60.100 / 59. 60.100
libavformat 59. 37.100 / 59. 37.100
libavdevice 59.  8.101 / 59.  8.101
libavfilter 8. 56.100 /  8. 56.100
libswscale 6.  8.112 /  6.  8.112
libswresample 4.  9.100 /  4.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
Metadata:
major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
creation_time   : 1970-01-01T00:00:00.000000Z
encoder         : Lavf53.24.2
Duration: 00:02:50.86, start: 0.000000, bitrate: 1474 kb/s
Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 1086 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
Metadata:
creation_time   : 1970-01-01T00:00:00.000000Z
handler_name    : VideoHandler
vendor_id       : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time   : 1970-01-01T00:00:00.000000Z
handler_name    : SoundHandler
vendor_id       : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
Metadata:
major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder         : Lavf59.37.100
Stream #0:0(und): Video: wrapped_avframe, yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn (default)
Metadata:
creation_time   : 1970-01-01T00:00:00.000000Z
handler_name    : VideoHandler
vendor_id       : [0][0][0][0]
encoder         : Lavc59.60.100 wrapped_avframe
Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, 5.1, s16, 4608 kb/s (default)
Metadata:
creation_time   : 1970-01-01T00:00:00.000000Z
handler_name    : SoundHandler
vendor_id       : [0][0][0][0]
encoder         : Lavc59.60.100 pcm_s16le
frame= 4271 fps=222 q=-0.0 Lsize=N/A time=00:02:50.83 bitrate=N/A speed=8.87x
video:2002kB audio:96108kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
bench: utime=67.061s stime=2.796s rtime=19.272s
bench: maxrss=40720kB
root@myd-jx8mma7:~#


Comparing test results on PC

Bench: utime=8.169s

Bench: maxrss=107384kB

The development board is about a quarter of the efficiency on a PC. Compared with the computers with the 2nd Gen Intel (R) Core (TM) i5-12500H 2.50 GHz processor Solid-state drive, the performance of the embedded development board is pretty good, and it can almost compete with the PC for this point.


3. Network video on demand terminal

./ffmpeg -re -i test.mp4 -an -vcodec copy -f rtp rtp://192.168.2.100:5004

Print as follows:

root@myd-jx8mma7:~# ./ffmpeg -re -i test.mp4 -an -vcodec copy -f rtp rtp://192.168.2.100:5004
ffmpeg version N-109734-g806ecace91 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
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
libavutil 57. 44.100 / 57. 44.100
libavcodec 59. 60.100 / 59. 60.100
libavformat 59. 37.100 / 59. 37.100
libavdevice 59.  8.101 / 59.  8.101
libavfilter 8. 56.100 /  8. 56.100
libswscale 6.  8.112 /  6.  8.112
libswresample 4.  9.100 /  4.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
Metadata:
major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
creation_time   : 1970-01-01T00:00:00.000000Z
encoder         : Lavf53.24.2
Duration: 00:02:50.86, start: 0.000000, bitrate: 1474 kb/s
Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 1086 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
Metadata:
creation_time   : 1970-01-01T00:00:00.000000Z
handler_name    : VideoHandler
vendor_id       : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time   : 1970-01-01T00:00:00.000000Z
handler_name    : SoundHandler
vendor_id       : [0][0][0][0]
Output #0, rtp, to 'rtp://192.168.2.100:5004':
Metadata:
major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder         : Lavf59.37.100
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1086 kb/s, 25 fps, 25 tbr, 90k tbn (default)
Metadata:
creation_time   : 1970-01-01T00:00:00.000000Z
handler_name    : VideoHandler
vendor_id       : [0][0][0][0]
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 192.168.2.100
t=0 0
a=tool:libavformat 59.37.100
m=video 5004 RTP/AVP 96
b=AS:1086
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z01AH9oBQBbsBEAAAAMAQAAADIPGDKg=,aO88gA==; profile-level-id=4D401F

Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 683 fps= 25 q=-1.0 size=    3102kB time=00:00:27.28 bitrate= 931.5kbits/s speed=   1x


Copy the following part:



Create a new demo.sdp file on the PC, paste the above content, and then use VLC to open the sdp file (The installation method of VLC can be searched on the network).



You can see the video start playing:



4. Summary

This evaluation has built an ffmpeg development environment and tested the decoding performance of ffmpeg on the development board, as well as implemented a demo for network video playback. In summary, it can be seen that the multimedia performance of the MYD-JX8MMA7 development board is very good, fully meeting the application scenarios of multimedia terminals.







 
Prev:  Medical Monitor Solution based on MYIR’s T507-H SoM Module Next:  Answer Sheet Recognition - Simulation on MYIR's ARM+FPGA Board based on OpenCV