Network streaming of two back to back videos

suresh.udipi at wipro.com suresh.udipi at wipro.com
Wed Feb 6 00:06:02 PST 2013


Hi,

    writing a sample pro gramme(server/client) to run two videos back to back using g_main_loop

    I have created a pipeline to encode covert into mpegts  and dump it in udpsink.

    Iam able to stream one video properly.

    will be waiting for EOS in a call back function for (gst_bus_watch) once i get the EOS messaege
    will quit the loop.

    Again change the uri properites and try to stream the second video. But the seconde video
   doesnot stream. Bus will give second EOS message without streaming...

     Code sninppet for the same server side to stream (push) two video data into udpsrc.
  ----------------------------------------------------------------------------------------
    ....................................................................................
     bus = gst_element_get_bus (data.pipeline);
     gst_bus_add_watch (bus, (GstBusFunc)handle_message, &data);

    /* Start playing */
    ret = gst_element_set_state (data.pipeline, GST_STATE_PLAYING);
    if (ret == GST_STATE_CHANGE_FAILURE) {
        g_printerr ("Unable to set the pipeline to the playing state.\n");
        gst_object_unref (data.pipeline);
        return -1;
    }


     data.main_loop = g_main_loop_new (NULL, FALSE);
     g_main_loop_run (data.main_loop);

   /***AFTER the FIRST STREAMING IS OVER****/



     gst_element_set_state (data.pipeline, GST_STATE_READY);

        g_object_set (data.source, "uri", "file:///home/SharkTaleHD.divx", NULL);
        g_print("going to playing state\n");

        ret= gst_element_set_state (data.pipeline, GST_STATE_PLAYING);
        if (ret == GST_STATE_CHANGE_FAILURE) {
            g_printerr ("Unable to set the pipeline to the playing state.\n");
            gst_object_unref (data.pipeline);
            return -1;
        }

     g_main_loop_run (data.main_loop);



-----------------------------------------------------------------------------------------------



Thanks and Regards
Suresh

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130206/8ea61e72/attachment.html>


More information about the gstreamer-devel mailing list