Skip to content

Instantly share code, notes, and snippets.

@KensakuKOMATSU
Created September 16, 2017 00:04
Show Gist options
  • Save KensakuKOMATSU/2b5309187cdf33c712e9f37d367a171d to your computer and use it in GitHub Desktop.
Save KensakuKOMATSU/2b5309187cdf33c712e9f37d367a171d to your computer and use it in GitHub Desktop.
sample pipeline gstreamer script for H.264
#!/bin/bash
HOST=10.49.52.197
gst-launch-1.0 v4l2src device=/dev/video0 ! \
video/x-raw,format=RGB,width=640,height=480,framerate=30/1 ! \
videoconvert ! timeoverlay ! \
omxh264enc target-bitrate=2000000 control-rate=variable ! \
rtph264pay config-interval=1 pt=96 ! \
udpsink host=${HOST} port=15004
@gitsravanth
Copy link

gitsravanth commented May 9, 2019

hai all,
iam very new to use Gstreamer pipeline while using the below pipeline script i come across with a issue , the issue i face when i run this code the CPU consumption is 92% how to reduce it to 50-60%. The protocol i use here is Ethernet cable.So what should i do to reduce the CPU consumption.

gst-launch-1.0 -e ksvideosrc device-index=0 ! tee name=tp1 tp1. ! timeoverlay halignment="center" ! clockoverlay halignment="left" ! videoconvert ! queue max-size-buffers=0 leaky=0 ! "video/x-raw,width=720,height=576, fps=25/1" ! x264enc pass=qual tune=zerolatency ! rtph264pay config-interval=1 ! udpsink host=%SINK_GROUP_1% auto-multicast=true port=%GROUP1_CAM1% tp1. ! timeoverlay halignment="center" ! clockoverlay halignment="left" ! videoconvert ! queue max-size-buffers=0 leaky=0 ! "video/x-raw,width=720,height=576, fps=25/1" ! x264enc pass=qual tune=zerolatency ! rtph264pay config-interval=1 ! udpsink host=%SINK_GROUP_2% auto-multicast=true port=%GROUP2_CAM1% ksvideosrc device-index=1 ! tee name=tp2 tp2. ! timeoverlay halignment="center" ! clockoverlay halignment="left" ! videoconvert ! queue max-size-buffers=0 leaky=0 ! "video/x-raw,width=720,height=576, fps=25/1" ! x264enc pass=qual tune=zerolatency ! rtph264pay config-interval=1 ! udpsink host=%SINK_GROUP_1% auto-multicast=true port=%GROUP1_CAM2% tp2. ! timeoverlay halignment="center" ! clockoverlay halignment="left" ! videoconvert ! queue max-size-buffers=0 leaky=0 ! "video/x-raw,width=720,height=576, fps=25/1" ! x264enc pass=qual tune=zerolatency ! rtph264pay config-interval=1 ! udpsink host=%SINK_GROUP_2% auto-multicast=true port=%GROUP2_CAM2% ksvideosrc device-index=2 ! tee name=tp3 tp3. ! timeoverlay halignment="center" ! clockoverlay halignment="left" ! videoconvert ! queue max-size-buffers=0 leaky=0 ! "video/x-raw,width=720,height=576, fps=25/1" ! x264enc pass=qual tune=zerolatency ! rtph264pay config-interval=1 ! udpsink host=%SINK_GROUP_1% auto-multicast=true port=%GROUP1_CAM3% tp3. ! timeoverlay halignment="center" ! clockoverlay halignment="left" ! videoconvert ! queue max-size-buffers=0 leaky=0 ! "video/x-raw,width=720,height=576, fps=25/1" ! x264enc pass=qual tune=zerolatency ! rtph264pay config-interval=1 ! udpsink host=%SINK_GROUP_2% auto-multicast=true port=%GROUP2_CAM3% ksvideosrc device-index=3 ! tee name=tp4 tp4. ! timeoverlay halignment="center" ! clockoverlay halignment="left" ! videoconvert ! queue max-size-buffers=0 leaky=0 ! "video/x-raw,width=720,height=576, fps=25/1" ! x264enc pass=qual tune=zerolatency ! rtph264pay config-interval=1 ! udpsink host=%SINK_GROUP_1% auto-multicast=true port=%GROUP1_CAM4% tp4. ! timeoverlay halignment="center" ! clockoverlay halignment="left" ! videoconvert ! queue max-size-buffers=0 leaky=0 ! "video/x-raw,width=720,height=576, fps=25/1" ! x264enc pass=qual tune=zerolatency ! rtph264pay config-interval=1 ! udpsink host=%SINK_GROUP_2% auto-multicast=true port=%GROUP2_CAM4%
 
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment