[gst-devel] How can I get full information about a media file?

wl2776 wl2776 at gmail.com
Tue Mar 30 17:11:04 CEST 2010


I need to know the number of streams in a file (video, audio, subtitles,
etc).
How can I do this?

typefind element returns something simple and generic, like video/x-msvideo,
or "video/mpeg, systemstream=(boolean)true, mpegversion=(int)2"

I tried to set up a pipeline: filesrc ! decodebin2 ! fakesink, but fakesink
is not linked, and decodebin2 doesn't construct the same complex pipeline,
like it did while included in the playbin2.

My code is the following:

GstElement *bin = gst_pipeline_new("playbin");
GstElement *filesrc = gst_element_factory_make("filesrc","filesrc");
g_object_set(G_OBJECT(filesrc),"location",g_convert(filename,-1,"UTF-8","CP1251",NULL,NULL,NULL),NULL);
GstElement *decodebin2 = gst_element_factory_make("decodebin2","decodebin");
GstElement *sink = gst_element_factory_make("fakesink","sink");
gst_bin_add_many(GST_BIN(bin),filesrc,decodebin2,sink,NULL);
gst_element_link_many(filesrc,decodebin2,sink,NULL);
GstElement *bus = (GstElement
*)gst_pipeline_get_bus(GST_PIPELINE(m_player));
gst_bus_set_sync_handler (GST_BUS(bus),
(GstBusSyncHandler)gst_bus_sync_handler, this);
gst_bus_add_watch (GST_BUS(bus), bus_call, this);
gst_object_unref(bus);

gst_element_set_state(GST_ELEMENT(bin),GST_STATE_PLAYING);

GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(bin),GST_DEBUG_GRAPH_SHOW_ALL,"decodebin");
gst_element_set_state(GST_ELEMENT(bin),GST_STATE_NULL);
gst_object_unref(bin);

The resulting dot file is this (50kb): 
http://n4.nabble.com/file/n1745331/decodebin.png decodebin.png 
However, when I create a playbin2, the resutling dot file is this (500kb): 
http://n4.nabble.com/file/n1745331/player-full.png player-full.png 

Apparently, decodebin2 instance in the playbin is much more complex.
What am I doing wrong?

In order to save people's traffic, original dot files are here:
decodebin.dot (3kb)  http://n4.nabble.com/file/n1745331/decodebin.dot
decodebin.dot  and playbin2.dot (22kb): 
http://n4.nabble.com/file/n1745331/player.dot player.dot 
-- 
View this message in context: http://n4.nabble.com/How-can-I-get-full-information-about-a-media-file-tp1745331p1745331.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list