access camera with assigned IP address

Manir manir_malla at hotmail.com
Tue May 13 18:31:29 PDT 2014


Hi Matthew and Tim,
I could finally get it working on the command line (as below).

gst-launch-1.0 playbin uri=rtsp://192.168.0.1/?h26x=4

[And video opens up in Gstreamer D3D video sink (internal window)]

Also I tried following codes in my program, there also it opened up the video when I ran the program in *.exe and debug mode.

//open
another stream for viewing jpeg

       GstElement *pipeline;

       pipeline = gst_parse_launch ("playbin uri=rtsp://192.168.0.1/?h26x=0", NULL);

       if (pipeline==NULL) g_print("Error
creating pipeline.\n");

       gst_element_set_state (pipeline, GST_STATE_PLAYING);

So far so good. 

cheers
...manny


> Date: Mon, 12 May 2014 18:04:02 -0700
> From: mbrush at codebrainz.ca
> To: gstreamer-devel at lists.freedesktop.org
> Subject: Re: access camera with assigned IP address
> 
> On 14-05-12 05:40 PM, Manir wrote:
> > 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.
> >
> 
> You could try to go into the camera's settings and double-check which 
> stream(s) are activated to ensure RTSP stream is on, that you're using 
> the correct address for that stream, and that there is no authentication 
> required. I wouldn't even write a single line of C code until you can 
> access it using gst-launch on the command line.
> 
> Cheers,
> Matthew Brush
> 
> > 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
> >   		 	   		
> >
> >
> >
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> >
> 
> _______________________________________________
> 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/20140513/cad5f048/attachment-0001.html>


More information about the gstreamer-devel mailing list