Live stream keeps disconnecting, how to debug?

Hi,

I’m testing out Cloudflare Stream with a Blackmagic Web Presenter HD, however it doesn’t seem able to keep the connection up.

The upload speed of the connection is good and when I stream to another endpoint (for example Twitch) with the same device there is no problem. I did a MTR to live.cloudflare.com which shows some packet loss at one hop.

I’m unsure how to proceed with debugging. Any tips? Thanks!

|------------------------------------------------------------------------------------------|
|                                      WinMTR statistics                                   |
|                       Host              -   %  | Sent | Recv | Best | Avrg | Wrst | Last |
|------------------------------------------------|------|------|------|------|------|------|
|                             192.168.1.1 -    0 |  101 |  101 |    0 |    0 |    0 |    0 |
|                              37.152.8.1 -    0 |  101 |  101 |    8 |    9 |   21 |    8 |
|                           178.238.96.89 -    0 |  101 |  101 |    8 |    9 |   38 |    8 |
|redhosting-globsw.telecity2.openpeering.nl -  0 |  101 |  101 |    8 |   10 |   23 |    9 |
|         telehouse-north2.openpeering.nl -    0 |  101 |  101 |   14 |   17 |   69 |   15 |
|                   linx-lon1.as13335.net -   60 |   30 |   12 |    0 |   50 |  153 |   18 |
|                            172.70.160.2 -    0 |  101 |  101 |   15 |   19 |   46 |   15 |
|                           172.65.29.121 -    0 |  101 |  101 |   15 |   16 |   28 |   15 |
|________________________________________________|______|______|______|______|______|______|
   WinMTR v0.92 GPL V2

Hey! We can setup peering on AMS-IX and NL-IX which would relieve the issue here. This would make it so you get routed to our Amsterdam datacenter rather than the one in London. We just emailed the internet exchanges.

1 Like

That’s great! Thanks for the quick reply and keep us posted :slight_smile:

1 Like

Hey @renan, how long does it usually take to switch the routing? I just did a traceroute again and saw the traffic still going trough London.

This is going to take some long time it seems like. I’ve pinged the team internally on it.

Just to make sure; are you sure the routing is the issue? Network packet loss should not be consistently there. Is there a chance you’re having authentication issues?

Are you able to go live from OBS using the same connection? Perhaps the issue has to do with the Blackmagic device, which we can try to figure out internally as well by buying a test unit.

Ok i tried a little more. On the same connection ffmpeg doesn’t seem to have any problem keeping the stream up for 10 minutes and counting. I assumed it was the routing, but it might actually be the Blackmagic Web Presenter. The same Web Presenter doesn’t have any problem streaming to an nginx-rtmp server.

Ok got it. I was just looking at the docs and are you sure the Blackmagic Web Presenter supports RTMPS? I will also try to buy one to try for myself.

It supports streaming to Facebook and YouTube, which is also RTMPS. So that should work.

Edit to clarify: the device we use is the Web Presenter HD, not the Web Presenter 4K that was just released.

You have to add custom service via a custom XML file in the Web Presenter. For the record this is my XML file.

<?xml version=”1.0” encoding=”UTF-8”?>
<streaming>
	<service>
		<name>Nginx</name>
		<servers>
			<server>
				<name>Main</name>
				<url>rtmp://xxxxx/stream</url>
			</server>
		</servers>
		<profiles>
			<profile>
				<name>Streaming High</name>
				<config resolution="1080p" fps="60">
					<bitrate>9000000</bitrate>
					<audio-bitrate>130000</audio-bitrate>
				</config>
				<config resolution="1080p" fps="30">
					<bitrate>6000000</bitrate>
					<audio-bitrate>130000</audio-bitrate>
				</config>
			</profile>
			<profile>
				<name>Streaming Medium</name>
				<config resolution="1080p" fps="60">
					<bitrate>7000000</bitrate>
					<audio-bitrate>130000</audio-bitrate>
				</config>
				<config resolution="1080p" fps="30">
					<bitrate>5000000</bitrate>
					<audio-bitrate>130000</audio-bitrate>
				</config>
			</profile>
			<profile>
				<name>Streaming Low</name>
				<config resolution="1080p" fps="60">
					<bitrate>5000000</bitrate>
					<audio-bitrate>130000</audio-bitrate>
				</config>
				<config resolution="1080p" fps="30">
					<bitrate>3000000</bitrate>
					<audio-bitrate>130000</audio-bitrate>
				</config>
			</profile>
		</profiles>
	</service>
	<service>
		<name>Cloudflare</name>
		<servers>
			<server>
				<name>Main</name>
				<url>rtmps://live.cloudflare.com:443/live/</url>
			</server>
		</servers>
		<profiles>
			<profile>
				<name>Streaming High</name>
				<config resolution="1080p" fps="60">
					<bitrate>9000000</bitrate>
					<audio-bitrate>130000</audio-bitrate>
				</config>
				<config resolution="1080p" fps="30">
					<bitrate>6000000</bitrate>
					<audio-bitrate>130000</audio-bitrate>
				</config>
			</profile>
			<profile>
				<name>Streaming Medium</name>
				<config resolution="1080p" fps="60">
					<bitrate>7000000</bitrate>
					<audio-bitrate>128000</audio-bitrate>
				</config>
				<config resolution="1080p" fps="30">
					<bitrate>4500000</bitrate>
					<audio-bitrate>128000</audio-bitrate>
				</config>
			</profile>
			<profile>
				<name>Streaming Low</name>
				<config resolution="1080p" fps="60">
					<bitrate>4500000</bitrate>
					<audio-bitrate>128000</audio-bitrate>
				</config>
				<config resolution="1080p" fps="30">
					<bitrate>3000000</bitrate>
					<audio-bitrate>128000</audio-bitrate>
				</config>
			</profile>
		</profiles>
	</service>
</streaming>

Hey @raymon, where does the RTMPS key go in the XML? Shouldn’t the server URL be like:
rtmps://live.cloudflare.com:443/live/<your_rtmps_key>?

1 Like

There is a field for that in the user interface. For security reasons it’s not in the preset.