streaming into a web pag

classic Classic list List threaded Threaded
16 messages Options
R C
Reply | Threaded
Open this post in threaded view
|

streaming into a web pag

R C
Hello,

this  probably has been asked a million times before. 

I have a few IP cameras (onvif) that I can get stills and video out of with scriprts.

What I would want to do is  put a stream into a web page, html document. I'd prefer to used "something different" than  rtsp, to be used by the browser because rtsp seems to be blocked more and more (people watching baby monitors crashing networks).

Is there a guide/example that will show me how to set up gstreamer (gstreamer rtsp server) to do that and show it in flash player for example? (or anything else I can embed in a web page?)

thanks,

Ron

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

Michael Gruner
Hi Ron

Take a look at WebRTC, it has the features you want: NAT traversal (to avoid the “blocked” problem) and it works on most browsers out of the box.

https://opensource.com/article/19/1/gstreamer

Michael
www.ridgerun.com

> On May 1, 2019, at 10:43 AM, R C <[hidden email]> wrote:
>
> Hello,
>
> this  probably has been asked a million times before.  
>
> I have a few IP cameras (onvif) that I can get stills and video out of with scriprts.
>
> What I would want to do is  put a stream into a web page, html document. I'd prefer to used "something different" than  rtsp, to be used by the browser because rtsp seems to be blocked more and more (people watching baby monitors crashing networks).
>
> Is there a guide/example that will show me how to set up gstreamer (gstreamer rtsp server) to do that and show it in flash player for example? (or anything else I can embed in a web page?)
>
> thanks,
>
> Ron
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

R C
Hello Michael,

thanks for the quick reply.  I  did read some about WebRTC, from what I understand that also streams over the port httpd is running on?  The 'blocked' problem is not necessarilly a NAT issue, but some sites actively blocking 554, and the RTSP protocol. traffic on 80/443 is typically not, so that would be best.

Is there a (working) example somewhere on how to set  gstreamer/gstreamer-rtsp-sever up so that it converts a stream from an IP-camera (onvif) to a WebRTC stream that can be embedded?
(also, there would be multiple cameras/streams, but only one of them has to be 'active' at a time.)

thanks,

Ron

On Wed, May 1, 2019 at 10:47 AM Michael Gruner <[hidden email]> wrote:
Hi Ron

Take a look at WebRTC, it has the features you want: NAT traversal (to avoid the “blocked” problem) and it works on most browsers out of the box.

https://opensource.com/article/19/1/gstreamer

Michael
www.ridgerun.com

> On May 1, 2019, at 10:43 AM, R C <[hidden email]> wrote:
>
> Hello,
>
> this  probably has been asked a million times before. 
>
> I have a few IP cameras (onvif) that I can get stills and video out of with scriprts.
>
> What I would want to do is  put a stream into a web page, html document. I'd prefer to used "something different" than  rtsp, to be used by the browser because rtsp seems to be blocked more and more (people watching baby monitors crashing networks).
>
> Is there a guide/example that will show me how to set up gstreamer (gstreamer rtsp server) to do that and show it in flash player for example? (or anything else I can embed in a web page?)
>
> thanks,
>
> Ron
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

Michael Gruner
No, WebRTC doesn’t stream over http/https ports. WebRTC uses a protocol named ICE to automatically find open ports on both endpoints. It’s supposed to be “guaranteed” that a connection will always be made, unless you explicitly want to block WebRTC. Worst case scenario, the stream gets relayed through a third party server (unlike peer-to-peer that you’d expect). All this happens under the hoods. Take a look at:


As per the example, I think Kurento had this functionality, and it’s an open source implementation. 


Michael


On May 1, 2019, at 11:19 AM, R C <[hidden email]> wrote:

Hello Michael,

thanks for the quick reply.  I  did read some about WebRTC, from what I understand that also streams over the port httpd is running on?  The 'blocked' problem is not necessarilly a NAT issue, but some sites actively blocking 554, and the RTSP protocol. traffic on 80/443 is typically not, so that would be best.

