[IP Camera/Docker] Show stream on Paper UI

Hello,
i started working with IP-Cameras and OH3.

My Setup:

  • OH running in Docker (openhab:alpine-latest) → Currently openHAB 3.2.0 Release Build
  • Followed this guide https://www.youtube.com/watch?v=vAppsDRaCv8
  • Installed ffmpeg successfully on alpine with sudo apk update && sudo apk add ffmpeg

The via UI created Item

  • MJPEGUrl

has the value:

It seems that i can access the stream from the browser (from my local network) by using:

(This is my server IP in my home network (which i faked for this post))

What i did not get working is, to create a video widget in PaperUI and get the stream to be shown there.
I tried both of the upper variants and more (like 1.1.1.1) as url, since i think this is some docker-related stuff.

Can anyone tell me what adress i have to set in this special case for getting PaperUI accessing this stream in its own container?

The network_mode for my openhab containers is always host.

Thanks

You can’t use IPs freely. IPs must either belong to the local network or have to be routed (such as 8.8.8.8, a google DNS Server).
Please be aware that a private network address (such as 192.168.178.50) is, err… private. But not in the meaning of “oh, a very secret IP address, which only I am allowed to know”, but in the meaning: “this address is not part of the internet and therefor any traffic to this address is dropped by default.”
You don’t need to mask this stuff.

Docker is using two different network address ranges, this is the host network and the docker network (bridged). Docker will care about traffic, but you can’t use NATed IPs outside docker.

1 Like

Hi Udo,
thanks for taking the time and relplying this quick.

You don’t need to mask this stuff.

I know but i thought its good practice to not do this if it is not necessary.

Docker is using two different network address ranges, this is the host network and the docker network (bridged). Docker will care about traffic, but you can’t use NATed IPs outside docker.

Here i partially know whats going on.
The thing i dont get is, that i can access all the streams, i also can execute a curl-command within the OH-docker-container to grab snapshots of the IP-Cam from local network IP etc …
The only thing i dont get is, to use the already running stream in the Paper UI of OH

Sorry if there is still something i dont get.
Or did you want to tell me that i dont have a chance to use the video widget in my case because there are some limitations related to docker?

Thanks again

First, (I didn’t catch this part before…) openHAB3.x UI is not Paper UI :slight_smile: but Main UI.

In question of IP addresses, if there aren’t the real addresses, how to find routing issues? So yes, it’s definitely necessary…

And is the container network configured as bridged or host type?

First, (I didn’t catch this part before…) openHAB3.x UI is not Paper UI :slight_smile: but Main UI.

My fault, i always forget that :sweat_smile:

In question of IP addresses, if there aren’t the real addresses, how to find routing issues? So yes, it’s definitely necessary…

And is the container network configured as bridged or host type?

There is also something where i am absolutely no expert and maybe i made a mistake somewhere:
Regarding the documentation, OH needs ffmpeg for showing videos in Main UI?
As mentioned above i installed ffmpeg on alpine linux just for testing (because i know, that installing something in a docker container will be lost at next container start because this is nothing persistent)

So today i visited http://192.168.178.55:8080/ipcamera/[uid]/ipcamera.mjpeg again and was expecting to NOT see a stream because in the meantime i restarted my server.
But the stream was running as yesterday, and i am sure that no /usr/bin/ffmpeg folder is there anymore.
But again: I dont know much about these things and maybe my PC can decode stuff on its own without the need of a ffmpeg installed inside OH-container?
So could it be, that i have to debug ffmpeg, because this could be the reason why showing this stream on Main UI is not working?

Sorry for all the information.
I dont want to miss something :sweat_smile:

And again → Thanks for taking the time

Well, obviously, there is a wrong configuration with this “automatic” ip-Address. I’m not aware of any automatism like this…

I’m no docker expert, but I’m pretty sure you have to create another container for ffmpeg.

1 Like

Ok thank you
Having a separate ffmpeg container would be my preferred solution and I already did some research about that.

I was thinking I would first try to get it working to “temporarily install ffmpeg” in the openHAB container (because it’s a more native way with less problems???)

If this is working I would also have tried to have a separate container for ffmpeg

I will proceed trying to fix this and write down the solution here for others

Thanks for your support

I’m pretty sure that it’s more complex to install ffmpeg in the openHAB container, as containers not meant to get additional software. But that’s only a guess.

1 Like

Just to fullfill this post!
It seems, that the “standard” video-widget did not work in my case.

I copied a custom one from another topic here and it immediately worked.
So there is surely something i dont get, but i did not get it working using the video widget.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.