RTSP stream to webrtcbin

classic Classic list List threaded Threaded
5 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