Hi,<br>I'm new to gstreamer.<br>I'm trying to make a pipe "filesrc ! ffdemux... ! vaapidecode ! appsink" to obtain frame or texture id of accelerated video.<br>I have alredy made working code with vaapisink, but i have to somehow get frame or texture id, and not show the video (this woud be done in another part of application, using opengl, and showing with other media). I'm not even sure, that appsink is way to go, but this is the best I have found.<br>
To use appsink, I have set cap "video/x-vaapi-surface" and turned on "emit-signals". Flesrc have proper file location.<br>Elements links ok, but I get "Internal data stream error". Any help?<br>
<br>code fragment:<br><br>GstElement *source=gst_element_factory_make("filesrc","source";<br>GstElement *demuxer=gst_element_factory_make("ffdemux_mov_mp4_m4a_3gp_3g2_mj2","demuxer");<br>
GstElement *decoder=gst_element_factory_make("vaapidecode","decoder");<br>GstElement *sink=gst_element_factory_make("appsink","sink");<br>GstElement *pipeline; <br>pipeline = gst_pipeline_new ("mypipeline");<br>
<br>//setting values for appsink<br>GstCaps *cap = gst_caps_from_string("video/x-vaapi-surface");<br>gst_app_sink_set_caps((GstAppSink*) sink, cap);<br>g_object_set (G_OBJECT (sink, "emit-signals", true, NULL);<br>
<br>//file location for filesrc<br>g_object_set (G_OBJECT (filesrc, "location", filePath.toAscii().data(), NULL);<br> <br>//adding to bin<br>gst_bin_add (GST_BIN (pipeline), source);<br>gst_bin_add (GST_BIN (pipeline), demuxer);<br>
gst_bin_add (GST_BIN (pipeline), decoder);<br>gst_bin_add (GST_BIN (pipeline), sink);<br> <br>//linking<br>qDebug() << gst_element_link(source,demuxer);<br>qDebug() << gst_element_link(decoder,sink);<br>g_signal_connect (demuxer, "pad-added", G_CALLBACK (cb_new_pad), decoder); //linking demuxer with decoder<br>
<br><br><br>best regards,<br>Bober<br>