RTSP stream to webrtcbin

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

RTSP stream to webrtcbin

Ottawa Boy
Hi Nirbheek,

In your reply to Ivan in the comments section of your blog post, you mentioned that it should be possible to directly payload-encode an RTSP stream containing H264 frames into webrtcbin without having to first decode it and then re-encode it. I am interested in this exact scenario. I've tried the following pipeline but it doesn't show the video on the webpage. There is no error in the browser console either. Could you please take a look and let me know if there is something wrong with this pipeline?

gst_parse_launch("rtspsrc location=rtsp://10.51.52.115/h264 ! queue ! rtph264pay ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! webrtcbin name=sendrecv", &error);

Thanks!

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

Re: RTSP stream to webrtcbin

Matthew Waters
On 11/04/18 07:32, Ottawa Boy wrote:
Hi Nirbheek,

In your reply to Ivan in the comments section of your blog post, you mentioned that it should be possible to directly payload-encode an RTSP stream containing H264 frames into webrtcbin without having to first decode it and then re-encode it. I am interested in this exact scenario. I've tried the following pipeline but it doesn't show the video on the webpage. There is no error in the browser console either. Could you please take a look and let me know if there is something wrong with this pipeline?

gst_parse_launch("rtspsrc location=<a class="moz-txt-link-freetext" href="rtsp://">rtsp://10.51.52.115/h264 ! queue ! rtph264pay ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! webrtcbin name=sendrecv", &error);

You need to depayload after rtspsrc before you repayload again.

i.e. add a rtph264depay before rtph264pay.

Cheers
-Matt

Thanks!

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

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RTSP stream to webrtcbin

Ottawa Boy
Hi Matt,

Thanks for your reply. I tried the following pipeline as per your suggestion but the video still continues to allude me.

gst_parse_launch("rtspsrc location=rtsp://10.51.52.115/h264 ! rtph264depay ! rtph264pay ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! webrtcbin name=sendrecv", &error);

I also tried replacing rtspsrc with urisourcebin but that hasn't worked either.

gst_parse_launch("urisourcebin uri=rtsp://10.51.52.115/h264 ! rtph264depay ! rtph264pay ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! webrtcbin name=sendrecv", &error);

Do both of these pipelines look reasonable? Perhaps I missed some intermediate element/plugin.

The only way that I have managed to get video is to decode the H264 frames and re-encode them in H264 format, which is redundant and undesirable.

gst_parse_launch("rtspsrc location=rtsp://10.51.52.115/h264 ! rtph264depay ! h264parse ! decodebin ! videoconvert ! queue ! x264enc ! rtph264pay ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! webrtcbin name=sendrecv", &error);

Thanks!
Talha

On Wed, Apr 11, 2018 at 1:16 AM, Matthew Waters <[hidden email]> wrote:
On 11/04/18 07:32, Ottawa Boy wrote:
Hi Nirbheek,

In your reply to Ivan in the comments section of your blog post, you mentioned that it should be possible to directly payload-encode an RTSP stream containing H264 frames into webrtcbin without having to first decode it and then re-encode it. I am interested in this exact scenario. I've tried the following pipeline but it doesn't show the video on the webpage. There is no error in the browser console either. Could you please take a look and let me know if there is something wrong with this pipeline?

gst_parse_launch("rtspsrc location=rtsp://10.51.52.115/h264 ! queue ! rtph264pay ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! webrtcbin name=sendrecv", &error);

You need to depayload after rtspsrc before you repayload again.

i.e. add a rtph264depay before rtph264pay.

Cheers
-Matt

Thanks!


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

Re: RTSP stream to webrtcbin

chakra
Hi Talha,

Even I looking for a way to stream RTSP H.264 to webrtc without any
intermediate transcoding. Could you please share if you had any thing
working on this regard

Thanks,
Chakra



--
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: RTSP stream to webrtcbin

chakra
This post was updated on .
In reply to this post by Ottawa Boy
Hi,

Based on https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-uridecodebin.html#GstURIDecodeBin--caps

Its says that, adding caps it should skip decoding, so I tried example as below,

#define SKIP_FOR_CAPS \
        "video/x-h264;" \
  "video/x-gst_ff-libxvid;" \
  "video/x-h264;" \
  "video/x-xvid;" \
  "video/mpeg,mpegversion=[1, 2];" \
  "video/x-theora;" \
  "video/x-vp8;" \
  "application/x-yuv4mpeg,y4mversion=2;"

pipe1 =
      gst_parse_launch ("uridecodebin name=uridb uri=rtsp://10.10.155.177/h264 ! videoconvert ! queue ! x264enc ! rtph264pay ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! webrtcbin name=sendrecv",
      &error);

uridb1 = gst_bin_get_by_name (GST_BIN (pipe1), "uridb");
  GstCaps *deco_caps;
  deco_caps = gst_caps_from_string (SKIP_FOR_CAPS);
  //g_object_set (G_OBJECT (uridb1), "caps", deco_caps, NULL);
  gst_caps_unref (deco_caps);



The above works, but with trans-coding.  Now to skip it I tried as below,

pipe1 =
      gst_parse_launch ("uridecodebin name=uridb uri=rtsp://10.10.155.177/h264 ! rtph264pay ! queue ! application/x-rtp,media=video,encoding-name=H264,payload=96 ! webrtcbin name=sendrecv",
      &error);

uridb1 = gst_bin_get_by_name (GST_BIN (pipe1), "uridb");
  GstCaps *deco_caps;
  deco_caps = gst_caps_from_string (SKIP_FOR_CAPS);
  g_object_set (G_OBJECT (uridb1), "caps", deco_caps, NULL);
  gst_caps_unref (deco_caps);


But video is not flowing, and pipeline just hangs.

I believe setting caps is right approach as above, but not sure of how to create pipeline at gst_parse_launch in the above. Is there some other module/features I need to update in the gstreamer pipeline for gst_parse_launch ?

Or if there is some efficient approach please share

Thanks,
Chakra



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

Re: RTSP stream to webrtcbin

chakra
Hi

Any suggestions/help here on the above issue is very much helpful

Please suggest if there is any solution here

Thanks,
Chakra



--
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: RTSP stream to webrtcbin

SuffiX
Hello!

Does anybody found solution how to forward h264 RTSP video from IP camera to
HTML5 video using GStreamer WebRTCbin without decoding h264 to h264?

Please, share example of launcher pipe and js code to see the result.



--
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: RTSP stream to webrtcbin

Tarun Tej K
Hi,

We were able to get it working in v1.14.1 with the similar to below pipeline in Google Chrome.

  • gst_parse_launch ("webrtcbin bundle-policy=max-bundle name=sendrecv " STUN_SERVER
    " rtspsrc location=rtsp://<ipcamera_url_info_here> ! queue ! application/x-rtp, media=video, encoding-name=H264, payload=96 ! sendrecv. ",
    &error);

We didn't have to depayload at all. Simply filter out the h264 and forward the rtsp stream to webrtcbin.

However after upgrading the gstreamer version to 1.14.2 or later and Google chrome, we are facing errors. 

On Mon 21 Jan, 2019, 4:42 AM SuffiX <[hidden email] wrote:
Hello!

Does anybody found solution how to forward h264 RTSP video from IP camera to
HTML5 video using GStreamer WebRTCbin without decoding h264 to h264?

Please, share example of launcher pipe and js code to see the result.



--
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: RTSP stream to webrtcbin

Marc Leeman
I would depayload, parse and payload again, at the very least, you
would be more certain not to feed in corrupt frames that might confuse
the Google stack on the receiving end (can be an issue in busy
networks).

At least that was what we did some time ago.


On Mon, 21 Jan 2019 at 03:27, Tarun Tej K <[hidden email]> wrote:

>
> Hi,
>
> We were able to get it working in v1.14.1 with the similar to below pipeline in Google Chrome.
>
> gst_parse_launch ("webrtcbin bundle-policy=max-bundle name=sendrecv " STUN_SERVER
> " rtspsrc location=rtsp://<ipcamera_url_info_here> ! queue ! application/x-rtp, media=video, encoding-name=H264, payload=96 ! sendrecv. ",
> &error);
>
>
> We didn't have to depayload at all. Simply filter out the h264 and forward the rtsp stream to webrtcbin.
>
> However after upgrading the gstreamer version to 1.14.2 or later and Google chrome, we are facing errors.
> More details here : https://github.com/centricular/gstwebrtc-demos/issues/65
>
> On Mon 21 Jan, 2019, 4:42 AM SuffiX <[hidden email] wrote:
>>
>> Hello!
>>
>> Does anybody found solution how to forward h264 RTSP video from IP camera to
>> HTML5 video using GStreamer WebRTCbin without decoding h264 to h264?
>>
>> Please, share example of launcher pipe and js code to see the result.
>>
>>
>>
>> --
>> 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
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: RTSP stream to webrtcbin

evaluat0r
In reply to this post by Ottawa Boy
Ottawa Boy wrote

> Hi Nirbheek,
>
> In your reply to Ivan in the comments section of your blog post, you
> mentioned that it should be possible to directly payload-encode an RTSP
> stream containing H264 frames into webrtcbin without having to first
> decode
> it and then re-encode it. I am interested in this exact scenario. I've
> tried the following pipeline but it doesn't show the video on the webpage.
> There is no error in the browser console either. Could you please take a
> look and let me know if there is something wrong with this pipeline?
>
> gst_parse_launch("rtspsrc location=rtsp://10.51.52.115/h264 ! queue !
> rtph264pay ! application/x-rtp,media=video,encoding-name=H264,payload=96 !
> webrtcbin name=sendrecv", &error);
>
> Thanks!
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

I don’t think that is technically correct. This is because webrtc supports
adapt but rate control. If the sender needs to lower the bit rate or
increase it, then it necessitates decode/encode step. Therefore, you can’t
simply pass it through.



--
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: RTSP stream to webrtcbin

Sumeet
In reply to this post by Tarun Tej K
Hi,

Were you able to run this pipeline post 1.14.2?



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