GES specify Clip starting?

killerrats koreysjunkmail at gmail.com
Thu Apr 30 23:35:26 UTC 2020


I am adding many videos that are a continuous playing because of recording
cameras. I was trying to trim down the first clip in the timeline. the code
i use to add to the layer. I tell it to start at zero for the first clip. I
hope i explained that good?

anyone have a better way to doing this?

I tried ges_clip_split() but it says out of bounds.

for example: the clip is 00:00:09.000 long. I set the clipStart to be
00:00:02.000.

bool AddingTracksWithLayer(std::string filePath, GESTrackType mediatype,
guint64 startPos, GstClockTime LengthOfVideo, GESLayer* layer, GstClockTime
clipStart)
{
	GError* error = NULL;
	GESAsset* asst = NULL;
	GESClip* clip = NULL;
	gchar* source;

	source = g_strdup_printf("%s", filePath.c_str());
	
	asst = GES_ASSET(ges_uri_clip_asset_request_sync(source, &error));

	if (asst == NULL)
	{
		std::cout << "create uri failed " << (error != NULL) ? error->message :
"";
		g_clear_error(&error);
		return false;
	}
	clip = ges_layer_add_asset(layer
		, asst
		, startPos*GST_SECOND
		, 0
		, LengthOfVideo
		, mediatype);
	gst_object_unref(asst);
	if(clipStart != GST_CLOCK_TIME_NONE)
	{
		GESClip* newClip = ges_clip_split(clip, clipStart);
		ges_layer_remove_clip(layer, newClip);
		ges_layer_remove_clip(layer, clip);
		ges_layer_add_clip(layer, clip);
	}
	if (mediatype == GES_TRACK_TYPE_VIDEO)
		check_frame_positionner_size(clip,
std::stoi(std::to_string(this->aRenderWidth)),
std::stoi(std::to_string(this->aRenderHeight)));

	g_free(source);
	
	return true;
}



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


More information about the gstreamer-devel mailing list