gst-sh-mobile-dec - Decodes MPEG4/H264 video stream to raw YUV image data on SuperH environment using libshcodecs HW codec.
This element is designed to use the HW video processing modules of the Renesas SuperH chipset to decode MPEG4/H264 video streams. This element is not usable in any other environments and it requires libshcodes HW codec to be installed.
gst-launch \
filesrc location=test.m4v \
! "video/mpeg, width=320, height=240, framerate=30/1, mpegversion=4" \
! gst-sh-mobile-dec \
! filesink location=test.raw
In this pipeline we use filesrc element to read the source file, which is a MPEG4 video elementary stream. After filesrc we add static caps as the filesrc does not do caps negotiation and the decoder requires them. The last element in the pipeline is filesink, which writes the output YUV-data into a file.
gst-launch \ filesrc location=test.avi ! avidemux name=demux \ demux.audio_00 ! queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink \ demux.video_00 ! queue ! gst-sh-mobile-dec ! gst-sh-mobile-sink
Filesrc element is used to read the file again, which this time is an AVI wrapped video containing both audio and video stream. avidemux element is used to strip the avi container. avidemux has two src-pads, which are named “demux” using a property. Both of the avidemux src pads are first connected to queue elements, which take care of the buffering of the data in the pipeline.
The audio stream is then connected to the decodebin element, which detects the stream format and does the decoding. audioconvert and audioresample elements are used to transform the data into a suitable format for playback. The last element in the audio pipeline is autoaudiosink, which automatically detects and connects the correct audio sink for playback. This audio pipeline composition is very common in the gstreamer programming.
The video pipeline is constructed from SuperH specific elements; gst-sh-mobile-dec and gst-sh-mobile-sink. The gst-sh-mobile-sink is a videosink element for SuperH.
gst-launch \ udpsrc port=5000 caps="application/x-rtp,clock-rate=90000" \ ! gstrtpjitterbuffer latency=0 ! rtpmp4vdepay \ ! "video/mpeg, width=320, height=240, framerate=15/1" \ ! gst-sh-mobile-dec \ ! gst-sh-mobile-sink
Here the video stream is received from udpsrc element. gstrtpjitterbuffer element is used to take care of ordering and storing the received RTP packages. Next rtpmp4vdepay element is used to remove the RTP frames from the buffers. Again, the static caps are needed to pass information to the decoder.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
Pablo Virolainen <pablo.virolainen@nomovok.com> Johannes Lahti <johannes.lahti@nomovok.com> Aki Honkasuo <aki.honkasuo@nomovok.com>