Gstreamer RTSP src element name
rajvik
kamdar.rajvi at gmail.com
Tue Jan 24 06:12:57 UTC 2017
Hi Tim thanks for the response.
1. I have added all the elements using gst_bin_add_many:
gst_bin_add_many(GST_BIN(audio), audioDepay, audioParse,
audioDecode,audioConvert, audioResample, audioSink, NULL);
2. I haven't used the pad-added signal, because I am confused as to how
shall I create a cb function, as I am already using rtspsrc name element.
Following the code snippet for audio and video queues:
* /*audio bin*/*
audio = gst_bin_get_by_name(GST_BIN(pipeline), "demux0");
audioQueue = gst_element_factory_make ("queuea", "queuea");
audioDepay = gst_element_factory_make ("rtpmp4gdepay",
"audio-depayer");
audioParse = gst_element_factory_make ("aacparse", "audio-parser");
audioDecode = gst_element_factory_make ("avdec_aac",
"audio-decoder");
audioConvert = gst_element_factory_make ("audioconvert", "aconv");
audioResample = gst_element_factory_make ("audioresample",
"audio-resample");
audioSink = gst_element_factory_make ("autoaudiosink", "audiosink");
*Failing here saying audio bin is NULL*
if (!audio || !audioDepay || !audioParse || !audioConvert ||
!audioResample || !audioSink)
{
g_printerr("Cannot create audio elements \n");
return 0;
}
gst_bin_add_many(GST_BIN(audio), audioDepay, audioParse,
audioDecode,audioConvert, audioResample, audioSink, NULL);
if (!gst_element_link_many(audioQueue, audioDepay, audioParse,
audioDecode, audioConvert, audioResample, audioSink, NULL))
{
g_printerr("Cannot link audioDepay and audioParse \n");
return 0;
}
* /*Video Bin */*
video = gst_bin_get_by_name(GST_BIN(pipeline), "demux.");;
videoQueue = gst_element_factory_make ("queuev", "queuev");
videoDepay= gst_element_factory_make ("rtph264depay",
"video-depayer");
videoParser = gst_element_factory_make ("h264parse",
"video-parser");
videoDecode = gst_element_factory_make ("omxh264dec",
"video-decoder");
videoConvert = gst_element_factory_make("videoconvert", "convert");
videoScale = gst_element_factory_make("videoscale", "video-scale");
videoSink = gst_element_factory_make("ximagesink", "video-sink");
capsFilter = gst_caps_new_simple("video/x-raw",
"width", G_TYPE_INT, 176,
"height", G_TYPE_INT, 144,
NULL);
if (!video || !videoQueue || !videoDepay || !videoParser ||
!videoDecode || !videoConvert || !videoScale || !videoSink || !capsFilter)
{
g_printerr("Cannot create video elements \n");
return 0;
}
/*Adding video elements to video bin */
gst_bin_add_many(GST_BIN(video),videoQueue, videoDepay, videoParser,
videoDecode, videoConvert, videoScale, videoSink, NULL);
/*Linking filter element to videoScale and videoSink */
link_ok = gst_element_link_filtered(videoScale,videoSink,
capsFilter);
gst_caps_unref (capsFilter);
if (!link_ok) {
g_warning ("Failed to link element1 and element2!");
}
/* Linking video elements internally */
if (!gst_element_link_many(videoQueue, videoDepay, videoParser,
videoDecode, videoConvert, NULL))
{
g_printerr("Cannot link videoDepay and videoParser \n");
return 0;
}
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-RTSP-src-element-name-tp4681595p4681607.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list