Page 1 of 1

"The device is using a codec that may not be supported." and "out of sequence" after upgrade from 1.30

Posted: Thu May 31, 2018 10:34 am
by Warudo
Hello everyone,

I'm using a Raspberry Pi as a camera.
The camera settings on the RPi are

Code: Select all

v4l2-ctl -c scene_mode=8 -c exposure_dynamic_framerate=1
I stream the video using h264_v4l2_rtspserver with the following options:

Code: Select all

h264_v4l2_rtspserver -W 1296 -H 972 -F 10 -P 554 /dev/video0
The video stream can be tested with a video player, for example with mpv:

Code: Select all

mpv rtsp://[rpi_ip]/unicast
This setup works with 1.30.4 using Source: Remote, Remote Protocol: RTSP, Remote Method: RTSP/Unicast (see attached monitor settings).
But when using 1.31.44, zmc crashes with one of the following errors (see attached Log 1 and Log 2):
  • The device is using a codec that may not be supported. Do not be surprised if things don't work. -> Unable to locate video stream -> 'zmc -m X' exited abnormally, exit status 255
  • The device is using a codec that may not be supported. Do not be surprised if things don't work. -> Sequence in probation 1/2, out of sequence -> 'zmc -m X' exited abnormally, exit status 255
But I can't use 1.30.4 anymore either because of this issue.

It works when using Source: ffmpeg, but the image gets corrupted (lots of blocking and color artefacts), even though mpv also uses ffmpeg and the image is fine.

Re: "The device is using a codec that may not be supported." and "out of sequence" after upgrade from 1.30

Posted: Fri Jun 01, 2018 7:07 am
by mathijss
I don't know a solution to your problem, but I'm using a Raspberry Pi as camera aswell, and I use UV4L RaspiCam to stream it to my server. It can stream in h264 and works without any problems.

Could be worth a try!

Re: "The device is using a codec that may not be supported." and "out of sequence" after upgrade from 1.30

Posted: Fri Jun 01, 2018 11:31 pm
by Warudo
I'm using Arch Linux ARM on the Pi and that isn't packaged. I can't find the source code of that project to compile it anywhere either.

I also noticed another problem with ffmpeg.
At night, when the framerate is reduced to about 1 by exposure_dynamic_framerate=1 to adjust for long exposure times, zmc is killed before it can gather enough frames to recognize that there is in fact a video stream. Can this timeout be adjusted so zmc waits longer?

Re: "The device is using a codec that may not be supported." and "out of sequence" after upgrade from 1.30

Posted: Sun Aug 19, 2018 1:56 pm
by Warudo
I tried UV4L now but it doesn't help either.

I can't use the uv4l-server it ships with to stream because it uses too much memory. I have a Raspberry Pi 1 Model B and even with a 64MB GPU / 192MB system RAM split uv4l gets oom-killed because it attempts to use more than 160MB and the system processes use ~35MB RAM.

I uninstalled uv4l-server and tried to use cvlc to stream with uv4l-raspicam as mentioned here, but frankly VLCs streaming support is a clusterfuck.

Using the first method mentioned in the tutorial it just segfaults.
Using the second method it gets a stream up and running, although it also gets close to getting oom-killed.

I can access it using a VLC client with "vlc rtsp://[camera-ip]:8554/".

But every other client fails. Using mpv fails with "461 Client error" for example.
Using Zoneminder with ffmpeg results in:

Code: Select all

