Part Number: AM5728
Hello,
When i simply execute below command, CPU usage is around: 3%.
command:
=========
gst-launch-1.0 -v rtspsrc location="rtsp://888888:888888@192.168.1.5:554/cam/realmonitor?channel=1&subtype=1 --live --fps 25" ! rtph264depay ! h264parse ! ducatih264decvpe ! 'video/x-raw, format=(string)NV12, width=(int)800, height=(int)600' ! waylandsink
But when simply use gstreamer application in code.CPU usage increase too much (around 100%).
I am attaching one simple gstreamer application.
Why application using too much CPU?
Regards,
Kishan Patel.
#include <gst/gst.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
GstElement *pipeline;
GstBus *bus;
GstMessage *msg;
const gchar *nano_str;
guint major, minor, micro, nano;
/* Initialize GStreamer */
gst_init (&argc, &argv);
gst_version (&major, &minor, µ, &nano);
printf ("GStreamer Version: %d.%d.%d\n",major, minor, micro);
/* Build the pipeline */
//pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);
//pipeline = gst_parse_launch ("playbin uri=rtsp://admin:jenex#2018@192.168.1.108:554 video-sink=waylandsink",NULL);
pipeline = gst_parse_launch ("playbin uri="rtsp://888888:888888@192.168.1.5:554/cam/realmonitor?channel=1&subtype=1 --live --fps 25" video-sink=waylandsink",NULL);
//pipeline = gst_parse_launch ("playbin uri=rtsp://admin:admin@192.168.1.3:554 video-sink=waylandsink",NULL);
//pipeline = gst_parse_launch ("rtspsrc location=rtsp://admin:admin@192.168.1.2:554 latency=0 ! decodebin ! videoconvert ! appsink ", NULL);
//pipeline = gst_parse_launch ("rtspsrc location=rtsp://admin:jenex#2018@192.168.1.108:554 latency=0 ! decodebin ! videoconvert ! appsink ", NULL);
/* Start playing */
//gst_element_set_state (pipeline, GST_STATE_PAUSED);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* Wait until error or EOS */
bus = gst_element_get_bus (pipeline);
msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
/* Free resources */
if (msg != NULL)
gst_message_unref (msg);
gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
return 0;
}