Question about bridging H.264 from RTSP to webRTC

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

Question about bridging H.264 from RTSP to webRTC

Ottavio Campana-2
Hello,

I am trying to bridge H.264 over RSTP from a camera to webRTC for seeing the video in the browser.


My successive step was moving from VP8 to H.264, thus in the function start_pipeline I changed

"videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! "
"queue ! " RTP_CAPS_VP8 "96 ! sendrecv. "

to

videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc ! rtph264pay config-interval=-1 ! "
"queue ! " RTP_CAPS_H264 "96 ! sendrecv. "

and this also works. At this point I tried to change the pipeline, by fetching the nal units from a RTSP source and by sending them to the webrtcbin

"rtspsrc location=rtsp://192.168.69.159/live2.sdp latency=0 ! queue ! rtph264depay ! h264parse ! rtph264pay config-interval=-1 ! "
"queue ! " RTP_CAPS_H264 "96 ! sendrecv. "

With firefox 85.0.1 the example hangs with "Sending SDP answer". Neither video nor audio flaw between webrtc-sednrecv and firefox. On the other hand, if I try it with chrome 88.0.4323.150 it works as expected.

I suspect that there must be something wrong in my pipe, but I cannot understand what. Can you please give me a hint?

Thank you,

Ottavio


--
Non c'è più forza nella normalità, c'è solo monotonia

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

Re: Question about bridging H.264 from RTSP to webRTC

evaluat0r
Ottavio Campana-2 wrote

> Hello,
>
> I am trying to bridge H.264 over RSTP from a camera to webRTC for seeing
> the video in the browser.
>
> I started by setting up the example
> https://gitlab.freedesktop.org/gstreamer/gst-examples/-/blob/master/webrtc/sendrecv/gst/webrtc-sendrecv.c
> and it works.
>
> My successive step was moving from VP8 to H.264, thus in the function
> start_pipeline I changed
>
> "videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc
> deadline=1 ! rtpvp8pay ! "
> "queue ! " RTP_CAPS_VP8 "96 ! sendrecv. "
>
> to
>
> videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc !
> rtph264pay config-interval=-1 ! "
> "queue ! " RTP_CAPS_H264 "96 ! sendrecv. "
>
> and this also works. At this point I tried to change the pipeline, by
> fetching the nal units from a RTSP source and by sending them to the
> webrtcbin
>
> "rtspsrc location=rtsp://192.168.69.159/live2.sdp latency=0 ! queue !
> rtph264depay ! h264parse ! rtph264pay config-interval=-1 ! "
> "queue ! " RTP_CAPS_H264 "96 ! sendrecv. "
>
> With firefox 85.0.1 the example hangs with "Sending SDP answer". Neither
> video nor audio flaw between webrtc-sednrecv and firefox. On the other
> hand, if I try it with chrome 88.0.4323.150 it works as expected.
>
> I suspect that there must be something wrong in my pipe, but I cannot
> understand what. Can you please give me a hint?

While that may work with chrome, it isn't guaranteed to work. If you receive
certain messages from chrome that require to generate an I frame on request,
then you can't do that if you are dealing with compressed video.



--
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: Question about bridging H.264 from RTSP to webRTC

Ottavio Campana-2
Dear evaluat0r,

I have been doing some debug. The problem does not seem to be related to the request of an I frame, but to a missing attribute in webrtcbin. Specifically, I get

gstwebrtcbin.c:4333:_set_description_task:<sendrecv> media 0 is missing or contains an empty 'ice-ufrag' attribute

How can I set it in the gstwebrtcbin?

Finally, for requiring an I frame. Is there an event I can hook? I can bridge the request to the RTSP source.

Thank you,

Ottavio

Il giorno ven 12 feb 2021 alle ore 08:34 evaluat0r <[hidden email]> ha scritto:
Ottavio Campana-2 wrote
> Hello,
>
> I am trying to bridge H.264 over RSTP from a camera to webRTC for seeing
> the video in the browser.
>
> I started by setting up the example
> https://gitlab.freedesktop.org/gstreamer/gst-examples/-/blob/master/webrtc/sendrecv/gst/webrtc-sendrecv.c
> and it works.
>
> My successive step was moving from VP8 to H.264, thus in the function
> start_pipeline I changed
>
> "videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc
> deadline=1 ! rtpvp8pay ! "
> "queue ! " RTP_CAPS_VP8 "96 ! sendrecv. "
>
> to
>
> videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! x264enc !
> rtph264pay config-interval=-1 ! "
> "queue ! " RTP_CAPS_H264 "96 ! sendrecv. "
>
> and this also works. At this point I tried to change the pipeline, by
> fetching the nal units from a RTSP source and by sending them to the
> webrtcbin
>
> "rtspsrc location=rtsp://192.168.69.159/live2.sdp latency=0 ! queue !
> rtph264depay ! h264parse ! rtph264pay config-interval=-1 ! "
> "queue ! " RTP_CAPS_H264 "96 ! sendrecv. "
>
> With firefox 85.0.1 the example hangs with "Sending SDP answer". Neither
> video nor audio flaw between webrtc-sednrecv and firefox. On the other
> hand, if I try it with chrome 88.0.4323.150 it works as expected.
>
> I suspect that there must be something wrong in my pipe, but I cannot
> understand what. Can you please give me a hint?

While that may work with chrome, it isn't guaranteed to work. If you receive
certain messages from chrome that require to generate an I frame on request,
then you can't do that if you are dealing with compressed video.



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


--
Non c'è più forza nella normalità, c'è solo monotonia

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

Re: Question about bridging H.264 from RTSP to webRTC

Stephenwei
In reply to this post by Ottavio Campana-2
To measure your codec type.Firefox only support openh264



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