Is there a (working) example somewhere on how to set  gstreamer/gstreamer-rtsp-sever up so that it converts a stream from an IP-camera (onvif) to a WebRTC stream that can be embedded?
(also, there would be multiple cameras/streams, but only one of them has to be 'active' at a time.)

thanks,

Ron

On Wed, May 1, 2019 at 10:47 AM Michael Gruner <[hidden email]> wrote:
Hi Ron

Take a look at WebRTC, it has the features you want: NAT traversal (to avoid the “blocked” problem) and it works on most browsers out of the box.

https://opensource.com/article/19/1/gstreamer

Michael
www.ridgerun.com

> On May 1, 2019, at 10:43 AM, R C <[hidden email]> wrote:
>
> Hello,
>
> this  probably has been asked a million times before. 
>
> I have a few IP cameras (onvif) that I can get stills and video out of with scriprts.
>
> What I would want to do is  put a stream into a web page, html document. I'd prefer to used "something different" than  rtsp, to be used by the browser because rtsp seems to be blocked more and more (people watching baby monitors crashing networks).
>
> Is there a guide/example that will show me how to set up gstreamer (gstreamer rtsp server) to do that and show it in flash player for example? (or anything else I can embed in a web page?)
>
> thanks,
>
> Ron
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

Ralf Sippl
Haven't tried Kurento, but Janus works fine with GStreamer and an OnVIF cam.
I just tried it with my IP camera, here's the pipeline I'm using with the
Janus streaming demo:

gst-launch-1.0 uridecodebin
uri=rtsp://user:password@server:port/your-cams-url name=d ! videoconvert !
vp8enc deadline=1 ! rtpvp8pay ! queue !
application/x-rtp,media=video,encoding-name=VP8,payload=97 ! udpsink
host=127.0.0.1 port=5004 d. ! audioconvert ! audioresample ! queue ! opusenc
! rtpopuspay ! queue !
application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! udpsink
host=127.0.0.1 port=5002

You can see the grass moving and hear the birds singing, simultaneously in
several tabs in Chromium and Firefox at the same time :) latency and frame
rate are fine.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

Nirbheek Chauhan
Please note that if you want a fully-integrated and fully-open-source
mechanism to do WebRTC with GStreamer, you will want the webrtcbin
element added in GStreamer 1.14:

http://blog.nirbheek.in/2018/02/gstreamer-webrtc.html
https://gstreamer.freedesktop.org/releases/1.14/

A complete example of how to stream video from GStreamer to the
browser including the HTML/JS required to do so can be found here:

https://github.com/centricular/gstwebrtc-demos/

More generic examples can be found here:

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/tree/master/tests/examples/webrtc

Cheers,
Nirbheek

On Mon, May 6, 2019 at 12:55 PM gripsynth <[hidden email]> wrote:

>
> Haven't tried Kurento, but Janus works fine with GStreamer and an OnVIF cam.
> I just tried it with my IP camera, here's the pipeline I'm using with the
> Janus streaming demo:
>
> gst-launch-1.0 uridecodebin
> uri=rtsp://user:password@server:port/your-cams-url name=d ! videoconvert !
> vp8enc deadline=1 ! rtpvp8pay ! queue !
> application/x-rtp,media=video,encoding-name=VP8,payload=97 ! udpsink
> host=127.0.0.1 port=5004 d. ! audioconvert ! audioresample ! queue ! opusenc
> ! rtpopuspay ! queue !
> application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! udpsink
> host=127.0.0.1 port=5002
>
> You can see the grass moving and hear the birds singing, simultaneously in
> several tabs in Chromium and Firefox at the same time :) latency and frame
> rate are fine.
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

R C
In reply to this post by Ralf Sippl
I'll try that.   btw:  I am running Centos (6 and 7 on different machines).  can gstreamer-1.0 be installed next to  gstreamer?  I once tried to uninstall gstreamer (VLC gave warning that gstreamer needed to be replaced)...  that didn't end well

