Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg_avcodec_log: Too large number of skipped frames => segmentation fault #508

Closed
ghost opened this issue Sep 20, 2017 · 16 comments
Closed

Comments

@ghost
Copy link

ghost commented Sep 20, 2017

  1. version [x.y.z, hash, other]: 4.0
  2. installed as a package or compiled from sources [deb, rpm, git, other]: from raspbian strech apt-get
  3. standalone or part of third party [motion, MotionEyeOS, other]: standalone
  4. video stream source [V4L (card or USB), net cam (mjpeg, rtsp, other), mmal]: net cam
  5. hardware [x86, ARM, other]: Raspberry Pi 3
  6. operating system [Linux (which), FreeBSD, other]: Raspbian

I configured motion to record a video when an event start (mpeg4). If the event duration is short (let's say <1 min) everything is OK. But if the event is longer, after few minutes, motion crash with a segmentation fault.
I set the max_movie_time parameter to 180 (seconds) but it didn't change.

I have this problem on a fresh version of Raspbian Strech. With the sames config files I didn't have this problem with previous raspbian version (Jessie).
Thanks for your help.

camera2-dist.conf.txt
motion.conf.txt

Here the end of the log file:

[0:web_control] [NTC] [STR] [Sep 20 14:42:38] httpd_run: Started motion-httpd server on port 64652 (auth Enabled)
[1:ml1] [NTC] [NET] [Sep 20 14:42:38] netcam_setup_html: connected, going on to read image.
[1:ml1] [NTC] [ALL] [Sep 20 14:42:38] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:ml1] [NTC] [STR] [Sep 20 14:42:38] http_bindsock: listening on any IPv4 address port 64654
[1:ml1] [NTC] [ALL] [Sep 20 14:42:38] motion_init: Started motion-stream server on port 64654 (auth Enabled)
[1:ml1] [NTC] [ALL] [Sep 20 14:42:38] image_ring_resize: Resizing pre_capture buffer to 10 items
[1:ml1] [WRN] [NET] [Sep 20 14:42:38] netcam_next: called with no data in buffer
[1:nc1] [ALR] [NET] [Sep 20 14:42:38] netcam_handler_loop: Camera handler thread [3] started
[1:ml1] [NTC] [EVT] [Sep 20 14:42:38] event_ffmpeg_timelapse: Timelapse using mpeg4 codec.
[1:ml1] [NTC] [EVT] [Sep 20 14:42:38] event_ffmpeg_timelapse: Events will be trigger new files
[1:ml1] [NTC] [ENC] [Sep 20 14:42:38] ffmpeg_open Selected Output FPS 30
[1:ml1] [NTC] [ENC] [Sep 20 14:42:38] ffmpeg_avcodec_log: Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[1:ml1] [NTC] [EVT] [Sep 20 14:42:38] event_newfile: File of type 32 saved to: /home/pi/cam/timelapse-20170920-cam1.avi
[1:ml1] [NTC] [EVT] [Sep 20 14:52:34] event_new_video Source FPS 15
[1:ml1] [NTC] [ENC] [Sep 20 14:52:34] ffmpeg_open Selected Output FPS 15
[1:ml1] [NTC] [ENC] [Sep 20 14:52:34] ffmpeg_avcodec_log: Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[1:ml1] [NTC] [EVT] [Sep 20 14:52:34] event_newfile: File of type 8 saved to: /home/pi/cam/20170920_145234-cam1.avi
[1:ml1] [NTC] [ALL] [Sep 20 14:52:34] motion_detected: Motion detected - starting event 1
[1:ml1] [NTC] [ALL] [Sep 20 14:55:04] preview_save: different filename or picture only!
[1:ml1] [NTC] [EVT] [Sep 20 14:55:04] event_newfile: File of type 1 saved to: /home/pi/cam/CAM2_01-20170920145234-10.jpg
[1:ml1] [NTC] [ALL] [Sep 20 14:55:04] motion_loop: End of event 1
[1:ml1] [NTC] [EVT] [Sep 20 15:04:24] event_new_video Source FPS 15
[1:ml1] [NTC] [ENC] [Sep 20 15:04:24] ffmpeg_open Selected Output FPS 15
[1:ml1] [NTC] [ENC] [Sep 20 15:04:24] ffmpeg_avcodec_log: Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[1:ml1] [NTC] [EVT] [Sep 20 15:04:24] event_newfile: File of type 8 saved to: /home/pi/cam/20170920_150424-cam1.avi
[1:ml1] [NTC] [ALL] [Sep 20 15:04:24] motion_detected: Motion detected - starting event 2
[1:ml1] [ERR] [ENC] [Sep 20 15:06:49] ffmpeg_avcodec_log: Too large number of skipped frames 103072 > 60000
[1:ml1] [ERR] [ENC] [Sep 20 15:06:49] ffmpeg_put_frame: Error while writing video frame: No such file or directory

@tosiara
Copy link
Member

tosiara commented Sep 21, 2017