zmc_m3[26595].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://[camera-ip]:8554/]
zmc_m3[26595].ERR-zm_ffmpeg_camera.cpp/355 [Unable to open input rtsp://[camera-ip]:8554/ due to: Operation now in progress]
 zmc_m3[26595].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
Since VLC can access the stream on my PC, I tried to use Zoneminder with libvlc, but it also segfaults:

Code: Select all

zmc_m3[16671].INF-zm_libvlc_camera.cpp/160 [Priming capture from rtsp://[camera-ip]:8554/]
zmc_m3[16671].INF-zm_signal.cpp/40 [Got signal 15 (Terminated), exiting]
zmc_m3[16690].ERR-zm_signal.cpp/81 [Signal address is (nil), from 0x55e2b70aa17c]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 0: /usr/bin/zmc(_Z14zm_die_handleriP9siginfo_tPv+0x7c) [0x55e2b70b8f2c]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 1: /usr/lib/libpthread.so.0(+0x123c0) [0x7fbcaef673c0]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 2: /usr/bin/zmc(_ZN6SocketD1Ev+0x2c) [0x55e2b70aa17c]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 3: /usr/lib/vlc/plugins/access/liblive555_plugin.so(_ZN9GroupsockD0Ev+0xa) [0x7fbc953a058a]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 4: /liblive555_plugin.so(_ZN15MediaSubsession10deInitiateEv+0x54) [0x7fbc95375844]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 5: /usr/lib/vlc/plugins/access/liblive555_plugin.so(_ZN15MediaSubsessionD1Ev+0x18) [0x7fbc95375898]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 6: /usr/lib/vlc/plugins/access/liblive555_plugin.so(_ZN15MediaSubsessionD0Ev+0xa) [0x7fbc9537598a]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 7: /usr/lib/vlc/plugins/access/liblive555_plugin.so(_ZN12MediaSessionD1Ev+0x21) [0x7fbc95374a51]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 8: /usr/lib/vlc/plugins/access/liblive555_plugin.so(_ZN12MediaSessionD0Ev+0xa) [0x7fbc95374aea]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 9: /usr/lib/vlc/plugins/access/liblive555_plugin.so(+0x4e2fb) [0x7fbc953602fb]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 10: /usr/lib/libvlccore.so.9(vlc_module_unload+0x9e) [0x7fbca506c56e]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 11: /usr/lib/libvlccore.so.9(demux_Delete+0xe) [0x7fbca50902ce]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 12: /usr/lib/libvlccore.so.9(+0x61dfa) [0x7fbca509edfa]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 13: /usr/lib/libvlccore.so.9(+0x62a05) [0x7fbca509fa05]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 14: /usr/lib/libvlccore.so.9(+0x69d2e) [0x7fbca50a6d2e]]
zmc_m3[16690].ERR-zm_signal.cpp/102 [Backtrace 15: /usr/lib/libpthread.so.0(+0x7a9d) [0x7fbcaef5ca9d]]
And everything used to be so nice in 1.30.4. :(

Re: "The device is using a codec that may not be supported." and "out of sequence" after upgrade from 1.30

Posted: Sun Aug 19, 2018 2:16 pm
by iconnor
Don't use the remote monitor type. Use the ffmpeg type.

Re: "The device is using a codec that may not be supported." and "out of sequence" after upgrade from 1.30

Posted: Sun Aug 19, 2018 2:19 pm
by Warudo
As I said, I can't use ffmpeg because:
Warudo wrote: Fri Jun 01, 2018 11:31 pmAt night, when the framerate is reduced to about 1 by exposure_dynamic_framerate=1 to adjust for long exposure times, zmc is killed before it can gather enough frames to recognize that there is in fact a video stream.

Re: "The device is using a codec that may not be supported." and "out of sequence" after upgrade from 1.30

Posted: Sun Aug 19, 2018 6:35 pm
by bbunge
Warudo wrote: Sun Aug 19, 2018 2:19 pm As I said, I can't use ffmpeg because:
Warudo wrote: Fri Jun 01, 2018 11:31 pmAt night, when the framerate is reduced to about 1 by exposure_dynamic_framerate=1 to adjust for long exposure times, zmc is killed before it can gather enough frames to recognize that there is in fact a video stream.
Shorten the key frame interval to send a full frame more often.

Re: "The device is using a codec that may not be supported." and "out of sequence" after upgrade from 1.30

Posted: Sat Aug 25, 2018 9:12 am
by Warudo
bbunge wrote: Sun Aug 19, 2018 6:35 pmShorten the key frame interval to send a full frame more often.
Thanks, that solved the problem.

You can do this on an RPi with v4l2-ctl -c h264_i_frame_period=5.

Re: "The device is using a codec that may not be supported." and "out of sequence" after upgrade from 1.30

Posted: Wed Sep 05, 2018 8:46 pm
by Warudo
I'm still having problems with this.
While I can connect to h264_v4l2_rtspserver like this, ZM loses the connection every 10-30 seconds during sunrise and sunset, even with exposure_dynamic_framerate=0. I get full length segments when the lighting conditions don't change.

Meanwhile I even bought a RPi2 to try out uv4l. But Zoneminders ffmpeg can't sucessfully connect to that software either.

I can once again connect to uv4l-server using mpv ( mpv http://[camera-ip]/stream/video.h264 ) - which also uses ffmpeg - or with vlc (vlc http://[camera-ip]/stream/video.h264 --demux h264 ).

But Zoneminder throws an "swscale does not support the codec format" error.
I have set it to ffmpeg, TCP, with http://[camera-ip]/stream/video.h264 as the url with uv4l-server running on port 80.

Here is a debug log from zmc:

Code: Select all

09/05/18 22:27:54.311939 zmc_m3[21138].DB3-zm_monitor.cpp/623 [Success connecting]
09/05/18 22:27:54.337082 zmc_m3[21138].DB1-zm_monitor.cpp/492 [Monitor Kuechenfenster has function 2]
09/05/18 22:27:54.337170 zmc_m3[21138].DB1-zm_monitor.cpp/493 [Monitor Kuechenfenster LBF = '%N - %d.%m.%y %H:%M:%S', LBX = 0, LBY = 0, LBS = 2]
09/05/18 22:27:54.337186 zmc_m3[21138].DB1-zm_monitor.cpp/494 [Monitor Kuechenfenster IBC = 20, WUC = 0, pEC = 0, PEC = 5, EAF = 1, FRI = 1000, RBP = 6, ARBP = 6, FM = 0]
09/05/18 22:27:54.337986 zmc_m3[21138].DB1-zm_zone.cpp/842 [Got 1 zones for monitor Kuechenfenster]
09/05/18 22:27:54.338058 zmc_m3[21138].DB3-zm_zone.cpp/717 [Parsing polygon string '0,0 639,0 639,479 0,479']
09/05/18 22:27:54.338074 zmc_m3[21138].DB3-zm_zone.cpp/749 [Got coordinate 0,0 from polygon string]
09/05/18 22:27:54.338088 zmc_m3[21138].DB3-zm_zone.cpp/749 [Got coordinate 639,0 from polygon string]
09/05/18 22:27:54.338101 zmc_m3[21138].DB3-zm_zone.cpp/749 [Got coordinate 639,479 from polygon string]
09/05/18 22:27:54.338113 zmc_m3[21138].DB3-zm_zone.cpp/749 [Got coordinate 0,479 from polygon string]
09/05/18 22:27:54.338129 zmc_m3[21138].DB3-zm_zone.cpp/769 [Successfully parsed polygon string]
09/05/18 22:27:54.341803 zmc_m3[21138].DB1-zm_monitor.cpp/2321 [Loaded monitor 3(Kuechenfenster), 1 zones]
09/05/18 22:27:54.341843 zmc_m3[21138].INF-zmc.cpp/223 [Starting Capture version 1.31.45]
09/05/18 22:27:54.348107 zmc_m3[21138].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from http://[camera-ip]/stream/video.h264]
09/05/18 22:27:54.356611 zmc_m3[21138].DB1-zm_ffmpeg_camera.cpp/342 [Calling avformat_open_input for http://[camera-ip]/stream/video.h264]
09/05/18 22:27:54.778439 zmc_m3[21138].WAR-zm_ffmpeg_camera.cpp/370 [Option rtsp_transport not recognized by ffmpeg]
09/05/18 22:27:54.785110 zmc_m3[21138].DB1-zm_ffmpeg_camera.cpp/374 [Opened input]
09/05/18 22:27:54.785209 zmc_m3[21138].INF-zm_ffmpeg_camera.cpp/376 [Stream open http://[camera-ip]/stream/video.h264, parsing streams...]
09/05/18 22:27:54.793145 zmc_m3[21138].DB3-zm_ffmpeg_camera.cpp/434 [Unable to locate audio stream in http://[camera-ip]/stream/video.h264]
09/05/18 22:27:54.793228 zmc_m3[21138].DB3-zm_ffmpeg_camera.cpp/436 [Found video stream at index 0]
09/05/18 22:27:54.793243 zmc_m3[21138].DB3-zm_ffmpeg_camera.cpp/437 [Found audio stream at index -1]
09/05/18 22:27:54.793277 zmc_m3[21138].DB1-zm_ffmpeg_camera.cpp/512 [Video Found decoder mjpeg]
09/05/18 22:27:54.793292 zmc_m3[21138].DB1-zm_ffmpeg.cpp/266 [Dumping stream index i(0) index(0)]
09/05/18 22:27:54.793306 zmc_m3[21138].DB1-zm_ffmpeg.cpp/271 [    Stream #0:0]
09/05/18 22:27:54.793319 zmc_m3[21138].DB1-zm_ffmpeg.cpp/279 [, frames:0, timebase: 1/25]
09/05/18 22:27:54.793335 zmc_m3[21138].DB1-zm_ffmpeg.cpp/281 [: Video: mjpeg, none(bt470bg/unknown/unknown)]
09/05/18 22:27:54.793349 zmc_m3[21138].DB3-zm_ffmpeg.cpp/306 [
]
09/05/18 22:27:54.793363 zmc_m3[21138].DB1-zm_ffmpeg.cpp/227 [25 stream tb numerator , ]
09/05/18 22:27:54.793386 zmc_m3[21138].DB1-zm_ffmpeg.cpp/227 [25 codec time base:]
09/05/18 22:27:54.793401 zmc_m3[21138].DB1-zm_ffmpeg.cpp/336 [
]
09/05/18 22:27:54.793413 zmc_m3[21138].DB1-zm_ffmpeg_camera.cpp/519 [Calling avcodec_open2]
09/05/18 22:27:54.793533 zmc_m3[21138].DB1-zm_ffmpeg_camera.cpp/542 [HWACCEL not in use]
09/05/18 22:27:54.793552 zmc_m3[21138].DB3-zm_ffmpeg_camera.cpp/582 [Allocated frames]
09/05/18 22:27:54.793568 zmc_m3[21138].DB1-zm_ffmpeg_camera.cpp/598 [Calling sws_isSupportedInput]
09/05/18 22:27:54.793589 zmc_m3[21138].ERR-zm_ffmpeg_camera.cpp/600 [swscale does not support the codec format: ÿÿÿÿ]
09/05/18 22:27:54.799998 zmc_m3[21138].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
It seems like ffmpeg interprets h264-over-http as mjpeg, which is wrong.

mathijss, can you please tell me how you set up Zoneminder to access uv4ls /stream/video.h264 stream?


Zoneminders ffmpeg does work with the uv4l mjpeg stream ( http://[camera-ip]/stream/video.mjpeg ), but that murders my WiFi bandwidth at high resolutions.