access camera with assigned IP address

Manir manir_malla at hotmail.com
Mon May 12 17:40:42 PDT 2014


Hi,
It still did not work. Looks like it does not like gst-launch.
All I am trying to do is to open a webpage (IP address) of a camera.
I am not able to do so far. 

sample code:

#include <gst/gst.h>

int main(int argc, char *argv[]) {
  GstElement *pipeline;
   GstBus *bus;
  GstMessage *msg;
 
//  /* Initialize GStreamer */
  gst_init (&argc, &argv);

 // data.rtspsrc = gst_element_factory_make("rtspsrc",NULL);
//  /* Build the pipeline */
  
  pipeline = gst_parse_launch ("playbin2 uri=rtsp://172.31.11.141/axis-media/media.amp?videocodec=h264", NULL);
  //pipeline = gst_parse_launch ("playbin2 uri=rtsp://172.31.11.141:8554", NULL);
  //pipeline = "uri=rtsp://172.31.11.141/axis-media/media.amp?videocodec=h264";
   //g_object_set( pipeline, "location", "rtsp://172.31.11.145/?h26x=4 &inst=2", "latency", 0, "buffer-mode", 0, "debug", FALSE, "rtp-blocksize", 65536, NULL);
 
  //gst-launch rtspsrc location=rtsp://$RTSP_IP/test ! rtph264depay ! ffdec_h264 ! xvimagesink sync=false
  //gst_parse_launch rtspsrc location= rtsp://172.31.11.141/test ! rtph264depay ! ffdec_h264 ! xvimagesink sync=false

//  
//  /* Start playing */
  gst_element_set_state (pipeline, GST_STATE_PLAYING);
//  
//  /* Wait until error or EOS */
  bus = gst_element_get_bus (pipeline);
  msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_EOS);
//  
//  /* Free resources */
  if (msg != NULL)
    gst_message_unref (msg);
  gst_object_unref (bus);
  gst_element_set_state (pipeline, GST_STATE_NULL);
  gst_object_unref (pipeline);
  system("PAUSE");
  return 0;
}

Any help will be appreciated.
regards
..manny

> Subject: Re: access camera with assigned IP address
> From: tim at centricular.com
> To: gstreamer-devel at lists.freedesktop.org
> Date: Sat, 10 May 2014 12:34:05 +0100
> 
> On Fri, 2014-05-09 at 20:44 -0700, Manir wrote:
> 
> Hi,
> 
> > I am new to gstreamer and trying to develop live video streaming
> > application with gstreamer 1.2.4 and BOSCH DINION 1080P HDR camera.
> > I have installed the camera and already accessed through browser using
> > its camera's default IP address (192.168.0.1).
> > All I am trying to do is access or connect to that IP address and see
> > or play the live video. So I used one of basic tutorial programme with
> > modification
> > to achieve that but it is not working at all.
> > I guess I just do not know how to create "pipeline" with IP address
> > for live video. 
> > I will appreciate any help to achieve this goal. 
> 
> Maybe try with gst-launch-1.0 first. Does this work:
> 
>  gst-launch-1.0 playbin uri=rtsp://...
> 
> Note that if you're using 1.x it should be 'playbin', not 'playbin2'.
> 
> Cheer
>  -Tim
> 
> > Best regards
> > manny..
> > Costa Mesa, CA
> > 
> > My code sample as below: (Pls help to access camera with assigned IP
> > address. :)
> > 
> > #include <gst/gst.h>
> > // 
> > int main(int argc, char *argv[]) {
> >   GstElement *pipeline;
> >   //GstElement *rtspsrc;
> >   GstBus *bus;
> >   GstMessage *msg;
> > //  
> > //  /* Initialize GStreamer */
> >   gst_init (&argc, &argv);
> > //  
> >  // data.rtspsrc = gst_element_factory_make("rtspsrc",NULL);
> > //  /* Build the pipeline */
> > 
> >    g_object_set( pipeline, "location", "rtsp://172.31.11.145/?h26x=4
> > &inst=2", "latency", 0, "buffer-mode", 0, "debug", FALSE,
> > "rtp-blocksize", 65536, NULL);
> > 
> >   //pipeline = gst_parse_launch ("playbin2
> > uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
> >  
> >    //pipeline =
> > "uri=rtsp://172.31.11.141/axis-media/media.amp?videocodec=h264";
> >   //pipeline = gst_element_factory_make("rtspsrc", NULL);
> >  
> >   //pipeline = gst_parse_launch ("playbin2
> > rtsp=rtsp://172.31.11.145/?h26x=4", NULL);
> >   //gst-launch rtspsrc location=rtsp://$RTSP_IP/test ! rtph264depay !
> > ffdec_h264 ! xvimagesink sync=false
> >   //gst_parse_launch rtspsrc location= rtsp://172.31.11.141/test !
> > rtph264depay ! ffdec_h264 ! xvimagesink sync=false
> > 
> > //  
> > //  /* Start playing */
> >   gst_element_set_state (pipeline, GST_STATE_PLAYING);
> > //  
> > //  /* Wait until error or EOS */
> >   bus = gst_element_get_bus (pipeline);
> >   msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
> > GST_MESSAGE_EOS);
> > //  
> > //  /* Free resources */
> >   if (msg != NULL)
> >     gst_message_unref (msg);
> >   gst_object_unref (bus);
> >   gst_element_set_state (pipeline, GST_STATE_NULL);
> >   gst_object_unref (pipeline);
> >   system("PAUSE");
> >   return 0;
> > }
> > 
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 
> -- 
> Tim Müller, Centricular Ltd - http://www.centricular.com
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140512/9273ee25/attachment.html>


More information about the gstreamer-devel mailing list