ffmpeg with rtsp not working
Posted: Thu Jan 03, 2019 9:51 pm
Before I had a Zoneminder setup running with Ubuntu 16.04 and some cheap Digoo MQ1 wifi camera's
This seemed to work perfectly, just follow the onvif wizard and the connection was made easy peasy.
Now with Ubuntu 18.04 things are different. Since it was impossible to use the old zoneminder from 16.04 while I installed it, I decided to start using the development branch/ppa. Which I'm still using today.
Unfortunately I'm not able to make to use the camera with ffmpeg
I also tried upgrading ffmpeg to version 4, without any results.
I know ffmpeg works because I can dump a video from my wifi cam like this:
which results in a perfect video.
When I make the simple switch to libvlc I can get an image and it works.
Unfortunately libvlc is sensitive to some connection drops, which seems to occur every now and then, they are cheap wifi camera's in the end
When the connection drops libvlc doesn't seem to recover (the video will be stuck on the last successful frame) while ffmpeg (at least in my past Ubuntu 16.04 installation) keeps working.
The log, with debugging turned on in the options looks like this:
Any idea how I can solve this situation?
If any other information is required I'd gladly supply it.
This seemed to work perfectly, just follow the onvif wizard and the connection was made easy peasy.
Now with Ubuntu 18.04 things are different. Since it was impossible to use the old zoneminder from 16.04 while I installed it, I decided to start using the development branch/ppa. Which I'm still using today.
Unfortunately I'm not able to make to use the camera with ffmpeg
I also tried upgrading ffmpeg to version 4, without any results.
I know ffmpeg works because I can dump a video from my wifi cam like this:
Code: Select all
ffmpeg -i rtsp://admin:password@192.168.1.12:554/onvif1 -vcodec copy -r 60 -y /mnt/usb/video-dump.mp4
When I make the simple switch to libvlc I can get an image and it works.
Unfortunately libvlc is sensitive to some connection drops, which seems to occur every now and then, they are cheap wifi camera's in the end
When the connection drops libvlc doesn't seem to recover (the video will be stuck on the last successful frame) while ffmpeg (at least in my past Ubuntu 16.04 installation) keeps working.
The log, with debugging turned on in the options looks like this:
Code: Select all
2019-01-03 22:47:01.482724 zmc_m2[9819].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://admin:password@192.168.1.12:554/onvif1]
2019-01-03 22:46:51.478894 zmc_m2[9819].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
2019-01-03 22:46:51.473555 zmc_m2[9819].ERR-zm_ffmpeg_camera.cpp/357 [Unable to open input rtsp://admin:password@192.168.1.12:554/onvif1 due to: Connection timed out]
2019-01-03 22:46:51.466681 zmc_m2[9819].WAR-zm_ffmpeg.cpp/64 [Nonmatching transport in server reply
]
2019-01-03 22:46:51.329016 zmc_m2[9819].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://admin:password@192.168.1.12:554/onvif1]
2019-01-03 22:46:47.630470 zmfilter_2[6752].INF-zmfilter.pl [Checking filter Update DiskSpace update disk space returned 0 events ]
2019-01-03 22:46:47.462280 zmfilter_1[6747].INF-zmfilter.pl [Checking filter PurgeWhenFull delete returned 0 events ]
2019-01-03 22:46:41.324426 zmc_m2[9819].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
2019-01-03 22:46:41.316620 zmc_m2[9819].ERR-zm_ffmpeg_camera.cpp/357 [Unable to open input rtsp://admin:password@192.168.1.12:554/onvif1 due to: Connection timed out]
2019-01-03 22:46:41.309643 zmc_m2[9819].WAR-zm_ffmpeg.cpp/64 [Nonmatching transport in server reply
]
2019-01-03 22:46:41.170769 zmc_m2[9819].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://admin:password@192.168.1.12:554/onvif1]
2019-01-03 22:46:31.165765 zmc_m2[9819].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
2019-01-03 22:46:31.158749 zmc_m2[9819].ERR-zm_ffmpeg_camera.cpp/357 [Unable to open input rtsp://admin:password@192.168.1.12:554/onvif1 due to: Connection timed out]
2019-01-03 22:46:31.153525 zmc_m2[9819].WAR-zm_ffmpeg.cpp/64 [Nonmatching transport in server reply
]
2019-01-03 22:46:31.009541 zmc_m2[9819].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://admin:password@192.168.1.12:554/onvif1]
2019-01-03 22:46:21.005630 zmc_m2[9819].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
2019-01-03 22:46:21.000231 zmc_m2[9819].ERR-zm_ffmpeg_camera.cpp/357 [Unable to open input rtsp://admin:password@192.168.1.12:554/onvif1 due to: Connection timed out]
2019-01-03 22:46:20.993562 zmc_m2[9819].WAR-zm_ffmpeg.cpp/64 [Nonmatching transport in server reply
If any other information is required I'd gladly supply it.