I'll that that cmd line with those options later

thanks!

Ron

On Mon, May 6, 2019 at 1:14 AM gripsynth <[hidden email]> wrote:
Haven't tried Kurento, but Janus works fine with GStreamer and an OnVIF cam.
I just tried it with my IP camera, here's the pipeline I'm using with the
Janus streaming demo:

gst-launch-1.0 uridecodebin
uri=rtsp://user:password@server:port/your-cams-url name=d ! videoconvert !
vp8enc deadline=1 ! rtpvp8pay ! queue !
application/x-rtp,media=video,encoding-name=VP8,payload=97 ! udpsink
host=127.0.0.1 port=5004 d. ! audioconvert ! audioresample ! queue ! opusenc
! rtpopuspay ! queue !
application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! udpsink
host=127.0.0.1 port=5002

You can see the grass moving and hear the birds singing, simultaneously in
several tabs in Chromium and Firefox at the same time :) latency and frame
rate are fine.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

R C
In reply to this post by Ralf Sippl

Hi Ralf,


it seems that is working,  (see attached/copied below)


I tried a few  HTML5 <video> tags,  but I didn't get that part right.

You have an example of that too?

Also, I noticed there are two streams created by gst-launch-1.0?



here's what I see:

[usr@box1 camera-img-d]# gst-launch-1.0 uridecodebin uri=<a class="moz-txt-link-freetext" href="rtsp://192.168.*.*:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream">rtsp://192.168.*.*:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream name=d ! videoconvert ! vp8enc deadline=1 ! rtpvp8pay ! queue ! application/x-rtp,media=video,encoding-name=VP8,payload=97 ! udpsink host=127.0.0.1 port=5004 d. ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay ! queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! udpsink host=127.0.0.1 port=5002
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/nouveau_drv_video.so
libva info: va_openDriver() returns -1
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/nouveau_drv_video.so
libva info: va_openDriver() returns -1
DtsGetHWFeatures: Create File Failed
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to <a class="moz-txt-link-freetext" href="rtsp://192.168.*.*:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream">rtsp://192.168.*.*:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (request) SETUP stream 1
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:48.260047767
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...






On 5/6/19 1:14 AM, gripsynth wrote:
Haven't tried Kurento, but Janus works fine with GStreamer and an OnVIF cam.
I just tried it with my IP camera, here's the pipeline I'm using with the
Janus streaming demo:

gst-launch-1.0 uridecodebin
uri=<a class="moz-txt-link-freetext" href="rtsp://user:password@server:port/your-cams-url">rtsp://user:password@server:port/your-cams-url name=d ! videoconvert !
vp8enc deadline=1 ! rtpvp8pay ! queue !
application/x-rtp,media=video,encoding-name=VP8,payload=97 ! udpsink
host=127.0.0.1 port=5004 d. ! audioconvert ! audioresample ! queue ! opusenc
! rtpopuspay ! queue !
application/x-rtp,media=audio,encoding-name=OPUS,payload=96 ! udpsink
host=127.0.0.1 port=5002

You can see the grass moving and hear the birds singing, simultaneously in
several tabs in Chromium and Firefox at the same time :) latency and frame
rate are fine.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

Ralf Sippl
Hi Ron,

if the pipeline works, you got the GStreamer part right. Of course there are
two streams, video and audio. Each is sent to a different UDP port.

Now you need to run the receiving part, i.e. Janus. The streaming demo
listens to the ports your pipeline sends to. This is obviously off-topic
here, use the Janus site, or contact me if that doesn't work.

You can use webrtcbin instead, as Nirbheek suggested, but I found it harder
to set up (you need to run the websocket part on your own), and it will be a
1-to-1 connection, so you can't use it for broadcast.

Ralf



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

Marc Leeman
I don't think you need to transcode, H.264 should also be supported by
the browsers.

On Tue, 7 May 2019 at 09:10, Ralf Sippl <[hidden email]> wrote:

