【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;
}

發佈了118 篇原創文章 · 獲贊 21 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章