Installing GStreamer for Integrating multimedia software stack on NXP i.MX8M Plus
Getting started with AI on NXP i.MX8M Plus RidgeRun documentation is currently under development. |
Configuring the local.conf
After you have configured the development environment you will have some configuration files in which you can declare some libraries to the image or the SDK.
In order to install GStreamer in this board, you just need to got the local.conf file at:
cd $HOME/<your image folder>/<your build directory>/conf/ cat local.conf
In this file you just need to add the following lines:
# -- GStreamer stuff -- CORE_IMAGE_EXTRA_INSTALL += "gstreamer1.0-plugins-ugly-meta \ packagegroup-fsl-gstreamer1.0-commercial " LICENSE_FLAGS_WHITELIST += "commercial" CORE_IMAGE_EXTRA_INSTALL += "gstreamer1.0-plugins-ugly" PACKAGECONFIG_append_pn-gstreamer1.0-plugins-ugly = " x264 mad \ amrnb amrwb dvdread " IMAGE_INSTALL_append = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad imx-gpu-g2d imx-gst1.0-plugin'
Building the image with the changes in local.conf
cd $HOME/<your image folder> source setup-environment build_xwayland bitbake imx-image-core
Testing GStreamer in the i.MX8M Plus
After flashing the image into the board, please execute some of the pipelines below in order to test the GStreamer installation.
In this example, please imagine that the i.MX8M Plus is serving the video to the host machine to show using UDP network protocol to transmit the multimedia.
Note: For this example, you will need a downloaded video on your board.
i.MX8M Plus as a UDP video server
In your host machine
Let's put the host machine as the video receiver:
PORT=5000 gst-launch-1.0 udpsrc port=$PORT ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! autovideosink
In the i.MX8M Plus
HOST_IP=192.168.x.y PORT=5000 VIDEO=your_video.mp4 gst-launch-1.0 -v filesrc location=$VIDEO ! qtdemux ! queue ! rtph264pay ! udpsink host=$HOST_IP port=$PORT
Host machine as a UDP video server
Let's put the host machine as the video server this time:
Pipe in the i.MX8M Plus
PORT=5000 gst-launch-1.0 udpsrc port=$PORT ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! fakesink -v
Pipe in the PC
PORT=5000 HOST_IP=<ip of the i.MX8M Plus> VIDEO=<your video>.mp4 gst-launch-1.0 -v filesrc location=$VIDEO ! qtdemux ! queue ! rtph264pay ! udpsink host=$HOST_IP port=$PORT