# Video appears after a random delay in Streaming Plugin

**URL:** <https://janus.discourse.group/t/video-appears-after-a-random-delay-in-streaming-plugin/1494>\
**Category:** General\
**Created:** [February 21, 2025, 7:02am UTC](https://janus.discourse.group/t/video-appears-after-a-random-delay-in-streaming-plugin/1494 "2025-02-21T07:02:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iGoodie](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/igoodie/32/399_2.png) [@iGoodie](https://janus.discourse.group/u/iGoodie)\
**Post date:** [February 21, 2025, 7:02am UTC](https://janus.discourse.group/t/video-appears-after-a-random-delay-in-streaming-plugin/1494/1 "2025-02-21T07:02:37Z")

</div>

Hey there! An amazingly flexible project you guys crafted there! Great job, thanks for it!

However I’m facing a very frustrating issue, which I couldn’t resolve past few days. I have an android app, that captures the screen and sends it to my Janus Server via a Streaming Plugin Handle. (for that purpose, I’m using an open-source implementation called Apuppet-android [apuppet-android/app/src/main/java/com/hmdm/control/janus/JanusStreamingPlugin.java at 88406391ce5f8a5e730bc82b8c098d3fd22fcf4a · MrYoda/apuppet-android · GitHub](https://github.com/MrYoda/apuppet-android/blob/88406391ce5f8a5e730bc82b8c098d3fd22fcf4a/app/src/main/java/com/hmdm/control/janus/JanusStreamingPlugin.java#L35)) Which effectively creates the Streaming Plugin session with:

```json
{
   message: {
      request: "create",
      type: "rtp",
      permanent: false,
      is_private: false,
      video: true,
      audio: false,
      id: "randomlyGenerated8Letters",
      pin: "randomlyGenerated4Letters",
      videoport: 0,
      videopt: 100,
      videortpmap: "H264/90000",
      videobufferkf: true,
   }
}

```

So far so good. Then I implemented a web client (using janus.js), that joins the session and sends a simple “watch” request, and then “start” request right when I receive the JSEP. The problem is, the client receive the Video MediaTrack as muted initially, and it takes a random delay (varies a lot, from 10 seconds to 10 minutes) to receive it unmuting itself.

```log
Remote track muted: Event {isTrusted: true, type: 'mute', target: MediaStreamTrack, currentTarget: MediaStreamTrack, eventPhase: 2, …}
Remote track flowing again: Event {isTrusted: true, type: 'unmute', target: MediaStreamTrack, currentTarget: MediaStreamTrack, eventPhase: 2, …}

```

When I debug using `chrome://webrtc-internals`, I see it is actually sending a keyframe very frequently. The delay cannot be the keyframe frequency. But at this point I am very much lost, I don’t know what to check next. Could you please guide me on that?

 ![image](https://global.discourse-cdn.com/free1/uploads/janus/original/1X/f2c44275ab25300b4ef3a7fa2f666d5b887c70a5.png)

Thanks a lot in advance 🙂

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [February 21, 2025, 9:17am UTC](https://janus.discourse.group/t/video-appears-after-a-random-delay-in-streaming-plugin/1494/2 "2025-02-21T09:17:52Z")

</div>

When creating H.264 mountpoints you should specify the fmtp as well (I think the sample mountpoint we have for H.264 provides an example). Janus doesn’t touch the media, so if SDP is not the problem, any issue you have with video is most of the times a problem on the source. Make sure RTP packets are not too large (WebRTC adds overhead in SRTP and extensions, which may cause size to exceed the MTU). Make also sure keyframes are not _too_ frequent: WebRTC is not HLS, you don’t need a keyframe every 1-2 seconds.

Try recording the mountpoint to an .mjr file, and converting the .mjr to an .mp4 with `janus-pp-rec`. That will tell you if at least media players think the video you’re sending is ok or not. If not, that might explain why browsers don’t like it either.

---

<div class="post-metadata">

**Author:** ![iGoodie](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/igoodie/32/399_2.png) [@iGoodie](https://janus.discourse.group/u/iGoodie)\
**Post date:** [February 24, 2025, 5:39am UTC](https://janus.discourse.group/t/video-appears-after-a-random-delay-in-streaming-plugin/1494/3 "2025-02-24T05:39:55Z")

</div>

Thanks a lot for the reply 🙂 I’ll try to see if streamed media has some flags or configuration missing, as it definitely works as expected when I stream using ffmpeg cli

---

<div class="post-metadata">

**Author:** ![jrodwins](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jrodwins](https://janus.discourse.group/u/jrodwins)\
**Post date:** [March 18, 2025, 7:00pm UTC](https://janus.discourse.group/t/video-appears-after-a-random-delay-in-streaming-plugin/1494/4 "2025-03-18T19:00:58Z")

</div>

Facing a similar issue here; have you got it sorted out? Also using apuppet-android

---

<div class="post-metadata">

**Author:** ![jrodwins](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jrodwins](https://janus.discourse.group/u/jrodwins)\
**Post date:** [September 26, 2025, 11:33am UTC](https://janus.discourse.group/t/video-appears-after-a-random-delay-in-streaming-plugin/1494/5 "2025-09-26T11:33:36Z")

</div>

I’ve solved the issue with aPuppet - the issue is that aPuppet’s keyframes can’t be decoded as soon as they arrive because the H264Packetizer isn’t correctly marking the packets.
