<div dir="ltr"><div><div><div><div><div>Hi<br><br>What is the source of the video (where is the shmsrc gettings its video)?<br><br>A couple of things.<br><br>1) You specify frame rate to be 1/24. I assume you want to specify 24/1. The difference is significant.<br>
<br></div><div>2) You have specified a queue of just 2 buffers. That's a bit aggressive and it might not do what you want taking into account your video source might have a lot of buffers. Howmany does your source have?<br>
</div><div><br></div>3) You have a video scale from 1024x768 to 1024x768 in the BGRA domain. Since you don't scale you can quite likely skip it. I assume that GStreamer just passes buffers without any actual modification, so it is not so bad.<br>
<br></div>4) You have a queue after videoscale and before encoding. That one you can skip as it is not needed.<br><br></div>5) You have an extra ffmpegcolorspace not needed. Hmm it looks like a generic code I have seen before ;-)<br>
<br></div>6) You have an alignment parameter for mpegtsmux. That does not exist for GStreamer 0.10<br><br></div>7) 1200kbps might be a bit to aggressive for the selecting coding parameters, but you can try.<br><div><div><div>
<div><br><div>I have rearranged the code a bit and kept the ability to resize stream before encoding.<br><br>The below pipeline works well on an old Thinkpad T61 and uses only 35% out of 200%.<br><br>VIDEO_IN='video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321,red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216,pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false,width=(int)1024, height=(int)768, framerate=(fraction)24/1'<br>
<br>VIDEO_OUT='video/x-raw-yuv, profile=(string)main, format=(fourcc)I420, framerate=(fraction)24/1, width=(int)1024, height=(int)576, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false'<br><br><br>gst-launch-0.10 -v shmsrc socket-path=/tmp/socket do-timestamp=true is-live=true ! \<br>
queue leaky=2 max-size-buffers=2 !\<br>
$VIDEO_IN !\<br><div id=":22m" class="">
videoscale !\<br>
ffmpegcolorspace !\<br></div><div id=":22m" class=""> $VIDEO_OUT !\<br></div><div id=":22m" class="">
videoscale !\<br>
x264enc bitrate=1200 tune=zerolatency speed-preset=2 key-int-max=20 cabac=false ! \<br>
'video/x-h264, profile=main' !\<br> h264parse !\<br>
queue !\<br>
mpegtsmux ! !\<br> chopmydata max-size=1316 min-size=1316 !\<br>
udpsink clients=<a href="http://224.0.0.5:1234" target="_blank">224.0.0.5:1234</a> auto-multicast=true sync=false<br><br></div><div id=":22m" class="">Best regards<br></div><div id=":22m" class="">Peter Maersk-Moller<br>
</div><br></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 18, 2014 at 7:39 PM, buzzy <span dir="ltr"><<a href="mailto:zygjys@gmail.com" target="_blank">zygjys@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
we need to optimize the pipeline which has socket as an input and outputs to<br>
udp after H264 encoding. The following pipeline looks like this:<br>
<br>
============================================================================<br>
gst-launch-0.10 -v shmsrc socket-path=/tmp/socket do-timestamp=true<br>
is-live=true ! \<br>
queue leaky=2 max-size-buffers=2<br>
! \<br>
video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321,<br>
red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216,<br>
pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false',<br>
width=(int)'1024', height=(int)'768', framerate=(fraction)'1/24'<br>
! \<br>
videoscale<br>
! \<br>
ffmpegcolorspace<br>
! \<br>
video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321,<br>
red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216,<br>
pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false',<br>
width=(int)'1024', height=(int)'768', framerate=(fraction)'1/24'<br>
! \<br>
queue<br>
! \<br>
ffmpegcolorspace<br>
! \<br>
x264enc bitrate=1200 tune=zerolatency speed-preset=2 key-int-max=20<br>
cabac=false ! \<br>
'video/x-h264, profile=main'<br>
! \<br>
h264parse<br>
! \<br>
queue<br>
! \<br>
mpegtsmux alignment=7 ! chopmydata max-size=1316 min-size=1316<br>
! \<br>
udpsink clients=<a href="http://224.0.0.5:1234" target="_blank">224.0.0.5:1234</a> auto-multicast=true sync=false<br>
============================================================================<br>
(The pipeline could not work out of the box because I've changed env/shell<br>
variables to actual elements and didn't test it).<br>
So, the problem is that this pipeline uses almost 50% of CPU and we wish to<br>
reduce this number. The resolution, framerate and bitrate are already the<br>
lowest values thats accepted. Output stream must be H264/MP4 video.<br>
What could be the tips to reduce the CPU load? What options to use? Maybe<br>
start using Gstreamer1.0?<br>
Thank you!<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Optimising-H264enc-pipeline-tp4666006.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Optimising-H264enc-pipeline-tp4666006.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>