<div dir="ltr">Enable logging and see where the problem lies. export GST_DEBUG=*:3,GST_ELEMENT:5 is a good start. Then, see what you get and make adjustments. This sounds like a caps negiotiation issue.<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, May 21, 2014 at 10:35 AM, metind <span dir="ltr"><<a href="mailto:metin.duman@arcelik.com" target="_blank">metin.duman@arcelik.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all,<br>
<br>
I am using gstream 0.36 version in ubuntu linux and wrote server and client<br>
applications. I used for server part;<br>
gst-launch videotestsrc ! ffmpegcolorspace ! vp8enc ! queue2 ! mux.<br>
audiotestsrc ! audioconvert ! vorbisenc ! queue2 ! mux. webmmux name=mux<br>
streamable=true ! tcpserversink port=9002<br>
and for client part;<br>
gst-launch tcpclientsrc host=192.168.32.134 port=9002 ! matroskademux name=d<br>
d. ! queue2 ! vp8dec ! ffmpegcolorspace ! autovideosink d. ! queue2 !<br>
vorbisdec ! audioconvert ! audioresample ! alsasink sync=true<br>
<br>
Also i send the source codes. When i run server and client parts, i get an<br>
error for client part as;<br>
Running...<br>
Error: Internal data flow error.<br>
Returned, stopping playback<br>
Deleting pipeline<br>
I couldnt find any solution about it and dont understand where i do any<br>
mistake. Could you pls help me about this subject.<br>
<br>
/*********SERVER.C***********/<br>
#define HOST "192.168.32.134"<br>
#define PORT 9002<br>
<br>
#include <gst/gst.h><br>
#include <glib.h><br>
<br>
static gboolean<br>
bus_call (GstBus *bus, GstMessage *msg, gpointer data)<br>
{<br>
GMainLoop *loop = (GMainLoop *) data;<br>
<br>
switch (GST_MESSAGE_TYPE (msg)) {<br>
<br>
case GST_MESSAGE_EOS:<br>
g_print ("End of stream\n");<br>
g_main_loop_quit (loop);<br>
break;<br>
<br>
case GST_MESSAGE_ERROR: {<br>
gchar *debug;<br>
GError *error;<br>
<br>
gst_message_parse_error (msg, &error, &debug);<br>
g_free (debug);<br>
<br>
g_printerr ("Error: %s\n", error->message);<br>
g_error_free (error);<br>
<br>
g_main_loop_quit (loop);<br>
break;<br>
}<br>
default:<br>
break;<br>
}<br>
<br>
return TRUE;<br>
}<br>
<br>
int<br>
main (int argc, char *argv[])<br>
{<br>
GMainLoop *loop;<br>
<br>
GstElement *pipeline, *videosrc, *colorspace, *videoenc,<br>
*videoq, *audiosrc, *conv, *audioenc, *audioq, *muxer, *sink;<br>
<br>
GstBus *bus;<br>
<br>
/* Initialisation */<br>
gst_init (&argc, &argv);<br>
<br>
loop = g_main_loop_new (NULL, FALSE);<br>
<br>
/* Check input arguments */<br>
if (argc != 2) {<br>
g_printerr ("Usage: %s <port number>\n", argv[0]);<br>
return -1;<br>
}<br>
<br>
/* Create gstreamer elements */<br>
pipeline = gst_pipeline_new ("audio-player");<br>
videosrc = gst_element_factory_make ("videotestsrc", "videosrc");<br>
colorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace");<br>
videoenc = gst_element_factory_make ("vp8enc", "videoenc");<br>
videoq = gst_element_factory_make ("queue2", "videoq");<br>
audiosrc = gst_element_factory_make ("audiotestsrc", "audiosrc");<br>
conv = gst_element_factory_make ("audioconvert", "converter");<br>
audioenc = gst_element_factory_make ("vorbisenc", "audioenc");<br>
audioq = gst_element_factory_make ("queue2", "audioq");<br>
muxer = gst_element_factory_make ("webmmux", "mux");<br>
sink = gst_element_factory_make ("tcpserversink", "sink");<br>
<br>
if (!pipeline || !videosrc || !colorspace || !videoenc<br>
|| !videoq || !audiosrc || !conv || !audioenc || !audioq<br>
|| !muxer || !sink) {<br>
g_printerr ("One element could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
<br>
/* Set up the pipeline */<br>
<br>
/* we set the port number to the sink element */<br>
g_object_set (G_OBJECT (sink), "port", atoi(argv[1]),<br>
"host", /*"localhost"*/HOST, NULL);<br>
<br>
/* set the properties of other elements */<br>
//g_object_set (G_OBJECT (videosrc), "horizontal-speed", 1, NULL);<br>
//g_object_set (G_OBJECT (videosrc), "is-live", 1, NULL);<br>
//g_object_set (G_OBJECT (videoenc), "speed", 2, NULL);<br>
//g_object_set (G_OBJECT (audiosrc), "is-live", 1, NULL);<br>
g_object_set (G_OBJECT (muxer), "streamable", 1, NULL);<br>
<br>
/* we add a message handler */<br>
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>
gst_bus_add_watch (bus, bus_call, loop);<br>
gst_object_unref (bus);<br>
<br>
/* we add all elements into the pipeline */<br>
gst_bin_add_many (GST_BIN (pipeline),<br>
videosrc, colorspace, videoenc, videoq, audiosrc, conv,<br>
audioenc, audioq, muxer, sink, NULL);<br>
<br>
/* we link the elements together */<br>
gst_element_link_many (videosrc, colorspace, videoenc,<br>
videoq, muxer, NULL);<br>
gst_element_link_many (audiosrc, conv, audioenc, audioq,<br>
muxer, NULL);<br>
gst_element_link(muxer, sink);<br>
<br>
/* Set the pipeline to "playing" state*/<br>
g_print ("Streaming to port: %s\n", argv[1]);<br>
gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<br>
/* Iterate */<br>
g_print ("Running...\n");<br>
g_main_loop_run (loop);<br>
<br>
/* Out of the main loop, clean up nicely */<br>
g_print ("Returned, stopping playback\n");<br>
gst_element_set_state (pipeline, GST_STATE_NULL);<br>
<br>
g_print ("Deleting pipeline\n");<br>
gst_object_unref (GST_OBJECT (pipeline));<br>
<br>
return 0;<br>
}<br>
<br>
<br>
/************CLIENT.C**********/<br>
<br>
#define HOST "192.168.32.134"<br>
#define PORT 9002<br>
<br>
#include <gst/gst.h><br>
#include <glib.h><br>
<br>
static gboolean<br>
bus_call (GstBus *bus, GstMessage *msg, gpointer data)<br>
{<br>
GMainLoop *loop = (GMainLoop *) data;<br>
<br>
switch (GST_MESSAGE_TYPE (msg)) {<br>
<br>
case GST_MESSAGE_EOS:<br>
g_print ("End of stream\n");<br>
g_main_loop_quit (loop);<br>
break;<br>
<br>
case GST_MESSAGE_ERROR: {<br>
gchar *debug;<br>
GError *error;<br>
<br>
gst_message_parse_error (msg, &error, &debug);<br>
g_free (debug);<br>
<br>
g_printerr ("Error: %s\n", error->message);<br>
g_error_free (error);<br>
<br>
g_main_loop_quit (loop);<br>
break;<br>
}<br>
default:<br>
break;<br>
}<br>
<br>
return TRUE;<br>
}<br>
<br>
int<br>
main (int argc, char *argv[])<br>
{<br>
GMainLoop *loop;<br>
<br>
GstElement *pipeline, *colorspace, *videodec,<br>
*videoq, *conv, *audiodec, *audioq, *demuxer,<br>
*source,*sink,*resample,*videosink;<br>
<br>
GstBus *bus;<br>
<br>
/* Initialisation */<br>
gst_init (&argc, &argv);<br>
<br>
loop = g_main_loop_new (NULL, FALSE);<br>
<br>
/* Check input arguments */<br>
if (argc != 2) {<br>
g_printerr ("Usage: %s <port number>\n", argv[0]);<br>
return -1;<br>
}<br>
<br>
<br>
<br>
/* Create gstreamer elements */<br>
pipeline = gst_pipeline_new ("audio-player");<br>
if (!pipeline)<br>
{<br>
g_printerr ("pipeline could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
colorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace");<br>
if (!colorspace)<br>
{<br>
g_printerr ("colorspace could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
videodec = gst_element_factory_make ("vp8dec", "videodec");<br>
if (!videodec)<br>
{<br>
g_printerr ("videodec could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
videoq = gst_element_factory_make ("queue2", "videoq");<br>
if (!videoq)<br>
{<br>
g_printerr ("videoq could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
conv = gst_element_factory_make ("audioconvert", "converter");<br>
if (!conv)<br>
{<br>
g_printerr ("conv could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
audiodec = gst_element_factory_make ("vorbisdec", "audiodec");<br>
if (!audiodec)<br>
{<br>
g_printerr ("audiodec could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
audioq = gst_element_factory_make ("queue2", "audioq");<br>
if (!audioq)<br>
{<br>
g_printerr ("audioq could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
demuxer = gst_element_factory_make ("matroskademux", "demux");<br>
if (!demuxer)<br>
{<br>
g_printerr ("demuxer could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
source = gst_element_factory_make ("tcpclientsrc", "source");<br>
if (!source)<br>
{<br>
g_printerr ("source could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
resample = gst_element_factory_make ("audioresample", "resample");<br>
if (!resample)<br>
{<br>
g_printerr ("resample could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
sink = gst_element_factory_make ("alsasink", "sink");<br>
if (!sink)<br>
{<br>
g_printerr ("sink could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
videosink = gst_element_factory_make ("autovideosink", "videosink");<br>
if (!videosink)<br>
{<br>
g_printerr ("videosink could not be created. Exiting.\n");<br>
return -1;<br>
}<br>
/*<br>
if (!pipeline || !colorspace || !videodec<br>
|| !videoq || !conv || !audiodec || !audioq<br>
|| !demuxer || !sink || !source || !resample || !videosink) {<br>
g_printerr ("One element could not be created. Exiting.\n");<br>
return -1;<br>
}*/<br>
<br>
/* Set up the pipeline */<br>
<br>
/* we set the port number to the sink element */<br>
g_object_set (G_OBJECT (source), "port", atoi(argv[1]),<br>
"host", /*"localhost"*/HOST, NULL);<br>
<br>
/* set the properties of other elements */<br>
//g_object_set (G_OBJECT (videosrc), "horizontal-speed", 1, NULL);<br>
//g_object_set (G_OBJECT (videosrc), "is-live", 1, NULL);<br>
//g_object_set (G_OBJECT (videoenc), "speed", 2, NULL);<br>
//g_object_set (G_OBJECT (audiosrc), "is-live", 1, NULL);<br>
//g_object_set (G_OBJECT (muxer), "streamable", 1, NULL);<br>
<br>
/* we add a message handler */<br>
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>
gst_bus_add_watch (bus, bus_call, loop);<br>
gst_object_unref (bus);<br>
<br>
/* we add all elements into the pipeline */<br>
gst_bin_add_many (GST_BIN (pipeline),<br>
colorspace, videodec, videoq, conv,<br>
audiodec, audioq, demuxer, source,sink,resample, NULL);<br>
<br>
<br>
/* we link the elements together */<br>
gst_element_link(source, demuxer);<br>
gst_element_link_many (demuxer,videoq,videodec, colorspace,<br>
videosink,NULL);<br>
gst_element_link_many (demuxer, audioq,audiodec, conv, resample,sink,<br>
NULL);<br>
<br>
<br>
/* Set the pipeline to "playing" state*/<br>
g_print ("Streaming to port: %s\n", argv[1]);<br>
gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<br>
/* Iterate */<br>
g_print ("Running...\n");<br>
g_main_loop_run (loop);<br>
<br>
/* Out of the main loop, clean up nicely */<br>
g_print ("Returned, stopping playback\n");<br>
gst_element_set_state (pipeline, GST_STATE_NULL);<br>
<br>
g_print ("Deleting pipeline\n");<br>
gst_object_unref (GST_OBJECT (pipeline));<br>
<br>
return 0;<br>
}<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/video-server-client-problem-tp4667078.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/video-server-client-problem-tp4667078.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>