While we are investigating your issue please go and change your camera password. Also if you reused this password somewhere else - change it in other places too

@tosiara
Copy link
Member

tosiara commented Sep 21, 2017

Can you temporary disable any scripts you run by motion and try to reproduce again? Since you seem to be using some scripts that may be locking files. Let's see if that is related

@ghost
Copy link
Author

ghost commented Sep 21, 2017

Ok i will try and let you know...
Thanks

@ghost
Copy link
Author

ghost commented Sep 23, 2017

Hi,

I deactivated all the events actions (on_motion_start, on_picture_saved,...), but I still have the same problem.
Here's the log:

[0:motion] [NTC] [ALL] [Sep 22 21:29:00] motion_startup: Using log type (ALL) log level (NTC)
[0:motion] [NTC] [ENC] [Sep 22 21:29:00] ffmpeg_init: ffmpeg libavcodec version 57.48.101 libavformat version 57.41.100
[0:motion] [NTC] [ALL] [Sep 22 21:29:00] main: Camera 1 is from /etc/motion/camera2-dist.conf
[0:motion] [NTC] [ALL] [Sep 22 21:29:00] main: Camera 1 is device: http://192.168.1.149:80/video.cgi input -1
[0:motion] [NTC] [ALL] [Sep 22 21:29:00] main: Stream port 64654
[0:motion] [NTC] [ALL] [Sep 22 21:29:00] main: Waiting for threads to finish, pid: 5291
[1:ml1] [NTC] [ALL] [Sep 22 21:29:00] motion_init: Camera 1 started: motion detection Enabled
[1:ml1] [ALR] [NET] [Sep 22 21:29:00] netcam_start: Network Camera thread starting... for url (http://192.168.1.149:80/video.cgi)
[0:web_control] [NTC] [STR] [Sep 22 21:29:00] http_bindsock: listening on any IPv4 address port 64652
[0:web_control] [NTC] [STR] [Sep 22 21:29:00] httpd_run: Started motion-httpd server on port 64652 (auth Enabled)
[1:ml1] [NTC] [NET] [Sep 22 21:29:00] netcam_setup_html: connected, going on to read image.
[1:ml1] [NTC] [ALL] [Sep 22 21:29:01] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:nc1] [ALR] [NET] [Sep 22 21:29:01] netcam_handler_loop: Camera handler thread [3] started
[1:ml1] [NTC] [STR] [Sep 22 21:29:01] http_bindsock: listening on any IPv4 address port 64654
[1:ml1] [NTC] [ALL] [Sep 22 21:29:01] motion_init: Started motion-stream server on port 64654 (auth Enabled)
[1:ml1] [NTC] [ALL] [Sep 22 21:29:01] image_ring_resize: Resizing pre_capture buffer to 10 items
[1:ml1] [WRN] [NET] [Sep 22 21:29:01] netcam_next: called with no data in buffer
[1:ml1] [NTC] [EVT] [Sep 22 21:29:01] event_ffmpeg_timelapse: Timelapse using mpeg4 codec.
[1:ml1] [NTC] [EVT] [Sep 22 21:29:01] event_ffmpeg_timelapse: Events will be trigger new files
[1:ml1] [NTC] [ENC] [Sep 22 21:29:01] ffmpeg_open Selected Output FPS 30
[1:ml1] [NTC] [ENC] [Sep 22 21:29:01] ffmpeg_avcodec_log: Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[1:ml1] [NTC] [EVT] [Sep 22 21:29:01] event_newfile: File of type 32 saved to: /home/pi/cam/timelapse-20170922-cam1.avi
[1:ml1] [WRN] [NET] [Sep 22 21:29:01] netcam_next: called with no data in buffer
[1:ml1] [NTC] [EVT] [Sep 22 21:49:01] event_new_video Source FPS 10
[1:ml1] [NTC] [ENC] [Sep 22 21:49:01] ffmpeg_open Selected Output FPS 10
[1:ml1] [NTC] [ENC] [Sep 22 21:49:01] ffmpeg_avcodec_log: Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[1:ml1] [NTC] [EVT] [Sep 22 21:49:01] event_newfile: File of type 8 saved to: /home/pi/cam/20170922_214901-cam1.avi
[1:ml1] [NTC] [ALL] [Sep 22 21:49:01] motion_detected: Motion detected - starting event 1
[1:ml1] [NTC] [ALL] [Sep 22 21:51:11] preview_save: different filename or picture only!
[1:ml1] [NTC] [EVT] [Sep 22 21:51:11] event_newfile: File of type 1 saved to: /home/pi/cam/CAM2_01-20170922214902-03.jpg
[1:ml1] [NTC] [ALL] [Sep 22 21:51:11] motion_loop: End of event 1
[1:ml1] [NTC] [EVT] [Sep 22 22:02:14] event_new_video Source FPS 10
[1:ml1] [NTC] [ENC] [Sep 22 22:02:14] ffmpeg_open Selected Output FPS 10
[1:ml1] [NTC] [ENC] [Sep 22 22:02:14] ffmpeg_avcodec_log: Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[1:ml1] [NTC] [EVT] [Sep 22 22:02:14] event_newfile: File of type 8 saved to: /home/pi/cam/20170922_220214-cam1.avi
[1:ml1] [NTC] [ALL] [Sep 22 22:02:14] motion_detected: Motion detected - starting event 2
[1:ml1] [ERR] [ENC] [Sep 22 22:03:41] ffmpeg_avcodec_log: Too large number of skipped frames 73943 > 60000
[1:ml1] [ERR] [ENC] [Sep 22 22:03:41] ffmpeg_put_frame: Error while writing video frame: No such file or directory

