seek over timeline

Nelu NeluCociag at gmail.com
Wed Mar 25 17:50:04 UTC 2020


Hello,
I use the timeline editing functions and I have problems when inserting a
high-resolution audio-video clip, and in a portion over the video, I insert
2-3 png images. Problems occur when I seek over the portion where the images
are placed, then there is a delay of 2-3 seconds and after that, the last
images from the seek operation comes on. Has anyone encountered a similar
problem? Looks like seek operations are stored in a cache ... is there a
possibility to clear this cache?
The code used to insert the video file and the images are as below:

	timeline = ges_timeline_new();
	tracka = GES_TRACK(ges_audio_track_new());
	trackv = GES_TRACK(ges_video_track_new());

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

	g_object_set(layerImg1, "priority", 1, NULL);
	g_object_set(layerImg2, "priority", 2, NULL);
	g_object_set(layerImg3, "priority", 3, NULL);
	g_object_set(layer1, "priority", 4, NULL);


	/* Add the tracks and the layer to the timeline */
	if (!ges_timeline_add_layer(timeline, layer1)) 	return -1;
	if (!ges_timeline_add_layer(timeline, layerImg1)) return -1;
	if (!ges_timeline_add_layer(timeline, layerImg2)) return -1;
	if (!ges_timeline_add_layer(timeline, layerImg3)) return -1;

	if (!ges_timeline_add_track(timeline, tracka)) 		return -1;
	if (!ges_timeline_add_track(timeline, trackv)) 		return -1;

	//Insert first video file there
	gchar *uri1 = gst_filename_to_uri("C:\\KSV1\\GuitarChops.mp4", NULL);
	GESUriClip *src1 = ges_uri_clip_new(uri1);
	g_assert(src1);
	g_free(uri1);
	g_object_set(src1, "start", 0, "duration", 30 * GST_SECOND, NULL);
	ges_layer_add_clip(layer1, (GESClip *)src1);


	//Insert some png image on top of the video
	gchar *uri_png = gst_filename_to_uri("C:\\KSV1\\overlay1.png", NULL);
	GESUriClip *src_png = ges_uri_clip_new(uri_png);
	ges_uri_clip_set_is_image(src_png, true);
	g_free(uri_png);
	g_object_set(src_png, "start", 10 * GST_SECOND + 1, "in-point", 0,
		"duration", 8 * GST_SECOND + 1, NULL);
	ges_layer_add_clip(layerImg1, GES_CLIP(src_png));
	uri_png = gst_filename_to_uri("C:\\KSV1\\overlay2.png", NULL);
	src_png = ges_uri_clip_new(uri_png);
	ges_uri_clip_set_is_image(src_png, true);
	g_free(uri_png);
	g_object_set(src_png, "start", 10 * GST_SECOND + 1, "in-point", 0,
		"duration", 8 * GST_SECOND + 1, NULL);
	ges_layer_add_clip(layerImg2, GES_CLIP(src_png));
	uri_png = gst_filename_to_uri("C:\\KSV1\\overlay3.png", NULL);
	src_png = ges_uri_clip_new(uri_png);
	ges_uri_clip_set_is_image(src_png, true);
	g_free(uri_png);
	g_object_set(src_png, "start", 10 * GST_SECOND + 1, "in-point", 0,
		"duration", 8 * GST_SECOND + 1, NULL);
	ges_layer_add_clip(layerImg3, GES_CLIP(src_png));

and the seeking operation is done with:
		gst_element_seek(GST_ELEMENT(gesPipeline), 1.0, GST_FORMAT_TIME,
GST_SEEK_FLAG_ACCURATE, GST_SEEK_TYPE_SET, position, GST_SEEK_TYPE_NONE, 0);

Thanks,
Nelu



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


More information about the gstreamer-devel mailing list