>
> Hi Ron,
>
> if the pipeline works, you got the GStreamer part right. Of course there are
> two streams, video and audio. Each is sent to a different UDP port.
>
> Now you need to run the receiving part, i.e. Janus. The streaming demo
> listens to the ports your pipeline sends to. This is obviously off-topic
> here, use the Janus site, or contact me if that doesn't work.
>
> You can use webrtcbin instead, as Nirbheek suggested, but I found it harder
> to set up (you need to run the websocket part on your own), and it will be a
> 1-to-1 connection, so you can't use it for broadcast.
>
> Ralf
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



--
g. Marc
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

R C
In reply to this post by Ralf Sippl
Hmm,  I didn't count on that.     What I tried earlier was have vlc run, and have it serve on localhost on a port, vlc picked that up and browser did too, but poorly at that point.
like the other e-mail suggested, H.264 directly into a browser "a la"  the embedded video would just be pointed t by a URI   something like:  <video>url="localhost.localdomain:100001" content-type="mime-mpg4"</video>   don't remember the exact html text,  but it was something like that.

I want to display the video over HTTP, so webctl is not going to work for me.

On Tue, May 7, 2019 at 1:05 AM Ralf Sippl <[hidden email]> wrote:
Hi Ron,

if the pipeline works, you got the GStreamer part right. Of course there are
two streams, video and audio. Each is sent to a different UDP port.

Now you need to run the receiving part, i.e. Janus. The streaming demo
listens to the ports your pipeline sends to. This is obviously off-topic
here, use the Janus site, or contact me if that doesn't work.

You can use webrtcbin instead, as Nirbheek suggested, but I found it harder
to set up (you need to run the websocket part on your own), and it will be a
1-to-1 connection, so you can't use it for broadcast.

Ralf



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

R C
In reply to this post by Marc Leeman
Hello Marc,

that's what IU was kinda banking on;  use gstreamer  to pull/convert a stream from a camera, so that I could directly embed it in a html/web page and the video/stream would be transported over http.  I am not that worried about the sound, mostly the video stream.

So the stream that Ralf gave me seems to work/run, which is great (I just wish I understood the format and options in the cmd line better).

thanks,

Ron

On Tue, May 7, 2019 at 4:13 AM Marc Leeman <[hidden email]> wrote:
I don't think you need to transcode, H.264 should also be supported by
the browsers.

On Tue, 7 May 2019 at 09:10, Ralf Sippl <[hidden email]> wrote:
>
> Hi Ron,
>
> if the pipeline works, you got the GStreamer part right. Of course there are
> two streams, video and audio. Each is sent to a different UDP port.
>
> Now you need to run the receiving part, i.e. Janus. The streaming demo
> listens to the ports your pipeline sends to. This is obviously off-topic
> here, use the Janus site, or contact me if that doesn't work.
>
> You can use webrtcbin instead, as Nirbheek suggested, but I found it harder
> to set up (you need to run the websocket part on your own), and it will be a
> 1-to-1 connection, so you can't use it for broadcast.
>
> Ralf
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



--
g. Marc
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

R C
In reply to this post by Marc Leeman

Hello,


The cameras I have are Onvif 'capable' camera's and I have been poking around in one.

There are 3 profiles, but they are basically the same (different resolutions etc).

So from what I understand is that H.264 is supported by most browsers, so I assume that a stream/pipe should be able to be displayed in a web browser (firefox does), and there is no need to 'transcode' the stream(?).

