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. Manually Switching Streams in the WebView (Chris Sherry) 2. Re: Artefacts on video when detecting motion (L?vai) ---------------------------------------------------------------------- Message: 1 Date: Thu, 22 Aug 2019 17:10:51 +0000 From: Chris Sherry <cws4...@outlook.com> To: "motion-user@lists.sourceforge.net" <motion-user@lists.sourceforge.net> Subject: [Motion-user] Manually Switching Streams in the WebView Message-ID: <byapr14mb25508d113eeae81119f49b63ba...@byapr14mb2550.namprd14.prod.outlook.com> Content-Type: text/plain; charset="iso-8859-1" I would like to switch between streams in the web view manually and possibly automatically in the future based on a machine learning model's opinion of which stream is more interesting. My C is a little rusty. Can someone point me to where the stream is chosen for display in the live webstream (localhost:8081) display? I see there is a SIGUSR1 but I was reading other articles that this isn't really what I want to hook up to. Is that correct? Is it better to create a new event type and wire it up that way? This is for a sports scenario so I would also like to use this kind of user input to eventually capture an instant replay. Any thoughts on this kind of feature would be appreciated. -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 2 Date: Thu, 22 Aug 2019 17:42:16 +0000 From: L?vai, D?niel <l...@ecentrum.hu> To: tosiara <tosi...@gmail.com> Cc: Motion discussion list <motion-user@lists.sourceforge.net> Subject: Re: [Motion-user] Artefacts on video when detecting motion Message-ID: <46fpbfy-uGxrRA0aDWBw5GG2Ys1aGEZRsGR1yWzhJNq_k1L3kJw641B9GctA0YPRNY6op3g8Nltlyo5m4L35doKGJ9fpO4INWNUMyEswz6s=@ecentrum.hu> Content-Type: text/plain; charset="utf-8" Absolutely! I took the liberty and shared the folder with your e-mail address you use here. Dani ??????? Original Message ??????? On Thursday, 22 August 2019 14:00, tosiara <tosi...@gmail.com> wrote: > Can you share a test file produced by: > > ffmpeg -i rtsp://yourcamera/stream -v codec copy -an test.mp4 > > And also send the output of the ffmpeg command > Then run motion with -d 7 and upload the full log > > On Thu, Aug 22, 2019 at 2:39 PM L?vai, D?niel <l...@ecentrum.hu> wrote: > >> So what does ffmpeg do on it's own that this isn't happening there? >> Doesn't motion (1) use it internally? >> >> -- >> L?vai, D?niel >> >> -------- Eredeti ?zenet -------- >> Be 2019. aug. 22. 12:44, tosiara ?rta: >> >>> I'm afraid, then you won't be able to fix anything. Most usually broken >>> frames appear because of UDP coming out of order. Sometimes minimizing >>> key-frame intervals helps >>> >>> On Thu, Aug 22, 2019 at 1:04 PM L?vai, D?niel <l...@ecentrum.hu> wrote: >>> >>>> Unfortunately this camera doesn't provide a TCP endpoint, so I'm stuck >>>> with UDP. >>>> >>>> -- >>>> L?vai, D?niel >>>> >>>> -------- Eredeti ?zenet -------- >>>> Be 2019. aug. 22. 11:59, tosiara ?rta: >>>> >>>>> Try to set netcam_use_tcp on >>>>> >>>>> On Thu, Aug 22, 2019 at 12:53 PM L?vai, D?niel <l...@ecentrum.hu> wrote: >>>>> >>>>>> Hi list! >>>>>> >>>>>> I'm having this weird issue when using motion, that when motion is >>>>>> detected, it garbles the image [1][2] along the change (i.e.: motion). >>>>>> Also sometimes half or most of the screen is just missing. >>>>>> This is a Besder net camera, using RTSP UDP streaming. I've tried to >>>>>> fiddle with a couple of options regarding motion detection but to be >>>>>> honest I don't quite understand them (other than figuring out the >>>>>> threshold), so eventually I just left everything at the default setting. >>>>>> I've also tried to change the resolution (in motion(1) config) to a >>>>>> lower one (from 1080p to 720p, and even halving it to 540p), tried to >>>>>> lower the built-in movie quality setting, tried to use passthrough and >>>>>> tried to use the extpipe option to define my ffmpeg command line, but >>>>>> sadly the issue persists anyway. I even turned off movie recording at >>>>>> one point and just tried to save pictures, but every so often this >>>>>> happened on the pictures as well. >>>>>> >>>>>> Also I'm usually getting these errors every now and then: >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 34 >>>>>> packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 2 packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: error while decoding >>>>>> MB 61 55, bytestream -5 >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 22 >>>>>> packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: error while decoding >>>>>> MB 64 21, bytestream -6 >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 6 packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: error while decoding >>>>>> MB 61 13, bytestream -5 >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 114 >>>>>> packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: error while decoding >>>>>> MB 112 10, bytestream -10 >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 36 >>>>>> packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 37 >>>>>> packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: error while decoding >>>>>> MB 111 25, bytestream -5 >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 40 >>>>>> packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 32 >>>>>> packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 64 >>>>>> packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: left block >>>>>> unavailable for requested intra4x4 mode -1 >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: error while decoding >>>>>> MB 0 8, bytestream 3625 >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: max delay reached. >>>>>> need to consume packet >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: RTP: missed 35 >>>>>> packets >>>>>> [2:nc2:Eloszoba-BE] [INF] [ENC] ffmpeg_avcodec_log: error while decoding >>>>>> MB 25 44, bytestream -7 >>>>>> >>>>>> What I can tell otherwise, is that when recording from the same camera >>>>>> with ffmpeg(1) and encoding it with libx264 or even using -codec:v copy, >>>>>> there's nothing wrong with the picture. What I actually do currently is >>>>>> just running ffmpeg and slicing up the video files every 3 minutes or so: >>>>>> $ ffmpeg -hide_banner -loglevel warning -y -threads 0 -an -f rtsp -i >>>>>> rtsp://kamera-eloszoba/onvif1 -codec:v copy -reset_timestamps 1 -f >>>>>> segment -segment_time 00:03:00 -strftime 1 >>>>>> /mnt/storage/motion/Eloszoba-BESDER_6024PB_JW201-%Y%m%d@%H%M%S.mkv >>>>>> >>>>>> This produces good movie files, and not a trace of the quirky artefacts >>>>>> that are on the sample videos and image files I'm attaching. Also, when >>>>>> the picture is still on the video recorded by motion(1), there seems to >>>>>> be no problem and it seems the issue shows up with motion -- no pun >>>>>> intended :) >>>>>> >>>>>> Any insight would be greatly appreciated! >>>>>> >>>>>> Dani >>>>>> >>>>>> [1] https://www.youtube.com/watch?v=4Ra4fgFVPCY >>>>>> [2] https://www.youtube.com/watch?v=IaVbAmQh_8w >>>>>> >>>>>> p.s.: I'm attaching my config file, but unfortunately the default >>>>>> configuration file produces the same results: >>>>>> >>>>>> motion.conf: >>>>>> native_language off >>>>>> target_dir /mnt/motion/ >>>>>> videodevice /dev/video0 >>>>>> v4l2_palette 17 >>>>>> input -1 >>>>>> norm 0 >>>>>> frequency 0 >>>>>> auto_brightness 0 >>>>>> roundrobin_frames 1 >>>>>> roundrobin_skip 1 >>>>>> roundrobin_switchfilter off >>>>>> netcam_keepalive off >>>>>> netcam_tolerant_check off >>>>>> text_left %$ >>>>>> text_right %Y-%m-%d\n%T >>>>>> text_changes off >>>>>> text_event %Y%m%d%H%M%S >>>>>> emulate_motion off >>>>>> threshold 5000 >>>>>> threshold_maximum 0 >>>>>> threshold_tune on >>>>>> noise_level 16 >>>>>> noise_tune on >>>>>> smart_mask_speed 200 >>>>>> lightswitch_percent 0 >>>>>> lightswitch_frames 5 >>>>>> minimum_motion_frames 1 >>>>>> event_gap 10 >>>>>> pre_capture 3 >>>>>> post_capture 10 >>>>>> picture_output_motion off >>>>>> picture_filename %Y/%m/%d/%H/%$-%t-%Y%m%d-%H%M%S-%v-%q >>>>>> snapshot_filename %Y/%m/%d/%H/%$-%t-%Y%m%d-%H%M%S-%v-snapshot >>>>>> movie_output_motion off >>>>>> movie_filename %Y/%m/%d/%H/%$-%t-%Y%m%d-%H%M%S-%v >>>>>> timelapse_interval 0 >>>>>> timelapse_mode daily >>>>>> timelapse_fps 30 >>>>>> timelapse_codec mpg >>>>>> timelapse_filename %Y%m%d-timelapse >>>>>> webcontrol_port 8080 >>>>>> webcontrol_ipv6 off >>>>>> webcontrol_localhost on >>>>>> webcontrol_parms 0 >>>>>> webcontrol_interface 0 >>>>>> webcontrol_auth_method 0 >>>>>> webcontrol_tls off >>>>>> stream_port 8081 >>>>>> stream_localhost on >>>>>> stream_auth_method 0 >>>>>> stream_tls off >>>>>> stream_preview_scale 50 >>>>>> stream_preview_newline off >>>>>> stream_preview_method 1 >>>>>> stream_quality 50 >>>>>> stream_grey off >>>>>> stream_motion on >>>>>> stream_maxrate 10 >>>>>> database_type postgresql >>>>>> database_dbname motion >>>>>> database_host storage >>>>>> database_port 5432 >>>>>> database_user motion >>>>>> database_password <redacted> >>>>>> database_busy_timeout 15 >>>>>> sql_log_picture on >>>>>> sql_log_snapshot on >>>>>> sql_log_movie on >>>>>> sql_log_timelapse off >>>>>> sql_query_start INSERT INTO motion_events(event, camera_name, camera_id, >>>>>> event_id, event_timestamp, event_year, event_month, event_day, >>>>>> event_hour, event_minute, event_second, event_dir) values('start', '%$', >>>>>> %t, %v, '%Y-%m-%d %T', %Y, %m, %d, %H, %M, %S, >>>>>> '%$-%t-%Y%m%d-%H%M%S-%v'); -- >>>>>> sql_query_stop INSERT INTO motion_events(event, camera_name, camera_id, >>>>>> event_id, event_timestamp, event_year, event_month, event_day, >>>>>> event_hour, event_minute, event_second) values('stop', '%$', %t, %v, >>>>>> '%Y-%m-%d %T', %Y, %m, %d, %H, %M, %S); -- >>>>>> sql_query INSERT INTO motion_events(event, camera_name, camera_id, >>>>>> event_id, event_timestamp, event_year, event_month, event_day, >>>>>> event_hour, event_minute, event_second, filename, width, height, frame, >>>>>> file_type) values('media', '%$', %t, %v, '%Y-%m-%d %T', %Y, %m, %d, %H, >>>>>> %M, %S, '%f', %w, %h, %q, %n); -- >>>>>> track_type 0 >>>>>> track_auto off >>>>>> track_motorx 0 >>>>>> track_motorx_reverse off >>>>>> track_motory 0 >>>>>> track_motory_reverse off >>>>>> track_maxx 0 >>>>>> track_minx 0 >>>>>> track_maxy 0 >>>>>> track_miny 0 >>>>>> track_homex 128 >>>>>> track_homey 128 >>>>>> track_iomojo_id 0 >>>>>> track_step_angle_x 10 >>>>>> track_step_angle_y 10 >>>>>> track_move_wait 10 >>>>>> track_speed 255 >>>>>> track_stepsize 40 >>>>>> camera_dir /etc/motion/conf.d >>>>>> >>>>>> /etc/motion/conf.d: >>>>>> camera_name Eloszoba-BESDER_6024PB_JW201 >>>>>> camera_id 101 >>>>>> netcam_url rtsp://kamera-eloszoba/onvif1 >>>>>> netcam_use_tcp off >>>>>> on_event_start /etc/motion/motion_event.sh eloszoba event_start %v %$ %t >>>>>> %Y %m %d %H %M %S %q none 0 >>>>>> on_event_end /etc/motion/motion_event.sh eloszoba event_stop %v %$ %t %Y >>>>>> %m %d %H %M %S %q none 0 >>>>>> on_picture_save /etc/motion/motion_event.sh eloszoba picture_save %v %$ >>>>>> %t %Y %m %d %H %M %S %q %f %n >>>>>> on_movie_start /etc/motion/motion_event.sh eloszoba movie_start %v %$ %t >>>>>> %Y %m %d %H %M %S %q %f %n >>>>>> on_movie_end /etc/motion/motion_event.sh eloszoba movie_end %v %$ %t %Y >>>>>> %m %d %H %M %S %q %f %n >>>>>> width 960 >>>>>> height 540 >>>>>> text_scale 2 >>>>>> snapshot_interval 5 >>>>>> picture_output on >>>>>> picture_quality 75 >>>>>> picture_type jpeg >>>>>> picture_output_motion off >>>>>> movie_output on >>>>>> movie_output_motion off >>>>>> framerate 10 >>>>>> movie_max_time 60 >>>>>> movie_quality 0 >>>>>> movie_bps 750000 >>>>>> movie_codec mp4 >>>>>> movie_duplicate_frames off >>>>>> movie_passthrough off >>>>>> movie_extpipe_use off >>>>>> ;movie_extpipe /usr/bin/ffmpeg -y -threads 0 -an -f rawvideo -pix_fmt >>>>>> yuvj420p -framerate %fps -s:v %wx%h -i pipe:0 -codec:v libx264 -b:v 750k >>>>>> -preset:v ultrafast -f mp4 %f.mp4 >>>>>> >>>>>> -- >>>>>> L?vai, D?niel >>>>>> _______________________________________________ >>>>>> Motion-user mailing list >>>>>> Motion-user@lists.sourceforge.net >>>>>> https://lists.sourceforge.net/lists/listinfo/motion-user >>>>>> https://motion-project.github.io/ >>>>>> >>>>>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user -------------- 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 158, Issue 34 ********************************************