Gstreamer MPEG2 TS pipelines

From RidgeRun Developer Connection
Jump to: navigation, search

The following pipelines are meant to be used for testing video and audio streaming using MPEG2 Transport Stream with the following muxers:

  • mpegtsmux
  • ffmux_mpegts

Also a pipeline encoding audio in AAC format can be found at the end of the page.

The performance tests where obtained using a DM365 processor with composite video input. Video format is H264 and audio format is AAC

mpegtsmux

Camera 640x480

Performance:

  • CPU: 70-80 %
  • FPS: 29-30

Board pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=640,height=480 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 intraframeinterval=23 idrinterval=46 ! queue ! mpegtsmux name=mux ! queue ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! mpegtsdemux ! 'video/x-h264' ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)640, height=(int)480, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Camera 640x480 + Audio

Performance:

  • CPU: 90%
  • FPS: 15

Board pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=640,height=480 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! mux. alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=44000 ! mux. mpegtsmux name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client pipeline, not for audio

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! mpegtsdemux ! 'video/x-h264' ! queue ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)640, height=(int)480, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Camera 720x480

Performance:

  • CPU: 70-80 %
  • FPS: 29-30

Board pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=720 ,height=480, pitch=736 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 intraframeinterval=23 idrinterval=46 ! queue ! mpegtsmux name=mux ! queue ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! mpegtsdemux ! 'video/x-h264' ! queue ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)720, height=(int)480, pitch=736, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Camera 720x480 + Audio

Performance:

  • CPU: 80-95%
  • FPS: 15-17

Board pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=720,height=480,pitch=736 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! mux. alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=44000 ! mux. mpegtsmux name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! mpegtsdemux ! 'video/x-h264' ! queue ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)720, height=(int)480, pitch=736, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Camera 1280x720

Performance:

  • CPU: 80-90 %
  • FPS: 29-30

Board Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=1280,height=720 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 intraframeinterval=23 idrinterval=46 ! queue ! mpegtsmux name=mux ! queue ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client Pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! mpegtsdemux ! 'video/x-h264' ! queue ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)1280, height=(int)720, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Camera 1280x720 + Audio

Performance:

  • CPU: 65-90 %
  • FPS: 15, drops to 5

Board Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=1280,height=720 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! mux. alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=44000 ! mux. mpegtsmux name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client Pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! mpegtsdemux ! 'video/x-h264' ! queue ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)1280, height=(int)720, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

ffmux_mpegts

The ffmux_mpegts needs to be debugged, currently the client can't receive video.

Camera 640x480

Performance:

  • CPU: 17-22 %
  • FPS: 30

Board Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=640,height=480 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! ffmux_mpegts name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client Pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! ffdemux_mpegts ! 'video/x-h264' ! queue ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)640, height=(int)480, pitch=736, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Video 640x480 + Audio

Performance:

  • CPU: 55-65 %
  • FPS: 29-30

Board Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=640,height=480 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! mux. alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=128000 ! mux. ffmux_mpegts name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client Pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! ffdemux_mpegts ! 'video/x-h264' ! queue ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)640, height=(int)480, pitch=736, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Video 720x480

Performance:

  • CPU: 10-21 %
  • FPS: 29-30

Board Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=720,height=480, pitch=736 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! ffmux_mpegts name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client Pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! ffdemux_mpegts ! 'video/x-h264' ! queue ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)720, height=(int)480, pitch=736, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Video 720x480 + Audio

Performance:

  • CPU: 55-65 %
  • FPS: 29-30

Board Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=720,height=480 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! mux. alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=128000 ! mux. ffmux_mpegts name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client Pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! ffdemux_mpegts ! 'video/x-h264' ! queue ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)720, height=(int)480, pitch=736, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Video 1280x720

Performance:

  • CPU: 13-20 %
  • FPS: 29-30

Board Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=1280,height=720 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! ffmux_mpegts name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! mpegtsdemux ! 'video/x-h264' ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)1280, height=(int)720, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false

Video 1280x720 + Audio

Performance:

  • CPU: 60-70 %
  • FPS: 29-30

Board Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=1280,height=720 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! mux. alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=44000 ! mux. ffmux_mpegts name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false

Client Pipeline

gst-launch udpsrc port=3001 ! 'video/mpegts, systemstream=(boolean)true, packetsize=(int)188' ! mpegtsdemux ! 'video/x-h264' ! ffdec_h264 ! 'video/x-raw-yuv, width=(int)1280, height=(int)720, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false' ! xvimagesink sync=false


Audio AAC with mpegtsmux

Board Pipeline

gst-launch alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=128000 ! mux. mpegtsmux name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false &

Performance:

 PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
1181  1168 root     S    19472  47%  50% /usr/bin/gst-launch-0.10 alsasrc

Audio AAC with ffmux_mpegts

Board Pipeline

gst-launch alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=128000 ! mux. ffmux_mpegts name=mux ! udpsink port=3001 host=10.251.101.60 sync=false enable-last-buffer=false &

Performance:

 PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
1206  1168 root     S    30380  58%  47% /usr/bin/gst-launch-0.10 alsasrc

CPU Percentage for elements

dmaienc_h264

Dmaienc_h264 Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=640,height=480 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! fakesink

CPU: 20-23%

FPS: 29-30

dmaienc_h264 and mpegtsmux

Dmaienc_h264 and mpegtsmux Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=640,height=480 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! mpegtsmux name=mux ! fakesink

CPU: 100%

FPS: 18-30

dmaienc_aac

Dmaienc_aac Pipeline

gst-launch alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=44000 ! fakesink

CPU: 40%

dmaienc_aac and mpegtsmux

Dmaienc_aac and mpegtsmux Pipeline

gst-launch alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=44000 ! mux. mpegtsmux name=mux ! fakesink

CPU: 55-60 %

dmaienc_h264 and ffmux_mpegts

Dmaienc_h264 and ffmux_mpegts Pipeline

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=640,height=480 ! dmaiaccel ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! queue ! ffmux_mpegts name=mux ! fakesink

CPU: 20 %

FPS: 29-30

dmaienc_aac and ffmux_mpegts

Dmaienc_aac and ffmux_mpegts Pipeline

gst-launch alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=44000 ! mux. ffmux_mpegts name=mux ! fakesink

CPU: 50%


dmaienc_aac and dmaienc_h264 with qtmux

This pipeline was added just to test audio and video encoding performance

Dmaienc_aac and dmaienc_h264 with qtmux Pipeline

Performance:

CPU: 51-82 %

FPS: 17-19

gst-launch -e v4l2src input-src=composite always-copy=FALSE ! video/x-raw-yuv,format=\(fourcc\)NV12,width=640,height=480 ! dmaiaccel ! dmaiperf print-arm-load=true ! dmaienc_h264 encodingpreset=2 targetbitrate=1000000 ratecontrol=2 ! mux. alsasrc ! dmaienc_aac outputBufferSize=131072 bitrate=128000 ! mux. qtmux name=mux ! filesink location=testfile.mpeg &