I have no idea how to set up a stream/pipe, is there a write up? guide or so, so I can figure it out? (there seem to be a gazillion options/filters and have no idea  how to use them, nor what they do.

Below I pasted the 'VideoSourceConfiguration' for the first profile, and the URi/URL that it is on.

If anyone has any pointers how to create a gstreamer/gst-launch  stream/pipe, I'd appreciate that.


TIA,


Ron


URL/URi:

<tt:Uri><a class="moz-txt-link-freetext" href="rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream">rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream</tt:Uri>


Profile (partial):

        <tt:VideoSourceConfiguration token="000">
          <tt:Name>VideoS_000</tt:Name>
          <tt:UseCount>3</tt:UseCount>
          <tt:SourceToken>000</tt:SourceToken>
          <tt:Bounds height="1080" width="1920" y="0" x="0"></tt:Bounds>
        </tt:VideoSourceConfiguration>
        <tt:AudioSourceConfiguration token="000">
          <tt:Name>Audio_000</tt:Name>
          <tt:UseCount>2</tt:UseCount>
          <tt:SourceToken>000</tt:SourceToken>
        </tt:AudioSourceConfiguration>
        <tt:VideoEncoderConfiguration token="000">
          <tt:Name>VideoE_000</tt:Name>
          <tt:UseCount>1</tt:UseCount>
          <tt:Encoding>H264</tt:Encoding>
          <tt:Resolution>
            <tt:Width>1280</tt:Width>
            <tt:Height>720</tt:Height>
          </tt:Resolution>
          <tt:Quality>4</tt:Quality>
          <tt:RateControl>
            <tt:FrameRateLimit>6</tt:FrameRateLimit>
            <tt:EncodingInterval>1</tt:EncodingInterval>
            <tt:BitrateLimit>911</tt:BitrateLimit>
          </tt:RateControl>
          <tt:H264>
            <tt:GovLength>2</tt:GovLength>
            <tt:H264Profile>High</tt:H264Profile>
          </tt:H264>
          <tt:Multicast>
            <tt:Address>
              <tt:Type>IPv4</tt:Type>
              <tt:IPv4Address>224.1.2.3</tt:IPv4Address>
            </tt:Address>
            <tt:Port>0</tt:Port>
            <tt:TTL>0</tt:TTL>
            <tt:AutoStart>false</tt:AutoStart>
          </tt:Multicast>
          <tt:SessionTimeout>PT10S</tt:SessionTimeout>
        </tt:VideoEncoderConfiguration>



On 5/7/19 4:13 AM, Marc Leeman wrote:
I don't think you need to transcode, H.264 should also be supported by
the browsers.

On Tue, 7 May 2019 at 09:10, Ralf Sippl [hidden email] wrote:
Hi Ron,

if the pipeline works, you got the GStreamer part right. Of course there are
two streams, video and audio. Each is sent to a different UDP port.

Now you need to run the receiving part, i.e. Janus. The streaming demo
listens to the ports your pipeline sends to. This is obviously off-topic
here, use the Janus site, or contact me if that doesn't work.

You can use webrtcbin instead, as Nirbheek suggested, but I found it harder
to set up (you need to run the websocket part on your own), and it will be a
1-to-1 connection, so you can't use it for broadcast.

Ralf



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

R C
In reply to this post by Marc Leeman

So I manages to get some streaming going, but using ffmpeg but want to use gstreamer really  (ffmpeg creates a bunch of files and the player somehow starts 3 minutes after the current time.

So I would like to accomplish the same as I have working with ffmpeg:


Here is what I am using.

this is the html:

<!DOCTYPE html>
<html>

<header>

<title>Live Cam</title>

<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>

<script>
function hlsStart() {
   if (Hls.isSupported()) {
      var video = document.getElementById('video');
      var hls = new Hls();

      // bind them together
      hls.attachMedia(video);
      hls.on(Hls.Events.MEDIA_ATTACHED, function () {
         console.log("video and hls.js are now bound together !");
         hls.loadSource("http://zoneminder.localdomain/IP-Cameras/stream/test-camera/mystream.m3u8");
         hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
            console.log("manifest loaded, found " + data.levels.length + " quality level");
            });
         });
      }
   }
</script>
</header>
<body onload="hlsStart();">
<video id="video" autoplay="true" controls="controls"></video>
</body>
</html>



and this is what I am doing with ffmpeg:

ffmpeg -i <a class="moz-txt-link-rfc2396E" href="rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream">"rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream" -y -c:a aac -b:a 160000 -ac 2 -s 960x540 -c:v libx264 -b:v 800000 -hls_time 10 -hls_list_size 10 -start_number 1 mystream.m3u8


