No Video, with "broken image" icon

Support for the docker image maintained by dlandon
Post Reply
tlundste
Posts: 19
Joined: Sun Nov 15, 2020 3:41 am

No Video, with "broken image" icon

Post by tlundste »

This is my first attempt at Zoneminder.
I have Ubuntu 20.04.1 LTS
On that system, I am running docker, and configured docker-compose to start up zoneminder using dlandon/zoneminder.latest (which shows as 1.34.22) with a mysql/mysql-server:5.7 zoneminder DB entry.
First time I tried any of this... and it worked and all started up just fine, and I was able to get to the zoneminder web page.
My camera is an Amcrest, AD110. The rtsp string I am using works just fine in VLC.
When I attempt to add it as a monitor to zoneminder console, it adds, shows "not running" with 0B/s throughput. When I click on the name link, I get a message that the "monitor is not capturing. We will be unable to provide an image" and I see the little "broken image" icon off to the left (as though it is a missing .jpg file).
I add the camera as a monitor with the following fields
General:
server - none
source type - ffmpeg
function - monitor (tried modect, and others, same result)

Source:
source path - the rtsp string I used in VLC
method - UDP (tried udp-multi, and tcp, same result)
resolution - 1920 x 1080 - 1080p (this is the resolution reported by VLC

Control:
Control Type - None (I've tried using the Amcrest and Hikvision entries, but the result is the same).
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: No Video, with "broken image" icon

Post by burger »

First thing to do in case a docker image gets corrupted after initial setup, is to delete the image, and saved data, and then start over. So try:

Code: Select all

 # docker rm $(docker ps -a -q)
 # docker rmi $(docker images -q) --force
Note: this command will delete all images. I assume you only have ZM. While the docker image is configuring, make sure you let it fully configure before accessing or restarting the container. Usually a few minutes is enough.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
tlundste
Posts: 19
Joined: Sun Nov 15, 2020 3:41 am

Re: No Video, with "broken image" icon

Post by tlundste »

No, I have several docker containers, and they've been around for quite a while, all working just fine. This is the newest set of containers (zoneminder and the mysql zm_db).
My docker images were all up and running when I created the new zoneminder stuff, and did a "docker-compose up -d" to pull in the new containers and start them.
So... removing all of my containers' images is not really going to be the first corrective action I would like to take. It was probably 10 minutes or more after starting the new ZM containers before I tried to access it. And, like I indicated, the ZM webpages work fine, with the one exception of displaying any video info.
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: No Video, with "broken image" icon

Post by burger »

Can you test on a brand new Docker instance / container, and confirm that this is an issue of the dlandon image? Then let us know what version you are using for the dlandon, so others will know. It's possible the new docker image is configured wrong.

Of course, you should know that you can adjust the above commands to delete only the ZM container / image. You may want to backup the DB first. And docker-compose up -d is not the only command required to update the images. Typically you have to (for both zm/mysql).

Code: Select all

docker pull mysql
docker stop some_container_name
docker rmi -f cjsdfsdfsdf
(where cjsdfsdfsdf is the old container alias under docker images)
docker-compose up -d mysql
Yes, deleting a docker image and rebuilding it is one of the strengths of docker. I don't think It is unreasonable to start with a new image. But, as I said - backup the data first.

Code: Select all

docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
As for troubleshooting let's confirm its the image, and not something specific to your setup. If it's just an issue of troubleshooting that video won't play, it's probably been covered in the 1.34 forum.

EDIT: There is also this docker image https://github.com/zoneminder/zmdockerfiles, but dlandon seems to be the popular one at the moment.
Last edited by burger on Tue Nov 17, 2020 5:13 pm, edited 3 times in total.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
tlundste
Posts: 19
Joined: Sun Nov 15, 2020 3:41 am

Re: No Video, with "broken image" icon

Post by tlundste »

If all I am deleting is the mysql and zoneminder container images... do I need to really backup anything? I just have the one camera loaded, so far. I'll likely do the backup, as you kindly added the command there... but if I lose everything in my zoneminder and mysql containers, I'm not out much... I just can't lose everything in all the others.

And, are you suggesting the only container I need to delete and try again is the mysql container? Or do the delete and re-pull for both?

Lastly, to answer your first question... Do you need a different number than what I posted in the original post for the version? If so, let me know where to find it. I posted 1.34.22 in the original post.

Thanks!
tlundste
Posts: 19
Joined: Sun Nov 15, 2020 3:41 am

Re: No Video, with "broken image" icon

Post by tlundste »

So... I went a little further with your suggestions (and I couldn't get a backup, permission denied, even though I tried "root" and the password I have listed in the MYSQL_ROOT_PASSWORD environment variable in my docker-compose.yaml file).
What I did was, in docker ...
rmi the mysql and zoneminder images
rm the remaining containers that were associated to the above images
and finally, a volume prune
Then, outside of the docker subsystem, I deleted the ./zoneminder folder, and recreated it (using sudo).
Then while using sudo...
I did a docker pull of mysql (according to images, it pulled down latest)
I started the zm_db container using docker-compose commands... and it pulled down mysql, again. I thought that was weird... then I noticed, doing a docker pull of mysql is pulling down "latest" and there is a mysql/mysql-server image, as well, at 5.7, the same version as what I specify in the .yaml file. I'm betting zoneminder is using the 5.7 version of mysql/mysql-server.

I continued on.
I did a pull of dlandon/zoneminder, and then started the container via docker-compose, and it started up (didn't pull down a different image).
I watched docker stats, and let the CPU of zoneminder settle down below 1%, and then waited another 30 seconds.

I then started rebuilding my config for users (admin and my own), and adding the camera. The result is pretty much the same... the only difference is... now, there isn't a "broken image" icon in the top left of where the camera image should be. That "broken image" icon only shows up if I select a function of "none" (instead of monitor, modect, etc).
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: No Video, with "broken image" icon

Post by burger »

So... It's really hard to say at this point. Dlandon's docker image is updated regularly (last update 1-2 days ago), so there is a chance it was broken. I don't use Docker, so I can't help now. But maybe someone else can chime in and verify whether its broken, or if I get a minute, I can check. You should obviously review https://github.com/dlandon/zoneminder and check the issues tab there to see if any of those address the problem.

As Docker is not the most commonly used release of Zoneminder, you are in advanced / experts territory, and all that comes with it. If you just want ZM to work, you can always go with the install guides at https://wiki.zoneminder.com/Debian and https://wiki.zoneminder.com/Ubuntu Get familiar with those, then you should be better able to fix issues with Docker. It's training wheels, basically.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
tlundste
Posts: 19
Joined: Sun Nov 15, 2020 3:41 am

Re: No Video, with "broken image" icon

Post by tlundste »

Thanks for the help, burger... gonna keep it here for one more line of questioning on this, if you don't mind.
I deleted it all, again, did a real "pull" of mysql/mysql-server (instead of just mysql, /facepalm), and reconfigured zoneminder options (users, add the camera); Back to the same result, sadly... but this time, I started investigating the logs (yeah, still a noob on docker, and certainly a noob on zoneminder; I know enough about docker to shoot myself in the foot). The logs indicated "Unable to open input rtsp://user:pwd@camera-ip:554/cam/realmonitor?channel=1&subtype=0 due to: No route to host"

Might that be my problem right there?
I know I need to expose the right ports for my environment (443 and 8443 are already in use on my docker system, so I had to use 9443)

Code: Select all

   ports:
     - 9443:443/tcp
     - 9000:9000/tcp
     - 9080:80

But the only "network_mode" I have is "znet".. the docker network created to allow mysql and zoneminder to talk to each other, per the instructions I found for setting all this up. My understanding is, I didn't need any other network configuration, as docker should handle the bridging and NATing for the the zoneminder container's communication with the docker host's physical network (below is the ifconfig from within the zoneminder container).

Code: Select all

/# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.20.0.3  netmask 255.255.0.0  broadcast 172.20.255.255
        ether 02:42:ac:14:00:03  txqueuelen 0  (Ethernet)
        RX packets 13083  bytes 25610305 (25.6 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9590  bytes 1425499 (1.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
In the zoneminder container, I don't have any routes other than the local 172.20 network in.

Code: Select all

/# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         172.20.0.1      0.0.0.0         UG        0 0          0 eth0
172.20.0.0      0.0.0.0         255.255.0.0     U         0 0          0 eth0
Shouldn't that work OK? I mean, it works with the docker host's physical network, in that from a different workstation, I can use the https://docker-host-ip:9443/zm to open the zoneminder web page and interact with it. So, why would there be no route to host when the rtsp tries to do it's thing?
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: No Video, with "broken image" icon

Post by burger »

If you can't route outside of the container to external IP addresses, troubleshoot by reviewing docker documentation/books. I can't give you an easy answer on that (you'll have to do your own homework) but you can start with

Code: Select all

docker exec -it <containername> /bin/bash 
This will get you in a shell in the docker container. From here you can do what you need to. Most are debian, and need apt-get install less nano or whatever program you are missing. Ping is missing from possibly all containers, so if you want to test routing via ping, you'll have to apt-get it.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
tlundste
Posts: 19
Joined: Sun Nov 15, 2020 3:41 am

Re: No Video, with "broken image" icon

Post by tlundste »

Yep... familiar with that exec -it command... it's how I got those netstat, and ifconfig outputs, above.
Yep... knew I could add in the ip utilities, but was trying to avoid that, trying to keep the containers as pristine as possible.
Yep... I'm an idiot... somewhere in all this process, my camera changed IPs (dhcp reservation incoming). I think I did initially have a problem with the install, somewhere, because of that "broken image" icon I would get.... but from the point where that disappeared, I was most likely getting "no route to host", and didn't realize it until late in the game, and then, didn't realize my camera's IP address changed. It's displaying now.
Thanks for the help... instruction... and hints that helped me learn much more than I planned, prior to fixing the PEBKAC issue.
Post Reply