Send Motion-user mailing list submissions to
        motion-user@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        motion-user-requ...@lists.sourceforge.net

You can reach the person managing the list at
        motion-user-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. RTSP problem on Raspberry Pi 3 with both motion 4.2.2 and
      latest github master versions (Pascal F. Martin)


----------------------------------------------------------------------

Message: 1
Date: Mon, 2 Sep 2019 21:51:25 -0700
From: "Pascal F. Martin" <pascal.fb.mar...@gmail.com>
To: motion-user@lists.sourceforge.net
Subject: [Motion-user] RTSP problem on Raspberry Pi 3 with both motion
        4.2.2 and latest github master versions
Message-ID: <46599814-961c-d342-f55e-8027f2296...@gmail.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

I experienced a problem similar to issue #986 with motion 4.2.2 and RTSP 
cameras ("could not fetch initial image from camera"). I am using 
raspbian 9.9 (up-to-date) with a motion 4.2.2 rebuilt from sources. I 
decided to clone the github repository, built motion from master and 
restarted it. Now motion tells me that the cameras are active (but no 
image), and then change to "Lost connection" after a short delay.


The reason why motion fails the video stream might be a timeout (see 
below). If I want to tinker with the motion's timeout, where should I look?


The two cameras are the Alptop AT-200B model. I can access each camera 
through VLC using the same rstp URL, and the image shows up quickly. 
When using ffplay, the output is as follow:

$ ffplay -rtsp_transport tcp rtsp://motion:H9B1Dm@192.168.0.211/stream1
ffplay version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2003-2019 the FFmpeg 
developers
 ? built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
 ? configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' 
--toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf 
--incdir=/usr/include/arm-linux-gnueabihf --enable-gpl 
--disable-stripping --enable-avresample --enable-avisynth 
--enable-gnutls --enable-ladspa --enable-libass --enable-libbluray 
--enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 
--enable-libflite --enable-libfontconfig --enable-libfreetype 
--enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame 
--enable-libopenjpeg --enable-libopenmpt --enable-libopus 
--enable-libpulse --enable-librubberband --enable-libshine 
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh 
--enable-libtheora --enable-libtwolame --enable-libvorbis 
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 
--enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx 
--enable-omx-rpi --enable-mmal --enable-openal --enable-opengl 
--enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf 
--enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 
--enable-shared
 ? libavutil????? 55. 34.101 / 55. 34.101
 ? libavcodec???? 57. 64.101 / 57. 64.101
 ? libavformat??? 57. 56.101 / 57. 56.101
 ? libavdevice??? 57.? 1.100 / 57.? 1.100
 ? libavfilter???? 6. 65.100 /? 6. 65.100
 ? libavresample?? 3.? 1.? 0 /? 3.? 1.? 0
 ? libswscale????? 4.? 2.100 /? 4.? 2.100
 ? libswresample?? 2.? 3.100 /? 2.? 3.100
 ? libpostproc??? 54.? 1.100 / 54.? 1.100
 ??? nan??? :? 0.000 fd=?? 0 aq=??? 0KB vq=??? 0KB sq=??? 0B f=0/0

It stays like this for /3//minutes/, then a windows opens that displays 
the image, with these additional output on the console:

[rtsp @ 0x68300490] Stream #0: not enough frames to estimate rate; 
consider increasing probesize
Input #0, rtsp, from 'rtsp://motion:H9B1DmHj@192.168.0.211/stream1':
 ? Metadata:
 ??? title?????????? : RTSP/RTP stream from anjvision ipcamera
 ? Duration: N/A, start: 0.000000, bitrate: N/A
 ??? Stream #0:0: Video: h264 (Main), yuvj420p(pc, progressive), 
640x360, 90k tbr, 90k tbn, 180k tbc
[swscaler @ 0x64756070] deprecated pixel format used, make sure you did 
set range correctly
[swscaler @ 0x6474aca0] deprecated pixel format used, make sure you did 
set range correctly
 ?? 3.90 M-V:? 3.591 fd= 974 aq=??? 0KB vq=??? 0KB sq=??? 0B f=1152/1152

This is a low resolution stream (640x480). It seems that the camera 
takes time to send data, or ffmpeg is confused by the first frames (but 
not VLC?).

(As a side note, I have the cameras on an isolated network only 
accessible from the RPI3, so VLC and ffplay run on the RPI3 through a 
ssh -X tunnel from my workstation.)


Versions of ffmpeg (dpkg -l | grep mpeg with raspbian 9.9):

ii? ffmpeg 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? Tools for 
transcoding, streaming and playing of multimedia files
ii? libavcodec-dev:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library with de/encoders for audio/video codecs - development files
ii? libavcodec57:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library with de/encoders for audio/video codecs - runtime files
ii? libavdevice-dev:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library for handling input and output devices - development files
ii? libavdevice57:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library for handling input and output devices - runtime files
ii? libavfilter-dev:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library containing media filters - development files
ii? libavfilter6:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library containing media filters - runtime files
ii? libavformat-dev:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library with (de)muxers for multimedia containers - development files
ii? libavformat57:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library with (de)muxers for multimedia containers - runtime files
ii? libavresample-dev:armhf 7:3.2.14-1~deb9u1+rpt1??????????? 
armhf??????? FFmpeg compatibility library for resampling - development files
ii? libavresample3:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg compatibility library for resampling - runtime files
ii? libavutil-dev:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library with functions for simplifying programming - development 
files
ii? libavutil55:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library with functions for simplifying programming - runtime files
ii? libmpeg2-4:armhf 0.5.1-7?????????????????????????? armhf??????? 
MPEG1 and MPEG2 video decoder library
ii? libpostproc-dev:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library for post processing - development files
ii? libpostproc54:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library for post processing - runtime files
ii? libswresample-dev:armhf 7:3.2.14-1~deb9u1+rpt1??????????? 
armhf??????? FFmpeg library for audio resampling, rematrixing etc. - 
development files
ii? libswresample2:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library for audio resampling, rematrixing etc. - runtime files
ii? libswscale-dev:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library for image scaling and various conversions - development files
ii? libswscale4:armhf 7:3.2.14-1~deb9u1+rpt1??????????? armhf??????? 
FFmpeg library for image scaling and various conversions - runtime files

I upgraded raspbian to buster, and rebuilt the latest motion with the 
new buster libraries: same behavior from both vlc (OK), ffplay (a few 
minutes delay) and motion (lost connection after a short while). The log 
from motion is then:

[0:motion] [NTC] [ALL] [Sep 02 21:37:21] main: Motion thread 1 restart
[0:motion] [NTC] [ALL] [Sep 02 21:37:21] motion_start_thread: Camera ID: 
11 is from /etc/motion/camera11.conf
[0:motion] [NTC] [ALL] [Sep 02 21:37:21] motion_start_thread: Camera ID: 
11 Camera Name: watch11 Service: rtsp:
[0:motion] [NTC] [ALL] [Sep 02 21:37:21] main: Motion thread 2 restart
[0:motion] [NTC] [ALL] [Sep 02 21:37:21] motion_start_thread: Camera ID: 
12 is from /etc/motion/camera12.conf
[1:ml1:watch11] [NTC] [ALL] [Sep 02 21:37:21] motion_init: Camera 11 
started: motion detection Enabled
[0:motion] [NTC] [ALL] [Sep 02 21:37:21] motion_start_thread: Camera ID: 
12 Camera Name: watch12 Service: rtsp:
[1:ml1:watch11] [NTC] [VID] [Sep 02 21:37:21] vid_start: Opening Netcam RTSP
[2:ml2:watch12] [NTC] [ALL] [Sep 02 21:37:21] motion_init: Camera 12 
started: motion detection Enabled
[2:ml2:watch12] [NTC] [VID] [Sep 02 21:37:21] vid_start: Opening Netcam RTSP
[1:ml1:watch11] [ERR] [NET] [Sep 02 21:37:42] netcam_rtsp_open_context: 
Normal resolution: Unable to find stream info: Success
[1:ml1:watch11] [NTC] [NET] [Sep 02 21:37:42] netcam_rtsp_cleanup: 
Normal resolution: Shut down complete.
[1:ml1:watch11] [ERR] [VID] [Sep 02 21:37:42] vid_start: Netcam RTSP 
failed to open
[1:ml1:watch11] [WRN] [ALL] [Sep 02 21:37:42] motion_init: Could not 
fetch initial image from camera
[1:ml1:watch11] [WRN] [ALL] [Sep 02 21:37:42] motion_init: Motion 
continues using width and height from config file(s)
[1:ml1:watch11] [CRT] [NET] [Sep 02 21:37:42] motion_init: Substream not 
available.? Image sizes not modulo 16.
[1:ml1:watch11] [NTC] [ALL] [Sep 02 21:37:42] image_ring_resize: 
Resizing pre_capture buffer to 1 items
[2:ml2:watch12] [ERR] [NET] [Sep 02 21:37:42] netcam_rtsp_open_context: 
Normal resolution: Unable to find stream info: Success
[2:ml2:watch12] [NTC] [NET] [Sep 02 21:37:42] netcam_rtsp_cleanup: 
Normal resolution: Shut down complete.
[2:ml2:watch12] [ERR] [VID] [Sep 02 21:37:42] vid_start: Netcam RTSP 
failed to open
[2:ml2:watch12] [WRN] [ALL] [Sep 02 21:37:42] motion_init: Could not 
fetch initial image from camera
[2:ml2:watch12] [WRN] [ALL] [Sep 02 21:37:42] motion_init: Motion 
continues using width and height from config file(s)
[2:ml2:watch12] [CRT] [NET] [Sep 02 21:37:42] motion_init: Substream not 
available.? Image sizes not modulo 16.
[2:ml2:watch12] [NTC] [ALL] [Sep 02 21:37:42] image_ring_resize: 
Resizing pre_capture buffer to 1 items
[1:ml1:watch11] [NTC] [ALL] [Sep 02 21:37:42] image_ring_resize: 
Resizing pre_capture buffer to 5 items
[2:ml2:watch12] [NTC] [ALL] [Sep 02 21:37:42] image_ring_resize: 
Resizing pre_capture buffer to 5 items
[1:ml1:watch11] [WRN] [ALL] [Sep 02 21:37:50] mlp_retry: Retrying until 
successful connection with camera


Thanks.

Pascal.

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 159, Issue 1
*******************************************

Reply via email to