Table of Contents
The virtual iMX8m board supports playing .mp4
video files directly on your device.
You can use either the AVH web interface or a set of API and POST requests.
Open the GStreamer Multimedia Application
Create a virtual iMX8M Arm Cortex Complex board running Yocto Linux OS version 2.2.0.
Open the Terminal by clicking the second icon in the top-left of the device's display. You may prefer to open the display to a new window by clicking Pop Out towards the top-right.
Run the following command in Terminal to launch GStreamer.
gst-launch-1.0 v4l2src device=/dev/video4 ! waylandsink
After a few seconds, you should see the video player open along with a message that your camera is not enabled.
Open the Camera & Microphone settings under the Sensors tab and enable the sensors.
Play Video Using the Web Interface
The iMX8m device supports video playback from your webcam, by uploading a file, or by sharing the video's URL.
Use Your Webcam
After you enable the camera and microphone sensors, allow the browser to access your computer's built-in webcam and microphone. (This process will vary depending on your browser.)
Confirm that you can see your computer's sensors appear under CAMERA and MICROPHONE.
You should see your webcam video appear on GStreamer.
Upload a File
After enabling the virtual camera and microphone in the Sensors tab, upload the
.mp4
video file. You do not need to allow the browser to access your local computer's physical camera and microphone.When the upload completes, click PLAY VIDEO. The video should play on GStreamer in a loop.
Link to a URL
After enabling the camera and microphone in the Sensors tab, enter a URL to a
.mp4
video and click PLAY VIDEO. You do not need to allow the browser to access your local computer's physical camera and microphone.The video should play on GStreamer in a loop.
Play Videos Using API and POST Requests
You can also use the command line to play multimedia files.
Start with GStreamer opened (gst-launch-1.0 v4l2src device=/dev/video4 ! waylandsink
).
Upload a File
Use the AVH API to acquire the device instance.
Upload the
.mp4
file to that instance.const videoImage = await instance.uploadImage('media', $LOCATION_OF_AN_MP4_ON_YOUR_LOCAL_DISK, '$ANY_ARBITRARY_STRING')
Note the
imageId
that is returned.Make a POST request to
/api/v1/instances/${instanceId}/play
with the following body.{
instanceId,
imageId
}Verify that you can see the video playing.
Link to a URL
Use the AVH API to acquire the device instance.
Make a POST request to
/api/v1/instances/${instanceId}/play
with the video URL in the body.{
instanceId,
url: 'http://null.to/test.mp4'
}Verify that you can see the video playing.