MotionEye shows a strange video image after some running time

Q: The problem shows up in the fact that at first all pictures are displayed perfectly, but after a while the pictures of the IN5907 as well as the 6014 become "psychedelic": it is a multitude of colours that makes it impossible to recognise the picture.

MotionEye dropped keyframes

A: The problem with the video from the HD cameras in MotionEye is related to the transmission of the RTSP stream. Such image distortions or colour distortions are caused by the loss of keyframes, which are required by the H264 codec to correctly display a compressed sequence of frames.

The RTSP protocol provides that a client can establish the connection either via UDP or TCP. The common libraries for RTSP clients use UDP transmission as the default (if available). This can cause the problem mentioned above, as it is a protocol without any error correction or retransmission of lost network packets.

The HD cameras support both RTSP via UDP and TCP, the FHD cameras only TCP and no UDP. Which protocol is used for RTSP depends on the client (i.e. the software). In the VLC player, the picture should also show this behaviour after a certain time, as you also have to configure the settings there to force RTSP via TCP.

MotionEye dropped keyframes

In MotionEye, when adding the camera via the RTSP stream - for example:

  • rtsp://192.168.2.116/11
  • rtsp://192.168.2.116/12
  • rtsp://192.168.2.116/13

It is recommended to use the middle stream /12.

Add and use the TCP camera preset.

Another possibility is to set this in motion via the configuration file with rtsp_uses_tcp or netcam_use_tcp:

However, if motioneye was installed via an image (motioneyeos), the partition is "read-only" and changing motioneye.conf is not possible. To change the file, you must remount the two partitions boot and root as writable:

mount -o remount,rw /
mount -o remount,rw /boot