Thanks

@Mr-Dave
Copy link
Member

Mr-Dave commented Sep 23, 2017

Disabling the timelapse feature in the configuration file should eliminate the reported problem of Too large number of skipped.... This problem is resolved in the current master.

@ghost
Copy link
Author

ghost commented Sep 24, 2017

Thanks for your help.
I installed the last master version and for the moment it works well!

@ghost ghost closed this as completed Sep 24, 2017
@ghost ghost reopened this Sep 24, 2017
@ghost ghost closed this as completed Sep 24, 2017
@ghost
Copy link
Author

ghost commented Sep 26, 2017

Hello,

After few tries, I'm facing the same issue... I disabled the timelapse recording but it didn't change anything.
If the event duration is more than 1 or 2 minutes, it crashed with a segmentation fault and "ffmpeg_avcodec_log: Too large number of skipped frames xxxxxxx > 60000".

@ghost ghost reopened this Sep 26, 2017
@tosiara
Copy link
Member

tosiara commented Sep 26, 2017

Can you run motion with highest possible logging -d 9 and provide at least 50 last lines?

@Mr-Dave
Copy link
Member

Mr-Dave commented Sep 27, 2017

When you have the log, can you make sure that you are for sure using the updated git version?

If the code is reporting
[1:ml1] [**ERR**] [ENC] [Sep 20 15:06:49] ffmpeg_avcodec_log:..... this is from the 4.0.1 version which had the bug.

If the log is reporting the issue as
[1:ml1] **[INF]** [ENC] [Sep 20 15:06:49] ffmpeg_avcodec_log:.....
It is from a recent version of the git master. Note how the message level was ERR and is now INF.

If it is running the current git master code, in addition to the log request, we'll also need to know:

  • The codec specified and max_movie_time
  • The pre/post capture rates
  • Whether the camera lost connection in the middle of the capture
  • Confirmation that the rest of the log has no references to timelapse.

@ghost
Copy link
Author

ghost commented Sep 27, 2017

The installed version has been downloaded from: https://github.com/Motion-Project/motion/releases, file :pi_stretch_motion_4.0.1-1_armhf.deb
In the log I could see: [1:ml1] [NTC] [ENC] [Sep 27 11:11:26] ffmpeg_avcodec_log:
The log level seems to be "NTC", normal ?

Here's the current config file and a zip of a full log:
motionLog.zip
motion.conf.txt

ffmpeg_video_codec mpeg4
max_movie_time 180
pre_capture 0
post_capture 50

Theres is no connection problem in the log, no timelapse and no event action...

Thanks for your help

@tosiara
Copy link
Member

tosiara commented Sep 27, 2017

Can you compile the latest version? https://codeload.github.com/Motion-Project/motion/zip/master

@ghost
Copy link
Author

ghost commented Sep 27, 2017

Ok I will try, but I never done that on my pi...
Do you mean that the strech package I installed is not the same as the master version ?

@ghost
Copy link
Author

ghost commented Sep 29, 2017

Yesterday I tried to follow thisguide to compile a version: http://htmlpreview.github.io/?https://github.com/Motion-Project/motion/blob/master/motion_guide.html
But when I run the command: sudo apt-get install autoconf automake build-essential pkgconf libtool libzip-dev libjpeg62 libjpeg62-dev git libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev
the package manager wants to remove allmost all packages installed on my pi (chromium, vlc,....). It tells that it will install 21 packages and remove 171 !!
I don't want to uninstall everithing...
Is it the correct command to run ?

@ghost
Copy link
Author

ghost commented Oct 10, 2017

I succeed to compile the master version, and it seems to work better... Not sure to understand why.... The last release version have the same date as the master version...
I still have a problem, but I have it since I started to use motion. When an event movie is recorded, it last only few seconds, I can't see first and last seconds.... So for example if someone walk in front of the camera, the video doesn't contains anything... I tried the pre_capture and post_capture options without success. Any idea ?
Thanks

@jasaw
Copy link
Contributor

jasaw commented Oct 10, 2017

@fdiligeart Try adjusting minimum_motion_frames to some low number, like 5.

@tosiara
Copy link
Member

tosiara commented Oct 11, 2017

Please move discussion about general usage to the user mail list

@tosiara tosiara closed this as completed Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants