Appsrc video performance optimization

lucas.kinion lucas.s.kinion at nasa.gov
Tue Jun 14 20:19:01 UTC 2016


Hi,

I'm trying to write some test code that inserts video data into a pipeline
from a USB camera that is not V4L2 compatible, and instead uses its own API.
I've attached my code. I'm wondering if there's a way my code needs to be
optimized to increase performance, or if I am being processor limited. I am
using a TI Sitara AM5728 based single board computer, which has a hardware
encoder capable of 1080p at 60fps, and a USB 3.0 camera which is also capable
of 1080p at 60fps. I am currently only achieving 1080p at 15fps.

The code does the following:
Initialize the pipeline, elements, and caps
kick off a thread that pulls UYVY video frames from the camera into an array
connects cb_need_data to the appsrc so that another thread can pull frames
from the array into the pipeline.

The pipeline looks like this, and seems to be working:
appsrc [caps] ! videoconvert ! [caps] ! ducatih264enc ! h264parse !
rtph264pay ! udpsink
And on the other machine I receive the UDP stream through VLC using an SDP
file. 

The code works, but I believe it is slow. The max framerate it can push into
the pipeline is ~15fps when the camera is set to 1920x1080 resolution. At
lower resolutions, it can handle 30fps without issue. Is there some obvious
way I am missing to optimize my code so that it can handle 1080p at 30fps or
60fps, as my camera and hardware encoder support? Or am I just being limited
by something else?

I'm mainly looking at the cb_need_data for optimizations. Some basic
profiling leads me to believe that it is spending a lot of time on
gst_app_src_push_buffer, but I don't know of any way to optimize this
function. Is there something I'm missing?

Thank you
Lucas Kinion

pixelink_test.cpp
<http://gstreamer-devel.966125.n4.nabble.com/file/n4678040/pixelink_test.cpp>  



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Appsrc-video-performance-optimization-tp4678040.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list