# Media stuck when broadcast with Gstreamer

**URL:** <https://mediasoup.discourse.group/t/media-stuck-when-broadcast-with-gstreamer/742>\
**Category:** Integration\
**Created:** [April 4, 2020, 11:28am UTC](https://mediasoup.discourse.group/t/media-stuck-when-broadcast-with-gstreamer/742 "2020-04-04T11:28:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunqi](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/sunqi/32/300_2.png) [@sunqi](https://mediasoup.discourse.group/u/sunqi)\
**Post date:** [April 4, 2020, 11:28am UTC](https://mediasoup.discourse.group/t/media-stuck-when-broadcast-with-gstreamer/742/1 "2020-04-04T11:28:34Z")

</div>

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. ☠ ☠

Obviously Most frames were droped by chrome.

```auto
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.

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

```

Here is Gstreamer command

```auto
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

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [April 4, 2020, 11:39am UTC](https://mediasoup.discourse.group/t/media-stuck-when-broadcast-with-gstreamer/742/2 "2020-04-04T11:39:46Z")

</div>

There is a [GStreamer example](https://github.com/versatica/mediasoup-demo/tree/v3/broadcasters) 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.

---

<div class="post-metadata">

**Author:** ![sunqi](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/sunqi/32/300_2.png) [@sunqi](https://mediasoup.discourse.group/u/sunqi)\
**Post date:** [April 4, 2020, 11:54am UTC](https://mediasoup.discourse.group/t/media-stuck-when-broadcast-with-gstreamer/742/3 "2020-04-04T11:54:16Z")

</div>

thanks! 😀 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,
