Template:Multimedia running gstreamer more

Below provides more gstreamer pipeline examples.

1. File to file video encoding pipeline: target # gst-launch-1.0 filesrc location=waterfall-352-288-nv12-inp.yuv ! videoparse width=352 height=288 format=nv12 ! video/x-raw, width=352, height=288 ! ducatih264enc ! filesink location=waterfall-352-288-nv12-inp_gst.h264

The cap filter of "video/x-raw, width=352, height=288" is needed in this pipeline to specify the width and height. Otherwise, variable width and height are configured for the encoder and the encoded output can be corrupted.

2. File to file 4K H264 encoding pipeline: target # gst-launch-1.0 filesrc location= 4k.nv12 ! videoparse width=3840 height=2160 format=nv12 framerate=12/1 ! video/x-raw, width=3840, height=2160 ! ducatih264enc level=51 profile=100 bitrate=16000 ! filesink location=4k.h264

3. ARM H265 (HEVC) decoding pipeline target # gst-launch-1.0 filesrc location= .265 ! 'video/x-raw, format=(string)NV12, framerate=(fraction)24/1, width=(int)1280, height=(int)720' ! h265dec threads=2 ! vpe ! kmssink

4. DSP offloaded image processing pipeline target # gst-launch-1.0 filesrc location= .265 ! 'video/x-raw, format=(string)NV12, framerate=(fraction)24/1, width=(int)1280, height=(int)720' ! h265dec threads=1 ! videoconvert ! dsp66videokernel kerneltype=1 filtersize=9 lum-only=1 ! videoconvert ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)640, height=(int)480' ! kmssink

This pipeline decodes an H265 clip on ARM A15, offloads the image processing task (Sobel 3x3 kernel) to DSP, and the processed clip is then re-sized and displayed.

Processor SDK provides reference implementation of multiple image processing kernels, for which the pipeline can be configured as shown in the table below.

5. Audio/Video decoding with http input source target # gst-launch-1.0 playbin uri=http:// video-sink=kmssink audio-sink=alsasink

6. Audio/Video decoding with rtsp input source First, set up and run RTSP server on host. Then, run the following command: target # gst-launch-1.0 playbin uri=rtsp:// video-sink=kmssink audio-sink=alsasink

7. Record real-time FPS of video decoding target # gst-launch-1.0 -v playbin uri=file:/// video-sink=fpsdisplaysink audio-sink=alsasink > fps_log.txt Note: please view fps_log.txt to find out the FPS information after the pipeline completes.