I would like to stream web cam video to http web page. I know how to read from web cam and archive it to file.
But how to stream via web. What is the pipeline for that?
Use hlssink element from gst-plugins-bad:
gst-launch-1.0 videotestsrc is-live=true ! x264enc ! mpegtsmux ! hlssink
It will generate playlist and segments files. You need to provide HTTP access to these files, you can use any webserver, nginx or Apache, for example.
You can tweak hlssink's parameters to specify target location, segments count, etc. All options can be listed with:
gst-inspect-1.0 hlssink
If you need better low-level control, you'd better create your own web server with libsoup, manually split MPEG-TS into segments and add your own playlist endpoint.
Related
I can't figure out how to call rtsp methods with headers, for understanding:
I have an rtsp player on qt, I want to add the rtsp playback speed functionality, many vendors do this by sending a PLAY request with a Speed header,
but I don't understand how I can send this request from gstreamer.
You set playback rate for the pipeline via a GstSegemnt. E.g. when issueing a seek command. See https://gstreamer.freedesktop.org/documentation/gstreamer/gstsegment.html#GstSegment.
rtspsrc should then take care of sending the required header info to the RTSP server when initiating the session.
I`m using Gstreamer to reach rtsp stream. When i use it with internet connection and with my lan - its ok, when i lost lan connection. But when i use it without internet connection, all my program just freeze for 20s.
I have already tried to change all timeout var - it doesnt work!
Pipeline: s = “rtspsrc protocols=tcp location=” + s + " latency=0 tcp-timeout=1 buffer-mode=1 ! queue ! rtph264depay ! h264parse ! decodebin ! videoconvert ! videorate ! video/x-raw,framerate=25/1 ! appsink";
What should i do?
If the source of your rtsp stream is hosted on your lan then your rtsp source may require a internet connection to operate. Some of the cheaper IP cameras require a constant connection the internet to operate.
Your gstreamer pipeline looks okay.
you can try the following commands to rule out that your pipeline is the problem:
gst-discoverer-1.0 <source_uri>
and
gst-play-1.0 <source_uri>
gst-discoverer-1.0 will tell you information about the source, you should run it while you are connected to the internet, then disconnect from the internet and run it again to see if there are any changes.
gst-play-1.0 will automagically create the correct pipeline and display the video to your monitor.
I want to be able to request my RTSP server (gst-rtsp-server) for sending an h264 keyframe from the client side (rtspsrc). From the docs it should be possible but I couldn't get it to work.
Can anyone share a short snippet for how it's done?
Thank you
Hey Guys
I have one ubuntu machine with gstreamer version 1.8.3 and one arm device with gstreamer version 1.4.4, if I try to use the rtspsrc proxy setting on an gst-launch. I have the same mem allocation error on both devices.
I want to test if is possible to play the axis camera stream over an HTTP tunnel that is described in the axis camera manual as:
RTSP can be tunnelled over HTTP. This might prove necessary in order
to pass firewalls etc. To tunnel RTSP over HTTP, two sessions are set
up; one GET (for command replies and stream data) and one POST (for
commands). RTSP commands sent on the POST connection are base64
encoded, but the replies on the GET connection are in plain text. To
bind the two sessions together the Axis product needs a unique ID
(conveyed in the x-sessioncookie header). The GET and POST requests
are accepted on both the HTTP port (default 80) and the RTSP server
port (default 554).
I see at the rtspsrc there is a proxy settings for HTTP tunneling, i dont know if it works, or if I am on the wrong way.
To get forward on this task i would testing this proxy propertie, but if i start the gst-launch I have this mem alloc error.
Pipeline:
gst-launch-1.0 rtspsrc location="rtsp://root:1qay2wsx#192.168.1.211/axis-media/media.amp" proxy="http://root:1qay2wsx#192.168.1.211/axis-media/media.amp" ! rtph264depay! h264parse ! decodebin ! autovideosink
Error:
(gst-launch-1.0:15450): GLib-ERROR **: /build/glib2.0-prJhLS/glib2.0-2.48.2/./glib/gmem.c:100: failed to allocate 18446744073709551614 bytes
I hope anybody can help me, and thanks for your help guys.
BR Christoph
I would like to make of some sort of a streaming server. I would like it to receive RTSP streams over the net from live streams (e.g. webcam, ipcam, etc.) then broadcast that same stream on my local network using a different URL. I know gstreamer can do it quite well but I don't know how. I'm quite confused with the way the documentation is written. Can somebody help me?
If you would like to retransmit the video streams using RTSP as well, you can use GStreamer RTSP Server. There is a lot of examples on the Internet how to use it. The best source of the examples is the gst-rtsp-server's examples directory:
http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/tree/examples
As you want to retransmit existing RTSP streams, you'll need to use the rtspsrc element for reception of the remote streams.
I think you are looking for something like this: https://github.com/jayridge/rtsprelay. It configures one rtsp server to receive clients on two urls with a record link and a play link.
This example uses a dynamic form:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1454
rtsp://server/path?uri=encoded-URI
you HTML encode the destination in URI form and add a path where it should register this camera to. The first time you connect; it will take some time, after that; the sessions are re-used.