i.mx8M evk board has HW decoder and SW encoder, this document introduce how to use HW decoder and SW encoder
the bsp is the latest version L4.14.78, the environment is :
$ DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source fsl-setup-release.sh -b build-wayland
$ bitbake fsl-image-validation-imx
For the 4.14.78, we don’t use mfgtool anymore, customer can use uuu.exe to program the image to the board, the uuu.exe can be found from https://github.com/NXPmicro/mfgtools/releases
Here we use emmc as media, I attached the kerel_emmc.uuu for reference
Open the cmd.exe, then use the command “uuu.exe kernel_emmc.uuu” to download the image to the emmc on the board as the picture shows
When the board boot up, don’t forget to change the image and fdt_file as you want, for example, I use Image-imx8mqevk.bin as image name and Image-fsl-imx8mq-evk.dtb as my fdt file, you can choose different image and fdt file as uuu file mentions.
1) Decoding
For play the video, we can use three solution to support this
a) gplay-1.0 test.mp4
b) gst-launch-1.0 playbin uri=file:///mnt/sdcard/test.mp4
c) gst-launch-1.0 filesrc location=test.mp4 typefind=true ! video/quicktime ! aiurdemux ! queue max-size-time=0 ! vpudec ! autovideosink
For play the two different video to the different display, current imx8M evk board supports dual hdmi output, in the uboot command:
setenv fdt_file Image-fsl-imx8mq-evk-dual-display.dtb
saveenv
Use the command as below:
gst-launch-1.0 playbin uri=file:///test1.mp4 playbin uri=file:///test2.mp4 video-sink="glimagesink display-master=false display-slave=true"
2) Encoding
Because imx8M evk don’t have hardware encoding, so we need to add the SW plugins in the bsp
a)add the commands as below in the /build/conf/local.conf
"CORE_IMAGE-EXTRA_INSTALL += "gstreamer1.0-plugins-ugly-meta packagegroup-fsl-gsstreamer1.0-commercial gst-ffmpeg"
LICENSE_FLAGS_WHITELIST = "commercial""
b)Create the new txt file and add “PACKAGECONFIG_mx8mq = "x264"”in the file
c)Rename the file as 0-plugins-ugly_%.bbappend and put this file under /sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-multimedia/gstreamer
d)Build the image you want, then download the new rootfs file in the board, use the command “gst-inspect-1.0 | grep x264”