# Camera is not continuously streamed using streaming plugin

**URL:** <https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382>\
**Category:** General\
**Created:** [November 25, 2024, 6:27am UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382 "2024-11-25T06:27:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![djshah](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@djshah](https://janus.discourse.group/u/djshah)\
**Post date:** [November 25, 2024, 6:27am UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/1 "2024-11-25T06:27:40Z")

</div>

The Camera stream is disconnect and connect 17 times in 30 minutes observation.

Note: Janus server is running on remote ubuntu server.

Process structure of streaming:

1. I have created multistream mountpoint in janus.plugin.streaming.jcfg.
2. Now i insert RTP stream with FFMPEG using below command. (I setup nodejs server for run FFMPEG in my local system.)  
3.FFMPEG command: “ffmpeg -rtsp\_transport tcp -i rtsp://ksjgdhk:lgkjl@abc.com:5540/orchid/live?id=7 -c:v copy -an -f rtp rtp://10.30.50.144”  
4.API call from local and getting MediaStream from Janus.  
5.Attach media stream with the videoelement.  
6.Screenshot of the log  
 ![image](https://global.discourse-cdn.com/free1/uploads/janus/original/1X/0e7878665486daccb266a136f17ef90a81e43204.png)

Logs in console:  
Removing remote track  
(index):131 Removing track: MediaStreamTrack {kind: ‘video’, id: ‘janus1’, label: ‘janus1’, enabled: true, muted: true, …}  
janus.js:2029 Remote track flowing again: Event {isTrusted: true, type: ‘unmute’, target: MediaStreamTrack, currentTarget: MediaStreamTrack, eventPhase: 2, …}  
(index):127 Adding track: MediaStreamTrack {kind: ‘video’, id: ‘janus1’, label: ‘janus1’, enabled: true, muted: false, …}  
janus.js:2006 Remote track muted: Event {isTrusted: true, type: ‘mute’, target: MediaStreamTrack, currentTarget: MediaStreamTrack, eventPhase: 2, …}  
janus.js:2009 Removing remote track

---

<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:** [November 25, 2024, 8:47am UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/2 "2024-11-25T08:47:39Z")

</div>

Check if the connection to the RTSP server is being lost. Also make sure the RTP packets the camera is sending are not too big, since WebRTC adds overhead which may cause their size to be larger than what the network allows, thus causing packets to be dropped.

---

<div class="post-metadata">

**Author:** ![djshah](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@djshah](https://janus.discourse.group/u/djshah)\
**Post date:** [November 25, 2024, 12:59pm UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/3 "2024-11-25T12:59:48Z")

</div>

Which solution should I implement to resolve this? I cannot make any changes to the RTSP server or the RTSP URL; any modifications must be made to Janus or FFmpeg.

---

<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:** [November 25, 2024, 2:00pm UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/4 "2024-11-25T14:00:17Z")

</div>

You should first investigate whether the problem is in one of the things I said.

---

<div class="post-metadata">

**Author:** ![djshah](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@djshah](https://janus.discourse.group/u/djshah)\
**Post date:** [November 26, 2024, 6:58am UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/5 "2024-11-26T06:58:16Z")

</div>

Previously the MTU size is 1500 bytes, now i change it to 9000 bytes.  
The maximum size of the incoming rtp packets is 2322 bytes.  
But still the remote stream is muted and again started track.

---

<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:** [November 26, 2024, 9:37am UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/6 "2024-11-26T09:37:11Z")

</div>

I don’t think you understood what I meant. You want the maximum RTP packet size to be lower, _not_ higher, because somewhere on the network it may be lower and cause packets to be dropped. If the camera sends 1500 bytes of RTP, that will become higher than 1500 on WebRTC (due to SRTP and extensions). This means you have to configure the camera (or the ffmpeg/gstreamer script that mediates the conversation, if you have any) to send smaller RTP packets to Janus. 1200 is a good size, on average, because 1280 is the maximum size of IPv6 packets which makes it a good MTU reference.

---

<div class="post-metadata">

**Author:** ![djshah](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@djshah](https://janus.discourse.group/u/djshah)\
**Post date:** [November 26, 2024, 10:33am UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/7 "2024-11-26T10:33:06Z")

</div>

I update the ffmpeg command as below, by changing the packet size.

ffmpeg -rtsp\_transport tcp -i rtsp://ksjgdhk:lgkjl@abc.com:5540/orchid/live?id=7 -c:v copy -an -f rtp rtp://10.30.50.144:5001?pkt\_size=1280

But still the mute event is triggered.

Is that i need to change at Janus side ?

Mountpoint in janus:

Site1: {  
type = “rtp”  
id = 1  
description = “Site 1”  
media = (  
{  
type = “video”  
mid = “1”  
label = “Site 1 - Camera 1”  
port = 5001  
pt = 96  
codec = “h264”  
},  
{  
type = “video”  
mid = “2”  
label = “Site 1 - Camera 2”  
port = 5002  
pt = 96  
codec = “h264”  
}  
)  
}

---

<div class="post-metadata">

**Author:** ![djshah](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@djshah](https://janus.discourse.group/u/djshah)\
**Post date:** [November 28, 2024, 5:53am UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/8 "2024-11-28T05:53:40Z")

</div>

Hi @lorenzo Is there any other solution.

---

<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:** [November 28, 2024, 9:09am UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/9 "2024-11-28T09:09:19Z")

</div>

Use Wireshark/tcpdump to capture RTP traffic on both the RTSP and WebRTC side to see what’s wrong. Inspecting the browser internals (e.g., `chrome://webrtc-internals`) may also help you investigate the problem.

---

<div class="post-metadata">

**Author:** ![djshah](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@djshah](https://janus.discourse.group/u/djshah)\
**Post date:** [December 3, 2024, 2:00pm UTC](https://janus.discourse.group/t/camera-is-not-continuously-streamed-using-streaming-plugin/1382/10 "2024-12-03T14:00:16Z")

</div>

@lorenzo, Can the camera streams remain continuous without disconnecting even once for 1-2 hours when using Janus?  
Since the same stream runs continuously for 1-2 hours when using Wowza.
