i.MX 6 Series Yocto Project Multimedia Users Guide
i.MX 6 Series Yocto Project Multimedia Users Guide
Contents
This document describes how to build Freescale Multimedia 2 Building Multimedia Packages..................................2
components (Gstreamer plugins, decoder/encoder, and 3 Multimedia User Cases..............................................3
demuxer) with Yocto Project, and how to run various
multimedia usage cases by Gstreamer command lines. Users A mfw_isink Usage.....................................................11
can refer to these command lines to create their multimedia
products.
1.1 Audience
This document is intended for software, hardware, and system
engineers who are planning to use multimedia codecs with
GStreamer architecture and for anyone who wants to
understand more about multimedia codecs. The document
assumes that the user has a basic understanding of GStreamer
and Linux architecture.
1.2 Conventions
This document uses the following conversions:
• Courier New font: This font is used to identify commands, explicit command parameters, code examples,
expressions, data types, and directives.
• $ Sign: It is used to specify replaceable command parameters.
1.3 References
• i.MX 6 SABRE-SD Linux User's Guide
• i.MX 6 SABRE-AI Linux User's Guide
• i.MX 6SoloLite EVK Linux User's Guide
• Freescale Yocto Project User Guide
• i.MX 6 Series Yocto Project Multimedia Release Notes
For each package details, see the i.MX 6 Series Yocto Multimedia Release Notes.
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
2 Freescale Semiconductor, Inc.
Multimedia User Cases
$ bitbake $packagename
The package name should be identical to the recipe name (under sources/meta-fsl-arm/recipes-multimedia/
$component/$packagename_$version.bb).
For example,
$ bitbake gst-fsl-plugin
3.1 Playbacks
Playbacks include the following:
• Audio only playback
• Video only playback
• Audio/Video file playback
• Other methods for playback
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
Freescale Semiconductor, Inc. 3
Multimedia User Cases
size-time=0 ! vpudec ! mfw_v4lsink
NOTE
The eqmode value 2 indicates the “bass booster” scene.
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
4 Freescale Semiconductor, Inc.
Multimedia User Cases
gst-launch playbin2 uri=http://SERVER/test.avi
• gplay
gplay http://SERVER/test.avi
export VSALPHA=1
gst-launch playbin2 uri=file:///$file1 video-sink="mfw_isink display=LVDS" playbin2
uri=file:///$file2 video-sink="mfw_isink display=HDMI"
Note: LVDS and HDMI in the command are the display names defined in the vssconfig file.
• mfw_isink
export VSALPHA=1
gst-launch playbin2 uri=file:///$file video-sink="mfw_isink
display=LVDS display-1=HDMI"
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
Freescale Semiconductor, Inc. 5
Multimedia User Cases
export VSALPHA=1
gst-launch playbin2 uri=file:///$file1 video-sink="mfw_isink axis-left=0 axis-
top=0 disp-width=320 disp-height=240” &
gst-launch playbin2 uri=file:///$file2 video-sink="mfw_isink axis-left=400 axis-
top=0 disp-width=640 disp-height=480” &
gst-launch playbin2 uri=file:///$file3 video-sink="mfw_isink axis-left=400 axis-
top=500 disp-width=320 disp-height=240”
3.6 Encoding
Encoding includes audio encoding and video encoding.
• WMA encoding
NOTE
The blocksize property of the filesrc plug-in depends on the resolution of the input image.
For I420 YUV files, Blocksize = inputwidth * inputheight * 1.5
The codec type property of the $video_encoder_plugin plug-in controls the target encode
codec type. It could be 0 (MPEG4), 5(H263), 6(H264), or 12(MJPG).
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
6 Freescale Semiconductor, Inc.
Multimedia User Cases
3.7 Transcoding
The command line example is as following:
3.8 Recording
Recording includes the following types:
• Audio recording
• Video recording
• Audie/Video recording
• TV-in Source
• WMA recording
NOTE
The recorded duration calculated as $NUMBER*$SIZE*8/(samplerate*chanel*bitwidth).
For example, to record 10 seconds of stereo channel sample with 44.1K sample rate and
a16bit width, use the following command:
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
Freescale Semiconductor, Inc. 7
Multimedia User Cases
NOTE
The fps-n property of the mfw_v4lsrc plug-in controls the camera capture frame rate.
The codec property of the $video_encoder_plugin plug-in controls the target encode
codec type. Use the gst-inspect command to get more details about the codec
property.
NOTE
• -e indicates to send EOS when the user presses Ctrl+C to avoid output corruption.
• $MUXER can be matroskamux, mp4mux, avimux, flvmux, qtmux, or mpegtsmux.
• If multiplexing the MPEG4 video to mpegtsmux, vpuenc needs to set property
seqheader-method=2 and FSL MPG parser cannot support the MPEG4 format.
• $EXTENSION is the filename extension according to the multiplexer type.
NOTE
The TV decoder is ADV7180. It supports NTSC and PAL TV mode. The output video
frame is interlaced, so the sink plugin needs to enable deinterlace. The default value of
mfw_v4lsink deinterface is True.
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
8 Freescale Semiconductor, Inc.
Multimedia User Cases
• Manually pipeline
The audio parse plugin is required before the beepdec plugin enables beepdec to work in low-latency mode.
You can run the following command to show the Gstreamer RTP depacketize plugins:
NOTE
If you need to pause or resume the RTSP streaming playback, you need to use slave or
none buffer-mode for RTSPSRC, as in buffer buffer-mode. After resuming, the
timestamp is forced to start from 0, and this will cause buffers to be dropped after
resuming.
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
Freescale Semiconductor, Inc. 9
Multimedia User Cases
aiurdemux streaming_latency=400 name=d d. ! queue ! vpudec low-
latency=true !
queue ! mfw_v4lsink sync=true d. ! queue ! beepdec ! alsasink
sync=true
For example:
For example:
NOTE
The source file that the UDP/RTP server sends must be in TS format.
It is recommended to start the server one second earlier than the time client starts.
One property of aiurdemux is useful for UDP/RTP TS streaming:
streaming-latency: This is the extra added latency of the pipeline, and the default value is
400 ms. This value is designed for the situation that the client starts first. If the value is
too small, the whole pipeline may not run due to lack of audio or video buffers. In that
case, you should cancel the current command and restart the pipeline. If the value is too
large, you need to wait for a long time to see the video after starting the server.
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
10 Freescale Semiconductor, Inc.
Multimedia User Cases
test-url $RTSP_URI
For example:
test-uri file:///home/root/temp/TestSource/mp4/1.mp4
• Server address:
rtsp://$SERVER_IP/8554/test
For example:
rtsp://10.192.241.106/8554/test
• Client operation supported:
isink uses a configuration file vssconfig to set parameters for each display device. The file is located in the /usr/share
folder, and the configuration syntax is as follows:
[Display Name]
Specify the display name, used in the mfw_isink property display-x to enable the x display.
type
Currently specified to framebuffer.
format
The framebuffer color format.
fb_num
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
Freescale Semiconductor, Inc. 11
The frame buffer number for this display to show.
vsmax
The maximum videos can be showed for this display, with default value of 4.
main_fb_num
UI framebufer number. Usually, it is 0.
The following is an example of vssconfig for dual-display mode, LVDS(master) + HDMI.
# master display
[LVDS]
type = framebuffer
format = RGBP
fb_num = 1
main_fb_num = 0
vsmax=4
# slave display
[HDMI]
type = framebuffer
format = RGBP
fb_num = 2
vs_max = 4
We have two examples of vssconfig installed into the image, vssconfig.dual.lvds_hdmi, and vssconfig.triple.2lvds_hdmi
for dual displays (LVDS + HDMI) and triple displays (LVDS + HDMI + LVDS). You can refer to them respectively.
i.MX 6 Series Yocto Project Multimedia User's Guide, Rev L3.10.17_1.0.0-ga, 05/2014
12 Freescale Semiconductor, Inc.
How to Reach Us: Information in this document is provided solely to enable system and software
implementers to use Freescale products. There are no express or implied copyright
Home Page:
freescale.com licenses granted hereunder to design or fabricate any integrated circuits based on the
Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc.,
Reg. U.S. Pat. & Tm. Off. All other product or service names are the property of their
respective owners. ARM and ARM Cortex-A9 are registered trademarks of ARM
Limited.
© 2014 Freescale Semiconductor, Inc.