(segfault) Failed to create avi file, segmentation fault
Question
I have installed motion Version trunkREV561 on Xubuntu 14.04.
Tested configuration with one (and two) IP camera(s) using snapshot jpg's. Motion seems to start properly. It can save snapshot images (motion.conf/snapshot_interval). Mini-http server is working too.
However motion detection causes crash i think. It creates zero length avi file and console message says: Segmentation fault (core dumped)
Attached configuration output, make output and config files.
*** system log
name@name-desktop:/home$ dmesg | grep motion
[ 1405.801896] motion[2286]: segfault at 0 ip 08145a8d sp b6cdfe40 error 6 in motion[8048000+939000]
[ 7849.015633] motion[6467]: segfault at 0 ip 08145a8d sp b6d27e40 error 6 in motion[8048000+939000]
[10974.365614] motion[6737]: segfault at 0 ip 08145a8d sp b756ee40 error 6 in motion[8048000+939000]
[11241.335469] motion[6784]: segfault at 0 ip 08145a8d sp b74b3e40 error 6 in motion[8048000+939000]
*** end of the motion.log
[1] [DBG] [NET] [Jul 12 10:57:56] netcam_read_html_jpeg: Calculated frame time 592329.000000
[1] [NTC] [NET] [Jul 12 10:57:56] netcam_read_html_jpeg: disconnecting netcam since keep-alive not set.
[1] [INF] [NET] [Jul 12 10:57:56] netcam_init_jpeg: ***new pic delay successful***
[1] [NTC] [NET] [Jul 12 10:57:56] netcam_read_html_jpeg: leaving netcam connected.
[1] [INF] [NET] [Jul 12 10:57:56] netcam_connect: disconnecting netcam since keep-alive not set.
[1] [INF] [NET] [Jul 12 10:57:56] netcam_init_jpeg: jpeg_error 0
[1] [INF] [NET] [Jul 12 10:57:56] netcam_connect: with no keepalive, new socket created fd 5
[1] [INF] [NET] [Jul 12 10:57:56] netcam_connect: re-using socket 5 since keepalive is set.
[1] [INF] [NET] [Jul 12 10:57:56] netcam_image_conv: jpeg_error 0
[1] [DBG] [ALL] [Jul 12 10:57:56] alg_labeling: Label: 2 (0) Size: 735 (42,434)
[1] [DBG] [ALL] [Jul 12 10:57:56] alg_labeling: Label: 3 (1) Size: 199 (51,436)
[1] [DBG] [ALL] [Jul 12 10:57:56] alg_labeling: Label: 4 (2) Size: 207 (46,464)
[1] [DBG] [ALL] [Jul 12 10:57:56] alg_labeling: Label: 5 (3) Size: 21 (60,469)
[1] [DBG] [ALL] [Jul 12 10:57:56] alg_labeling: 2 Labels found. Largest connected Area: 735 Pixel(s). Largest Label: 4
[1] [DBG] [ALL] [Jul 12 10:57:56] motion_loop: Setup post capture 0
[1] [NTC] [EVT] [Jul 12 10:57:56] event_new_video FPS 1
[1] [INF] [ENC] [Jul 12 10:57:56] ffmpeg_open FPS 2
[1] [INF] [ENC] [Jul 12 10:57:56] ffmpeg_avcodec_log: intra_quant_bias = 0 inter_quant_bias = -64
- flag 48
Edit:
I found the error place. It occurs at line 325 in ffmpeg-2.2.4/libavformat/mux.c
s->internal->nb_interleaved_streams++;
where s has type
AVFormatContext and s->internal is NULL
Environment
Motion version: |
trunkREV561 |
ffmpeg version: |
2.2.4 |
Libraries: |
ffmpeg |
Server OS: |
Xubuntu 14.04, kernel 3.13.0-24-generic |
--
HannuLaurikainen - 12 Jul 2014
Answer
This usually caused by ffmpeg libraries installed. Try compile latest ffmpeg from sources and then compile motion with the fresh ffmpeg. You can specify path to new ffmpeg builld using this command:
./configure --with-ffmpeg=/path/to/ffmpeg/compiled
Is it still crashes, please attach full motion log here
--
TosiaraT - 28 Sep 2014