What is Motion?: Motion is a deamon application which allows Linux users to record pictures of webcams and ipcams based on motion detection or time settings. A Tutorial how to set up the stable release can be found here. Here is the Motion developer website and documentation
My Setup: I'm using a cheap Hikvision 2032 IP-camera, which is set to IP 192.168.1.199. Its mainstream (H264) is:
rtsp://192.168.1.199:554/ISAPI/streaming/channels/101?auth=YWRtaW46MTIzNDU=
(It is working fine in VLC)
As I've been told Motion unfortunately doesn't supports H264 in its current stable release (3.2.12). But the latest developers build has some integration and that there is a fork which is optimized for it.
The installation of the builds is highly complicated though and I try to collect the tips I get in step-by-step instructions in my posting below:
Edit: At this stage I've downloaded the Git Version MrDave recommended me below and I think I have all dependencies. After following the steps in my collected instructions it finally works at 1080x720 resolution.
I have the problem to save files to my images folder when using 1920x1080:
nuc@nuc:/usr/local/etc$ motion
[0] [NTC] [ALL] conf_load: Processing thread 0 - config file /usr/local/etc/motion.conf
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "sdl_threadnr"
[0] [NTC] [ALL] motion_startup: Motion trunkREVUNKNOWN Started
[0] [NTC] [ALL] motion_startup: Logging to syslog
[0] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
[0] [NTC] [ENC] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3562596 LIBAVFORMAT_BUILD 3555176
[0] [NTC] [ALL] main: Thread 1 is from /usr/local/etc/motion.conf
[0] [NTC] [ALL] main: Thread 1 is device: rtsp://192.168.1.199:554/ISAPI/streaming/channels/101?auth=YWRtaW46MTIzNDU= input -1
[0] [NTC] [ALL] main: Stream port 8081
[0] [NTC] [ALL] main: Waiting for threads to finish, pid: 9028
[1] [NTC] [ALL] motion_init: Thread 1 started , motion detection Enabled
[1] [ALR] [NET] netcam_start: Network Camera thread starting... for url (rtsp://192.168.1.199:554/ISAPI/streaming/channels/101?auth=YWRtaW46MTIzNDU=)
[0] [NTC] [STR] httpd_run: motion-httpd testing : IPV4 addr: 127.0.0.1 port: 8080
[0] [NTC] [STR] httpd_run: motion-httpd Bound : IPV4 addr: 127.0.0.1 port: 8080
[0] [NTC] [STR] httpd_run: motion-httpd/trunkREVUNKNOWN running, accepting connections
[0] [NTC] [STR] httpd_run: motion-httpd: waiting for data on 127.0.0.1 port TCP 8080
[1] [NTC] [NET] netcam_rtsp_open_context: Using tcp transport
[1] [NTC] [NET] netcam_connect_rtsp: Camera connected
[1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
[1] [ALR] [NET] netcam_handler_loop: Camera handler thread [2] started
[1] [NTC] [STR] http_bindsock: motion-stream testing : IPV4 addr: 127.0.0.1 port: 8081
[1] [NTC] [STR] http_bindsock: motion-stream Bound : IPV4 addr: 127.0.0.1 port: 8081
[1] [NTC] [ALL] motion_init: Started motion-stream server in port 8081 auth Disabled
Memoryaccesserror (core image written).
The avi and jpg in full resolution are empty or not availabe if I try to open.