CPU/memory to high when playback over timeline

Nelu NeluCociag at gmail.com
Tue Feb 16 09:42:12 UTC 2021


Hello everybody,
I use GStreamer Editing Services for simple operations such as cutting parts
of an audio-video clip. 
I noticed that if I try to insert a high-resolution video (3840 x 2160) and
play, the memory occupied by the application increases to 1.5Gb and the CPU
increases to 80-95% and is maintained as long as I play. Is there any method
to reduce CPU / memory to a reasonable value?
I use GStreamer 1.16.1, do you think the newer versions are more optimized?
The code used is not much different from the one below:

#include <stdlib.h>
#include <ges/ges.h>
#include <stdlib.h>

int main(int argc, char ** argv)
{
	GESPipeline *pipeline;
	GESTimeline *timeline;
	GESTrack *tracka, *trackv;
	GESLayer *layer;
	GMainLoop *mainloop;
	guint i;

	gst_init(&argc, &argv);
	ges_init(); /* Initialize the GStreamer Editing Services */

	timeline = ges_timeline_new(); /* This is our main GESTimeline */
	tracka = GES_TRACK(ges_audio_track_new());
	trackv = GES_TRACK(ges_video_track_new());

	layer = ges_layer_new(); /* We are only going to be doing one layer of
clips */

	if (!ges_timeline_add_layer(timeline, layer))  /* Add the tracks and the
layer to the timeline */
		return -1;
	if (!ges_timeline_add_track(timeline, tracka))
		return -1;
	if (!ges_timeline_add_track(timeline, trackv))
		return -1;

	/* Here we've finished initializing our timeline, we're
	* ready to start using it... by solely working with the layer ! */
	gchar *uri1 = gst_filename_to_uri("C:\\Users\\neluc\\Documents\\KSV1\\Roger
Federer.mp4", NULL);
	GESUriClip *src1 = ges_uri_clip_new(uri1);
	g_assert(src1);
	g_free(uri1);
	ges_layer_add_clip(layer, (GESClip *)src1);

	pipeline = ges_pipeline_new();
	if (!ges_pipeline_set_timeline(pipeline, timeline)) /* Add the timeline to
that pipeline */
		return -1;

	/* We set the pipeline to playing ... */
	gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);

	mainloop = g_main_loop_new(NULL, FALSE);
	g_main_loop_run(mainloop);

	return 0;
}

You can download the video I tested with from this address: 
www.videosurgeon.net/Roger_Federer.mp4
<https://www.videosurgeon.net/Roger_Federer.mp4>  




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list