any suggestions?  (I probably need an Apache plugin, or something like that?)


thanks,


Ron



On 5/7/19 4:13 AM, Marc Leeman wrote:
I don't think you need to transcode, H.264 should also be supported by
the browsers.

On Tue, 7 May 2019 at 09:10, Ralf Sippl [hidden email] wrote:
Hi Ron,

if the pipeline works, you got the GStreamer part right. Of course there are
two streams, video and audio. Each is sent to a different UDP port.

Now you need to run the receiving part, i.e. Janus. The streaming demo
listens to the ports your pipeline sends to. This is obviously off-topic
here, use the Janus site, or contact me if that doesn't work.

You can use webrtcbin instead, as Nirbheek suggested, but I found it harder
to set up (you need to run the websocket part on your own), and it will be a
1-to-1 connection, so you can't use it for broadcast.

Ralf



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

Marc Leeman
Ah, but you're not using WebRTC now, you are using HLS.

HLS will create a bunch of small files in a TS container for the
browser to pick up from a web location.

If you want to recreate this with GStreamer, you can use the hlssink.

Just feed it a stream in a transport stream container and it will do
something similar.

If you drop the files in a location served by your webserver, you can
access it with a browser.


On Mon, 13 May 2019 at 06:55, R C <[hidden email]> wrote:

>
> So I manages to get some streaming going, but using ffmpeg but want to use gstreamer really  (ffmpeg creates a bunch of files and the player somehow starts 3 minutes after the current time.
>
> So I would like to accomplish the same as I have working with ffmpeg:
>
>
> Here is what I am using.
>
> this is the html:
>
> <!DOCTYPE html>
> <html>
>
> <header>
>
> <title>Live Cam</title>
>
> <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
>
> <script>
> function hlsStart() {
>    if (Hls.isSupported()) {
>       var video = document.getElementById('video');
>       var hls = new Hls();
>
>       // bind them together
>       hls.attachMedia(video);
>       hls.on(Hls.Events.MEDIA_ATTACHED, function () {
>          console.log("video and hls.js are now bound together !");
>          hls.loadSource("http://zoneminder.localdomain/IP-Cameras/stream/test-camera/mystream.m3u8");
>          hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
>             console.log("manifest loaded, found " + data.levels.length + " quality level");
>             });
>          });
>       }
>    }
> </script>
> </header>
> <body onload="hlsStart();">
> <video id="video" autoplay="true" controls="controls"></video>
> </body>
> </html>
>
>
>
> and this is what I am doing with ffmpeg:
>
> ffmpeg -i "rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream" -y -c:a aac -b:a 160000 -ac 2 -s 960x540 -c:v libx264 -b:v 800000 -hls_time 10 -hls_list_size 10 -start_number 1 mystream.m3u8
>
>
> any suggestions?  (I probably need an Apache plugin, or something like that?)
>
>
> thanks,
>
>
> Ron
>
>
>
> On 5/7/19 4:13 AM, Marc Leeman wrote:
>
> I don't think you need to transcode, H.264 should also be supported by
> the browsers.
>
> On Tue, 7 May 2019 at 09:10, Ralf Sippl <[hidden email]> wrote:
>
> Hi Ron,
>
> if the pipeline works, you got the GStreamer part right. Of course there are
> two streams, video and audio. Each is sent to a different UDP port.
>
> Now you need to run the receiving part, i.e. Janus. The streaming demo
> listens to the ports your pipeline sends to. This is obviously off-topic
> here, use the Janus site, or contact me if that doesn't work.
>
> You can use webrtcbin instead, as Nirbheek suggested, but I found it harder
> to set up (you need to run the websocket part on your own), and it will be a
> 1-to-1 connection, so you can't use it for broadcast.
>
> Ralf
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



--
g. Marc
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: streaming into a web pag

