Media stuck when broadcast with Gstreamer

I’m trying to broadcast video with gsteamer. But the video in browser get stucked after about 1 second from playing, and then looks like that only keyframe was decoded by browser. (same problem in safari & firefox & chrome)

I input encoded raw baseline h264 to gsteamer and then output to mediasoup plainTransport,and then mediasoup broadcast the video to browser. There is almost no packet loss during piping couse I was running in local device.

This problem has gone when broadcast with ffmpeg.But for some reason I want to use Gstreamer in my project.

When I recv rtp packets with Gstreamer, video can play fluently. I think that this is a format problem and I kown this is not a gstreamer forum.I just wanna some suggestions.I have been trapped in this problem for a week. :skull_and_crossbones: :skull_and_crossbones:

Obviously Most frames were droped by chrome.

kind	video
jitterBufferDelay	16.365
[jitterBufferDelay/jitterBufferEmittedCount_in_ms]	0
jitterBufferEmittedCount	1204
frameWidth	1280
frameHeight	720
framesReceived	70006
[framesReceived/s]	29.959078892951556
[framesReceived-framesDecoded]	68801
framesDecoded	1205
framesDropped	68756
freezeCount	8

Here is my ffmpeg command that works.

ffmpeg -re  -i test.h264 -vcodec copy -f rtp -ssrc 2222 -payload_type 96 rtp://127.0.0.1:<localRtpPort>

Here is Gstreamer command

gst-launch-1.0 \
-v rtpbin rtp-profile=avpf name=r \
! filesrc location=./test.h264 \
!, h264parse \
! rtph264pay pt=96 ssrc=2222 config-interval=-1 \
! rtprtxqueue max-size-time=2000 max-size-packets=0 \
! r.send_rtp_sink_0 r.send_rtp_src_0
! udpsink bind-address=127.0.0.1 host=127.0.0.1 bind-port=5005 port=${videoRtpPort} \
r.send_rtcp_src_0 \
! udpsink bind-address=127.0.0.1 host=127.0.0.1 port=${videoRtcpPort} \
sync=false async=false \
udpsrc port=5006 \
! r.recv_rtcp_sink_0

Appreciate

There is a GStreamer example in the mediasoup-demo source code. It was a PR and seems to work.

There are also many other GStreamer based examples/usages in the website in the Examples section.

thanks! :grinning: You almost involved any posts, any topics, in anytime … xxxxxd
You’re so great!!!

In fact I have checked this example. But gstreamer encoded the input to vp8 in this example. I want to input encoded h264 to gstreamer for streaming, so this example is not suitable for me.

I have visited many posts about gstreamer in this forum,which really help me a lot.
I’ll do more searching about this issue,