【gstreamer】最简单的使用Gstreamer播放视频文件的代码

播放mp4文件

extern "C"
{
	#include <gst/gst.h>
}

gint main(int argc, char *argv[])
{
	gst_init(&argc, &argv);
	GstElement * pipeline0 = gst_parse_launch("filesrc location = e:/silent_sheep.mp4 ! qtdemux ! queue ! decodebin ! autovideosink", NULL);
	gst_element_set_state(pipeline0, GST_STATE_PLAYING);
	g_main_loop_run(g_main_loop_new(NULL, FALSE));
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_23350817/article/details/103519017