R C
well,  I was trying to get "something" in a page.   I am not that happy with using ffmpeg because it creates a bunch of files indeed and there is a delay of about a minute (might be great for streaming a movie or such).

I don't mind a delay of a few seconds, buffering etc, but a minute or two is not what I am looking for.
I did this ffmpeg html5/hls  trial to see if I could get at least something working in a browser.

I have been reading up a little, not pretending I understand everything.


So the mechanism (from what I read) is to set oup a stream/pipe with gstreamer/gst-launch  which connects to a camera and 'transcodes" the stream and  "dumps" it somewhere on a 'device'  (sink?).

So I guess I need to install an apache plugin or so to make that part work, or is there another way to do it? (or some dev device??)    From what I read there is something called a "souphttpclientsink", I also saw a hlssink mentioned (probably the same issues as I have now with fmpeg)  so I am wondering what 'sink' to use, and how if I want  the stream to be displayed in a webpage (I don't want the client/browser/player to connect to anything else then  http port 80).

thanks,

Ron




On Mon, May 13, 2019 at 12:50 AM Marc Leeman <[hidden email]> wrote:
Ah, but you're not using WebRTC now, you are using HLS.

HLS will create a bunch of small files in a TS container for the
browser to pick up from a web location.

If you want to recreate this with GStreamer, you can use the hlssink.

Just feed it a stream in a transport stream container and it will do
something similar.

If you drop the files in a location served by your webserver, you can
access it with a browser.


On Mon, 13 May 2019 at 06:55, R C <[hidden email]> wrote:
>
> So I manages to get some streaming going, but using ffmpeg but want to use gstreamer really  (ffmpeg creates a bunch of files and the player somehow starts 3 minutes after the current time.
>
> So I would like to accomplish the same as I have working with ffmpeg:
>
>
> Here is what I am using.
>
> this is the html:
>
> <!DOCTYPE html>
> <html>
>
> <header>
>
> <title>Live Cam</title>
>
> <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
>
> <script>
> function hlsStart() {
>    if (Hls.isSupported()) {
>       var video = document.getElementById('video');
>       var hls = new Hls();
>
>       // bind them together
>       hls.attachMedia(video);
>       hls.on(Hls.Events.MEDIA_ATTACHED, function () {
>          console.log("video and hls.js are now bound together !");
>          hls.loadSource("http://zoneminder.localdomain/IP-Cameras/stream/test-camera/mystream.m3u8");
>          hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {
>             console.log("manifest loaded, found " + data.levels.length + " quality level");
>             });
>          });
>       }
>    }
> </script>
> </header>
> <body onload="hlsStart();">
> <video id="video" autoplay="true" controls="controls"></video>
> </body>
> </html>
>
>
>
> and this is what I am doing with ffmpeg:
>
> ffmpeg -i "rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream" -y -c:a aac -b:a 160000 -ac 2 -s 960x540 -c:v libx264 -b:v 800000 -hls_time 10 -hls_list_size 10 -start_number 1 mystream.m3u8
>
>
> any suggestions?  (I probably need an Apache plugin, or something like that?)
>
>
> thanks,
>
>
> Ron
>
>
>
> On 5/7/19 4:13 AM, Marc Leeman wrote:
>
> I don't think you need to transcode, H.264 should also be supported by
> the browsers.
>
> On Tue, 7 May 2019 at 09:10, Ralf Sippl <[hidden email]> wrote:
>
> Hi Ron,
>
> if the pipeline works, you got the GStreamer part right. Of course there are
> two streams, video and audio. Each is sent to a different UDP port.
>
> Now you need to run the receiving part, i.e. Janus. The streaming demo
> listens to the ports your pipeline sends to. This is obviously off-topic
> here, use the Janus site, or contact me if that doesn't work.
>
> You can use webrtcbin instead, as Nirbheek suggested, but I found it harder
> to set up (you need to run the websocket part on your own), and it will be a
> 1-to-1 connection, so you can't use it for broadcast.
>
> Ralf
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



--
g. Marc
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel