LiveView problems behind NAT

Hello.

I’ve got Bluecherry v3.0.4 installed on Ubuntu 20.04 server, which has only a local IP Address. Two unnamed IP cameras (Generic) with ONVIF support are connected.
I’ve installed a Windows-client application on my laptop and added the server.

When I connect to the server inside the LAN, i can monitor both of the cameras.

I’ve made a port forwarding on my router.

When I connect to the server from other places (throught the Internet) I can see video-stream only from one camera. It’s no matter whether i choose first or second camera (sequently, not at the same time), i see the video from the first added (binded to server) camera.
If i open second camera -> i see the stream from the first camera. If I try to open the first camera, i just see “Connecting…” and nothing else happens.

Maybe, i must change some setting or routing rules to fix this problem? Or any other ideas?

More strange things:
I’ve deleted all cameras (CAM1=> IP1 and CAM2=>IP2) from server and then added only the CAM2 with IP2.
And now i see the stream from CAM1, not CAM2.
I’m sure that the cams have defferent IP addresses and no other devices are in LAN.

Greetings!
The oddities don’t end there. I’ve connected to the server throuh the WEB interface (still behind the NAT, translation 17001 => 7001) and now i see 2 different CAM streams in LifeView.
At the same time, in Windows client if i add any of the CAMs to View Window, i see only the first CAM stream. If i try to add both CAMs, then one is streaming CAM1, but the other is “connecting…” without any result.

what is the upload speed of the server? is it possible that your server’s uplink is too slow to handle multiple camera feeds?

Well, what sticks out to me is that you need to have port 7001 port 7002 both forwarded through the firewall. In addition, I’m not 100% sure on this point, but I believe you need to preserve the port mapping for port 7002. If I’m not mistaken, it needs to be port 7002 both inside and outside the firewall. Port 7001 should be able to handle being remapped to a different port.

1 Like

That’s right.
I’ve made a simple port forwarding (without port remapping) 7001 and 7002, and now i see both of the CAMS in my Windows Client.
Thanks a lot!

Now i’m stuck with some other strange problem.
My CAMs have 2 independent streams (Full HD and SD resolution). In CAMs settings, i set to use H.265 codec for both streams.
If i choose FHD as main RTSP stream, and SD as “substream” in BlueCherry Server Settings, then the MainStream starts normally, but substream fails:

Dec 20 20:12:48 beholder bc-server[848]: I(18/S3-S): Stream started: Video: hevc (Main), yuvj420p(pc, bt470bg/bt470bg/bt709), 1920x1080, 1/90000(s) 1/90000(c); Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

Dec 20 20:12:48 beholder bc-server[848]: I(18/S3-S): Substream started: Video: hevc (Main), yuvj420p(pc, bt470bg/bt470bg/bt709), 720x576, 1/90000(s) 1/90000(c)
Dec 20 20:12:48 beholder bc-server[848]: E(18/S3-S): Initializing muxer for RTP streaming failed
Dec 20 20:12:48 beholder bc-server[848]: E(18/S3-S): bc_streaming_setup() failed: Invalid argument
Dec 20 20:12:48 beholder bc-server[848]: E(18/S3-S): Unable to setup live broadcast from substream

But, if I switch streams (mainstream = SD path, substream = FHD Path), then both of streams starts successfully.

Dec 20 20:22:24 beholder bc-server[848]: I(18/S3-S): Device stopped: configuration changed
Dec 20 20:22:31 beholder bc-server[848]: I(18/S3-S): Setting up device
Dec 20 20:22:32 beholder bc-server[848]: I(18/S3-S): Substream started: Video: hevc (Main), yuvj420p(pc, bt470bg/bt470bg/bt709), 1920x1080, 1/90000(s) 1/90000(c)
Dec 20 20:22:33 beholder bc-server[848]: I(18/S3-S): Stream started: Video: hevc (Main), yuvj420p(pc, bt470bg/bt470bg/bt709), 720x576, 1/90000(s) 1/90000(c); Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
Dec 20 20:22:33 beholder bc-server[848]: I(18/S3-S): Switching to new recording schedule ‘motion’

Why could it be so? Any help, please? :slight_smile:

Hmm. It looks like i was wrong about stream <=> substream switching. There were no error just because i didn’t open this CAM in LifeVIew.
If I do so (open a substream), then the same errrors occurs:

Dec 21 13:34:16 beholder bc-server[849]: E(1/S3-S): Initializing muxer for RTP streaming failed
Dec 21 13:34:16 beholder bc-server[849]: E(1/S3-S): bc_streaming_setup() failed: Invalid argument
Dec 21 13:34:16 beholder bc-server[849]: E(1/S3-S): Unable to setup live broadcast from substream

And in LifeView window an error appears:
Open error: Server returned 404 Not found.

It looks like the PATH to substream is incorrect, but it can’t be so. The paths are very simple:
/0 for the main stream
/1 for the substream
And they are both working, if I set them into main stream path in server settings (not at the same time, but sequently).

Oh!.. This maybe important:
My server doesn’t have any videocard (internal or external).
It’s Ryzen 5 2600 without video at all.

VAAPI device in Performance/connectivity settings is set to None

Can you try switching to H.264 and see if the problems continue?

I’ve switched to h.264 (tried Base and High Profile) for both streams and got the same substream error in log:

Dec 22 08:21:44 beholder bc-server[850]: I(18/S3-S): Substream started: Video: h264 (High), yuvj420p(pc, bt470bg/bt470bg/bt709, progressive), 720x576, 1/90000(s) 1/180000(c)
Dec 22 08:21:44 beholder bc-server[850]: E(18/S3-S): Initializing muxer for RTP streaming failed
Dec 22 08:21:44 beholder bc-server[850]: E(18/S3-S): bc_streaming_setup() failed: Invalid argument
Dec 22 08:21:44 beholder bc-server[850]: E(18/S3-S): Unable to setup live broadcast from substream

and the same error on display:
error_404

Hmm… I changed CAM video-setting several times (bitrate, profile, i-frame interval and etc),
and now the error is gone. Both streams are working well with h.264 codec.

But!
I’ve set the same values to the second CAM, but got an error :frowning:

Dec 22 08:43:06 beholder bc-server[850]: I(17/S3-C): Applying configuration changes
Dec 22 08:43:07 beholder bc-server[850]: I(17/S3-C): Device stopped: configuration changed
Dec 22 08:43:14 beholder bc-server[850]: I(17/S3-C): Setting up device
Dec 22 08:43:15 beholder bc-server[850]: I(17/S3-C): Stream started: Video: h264 (Baseline), yuvj420p(pc, bt470bg/bt470bg/bt709, progressive), 1920x1080, 1/90000(s) 1/180000(c); Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s
Dec 22 08:43:15 beholder bc-server[850]: I(17/S3-C): Switching to new recording schedule ‘continuous’
Dec 22 08:43:16 beholder bc-server[850]: I(17/S3-C): Substream started: Video: h264 (Baseline), yuvj420p(pc, bt470bg/bt470bg/bt709, progressive), 720x576, 1/90000(s) 1/180000(c)
Dec 22 08:43:16 beholder bc-server[850]: E(17/S3-C): Initializing muxer for RTP streaming failed
Dec 22 08:43:16 beholder bc-server[850]: E(17/S3-C): bc_streaming_setup() failed: Invalid argument
Dec 22 08:43:16 beholder bc-server[850]: E(17/S3-C): Unable to setup live broadcast from substream

Can you try disabling audio for the sub stream (or both to test)?

Generic IP cameras scare me…their RTSP implementation is usually not the best.

Yes,
With disabled Audio both streams are working well (even H.265) for both CAMs.
Thank you!

P.S. Is it some way to keep audio track in recording file, but disable audio only in LifeView? :slight_smile: