Reputation: 7
I have my own ffmpeg exec command in the docker for writing rtsp stream by motion detection and make segments every 60 sec. But This command detect correctly only first 1-2 minutes, and without any errors ffmpeg does not detect motion. I'm using the latest version ffmpeg.
docker run -d -v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
--tmpfs /tmpfs:rw,noexec,nosuid,size=100M,mode=1777 \
-v /data/ARCHIVE:/ARCHIVE \
-e ARCHIVE_PATH="/ARCHIVE/Cam1" \
--restart=unless-stopped \
-d --name rec-Cam1 \
ffmpeg-recorder -loglevel debug -rtsp_transport udp \
-i rtsp://user:[email protected]:554 \
-pix_fmt yuv420p -threads 4 -fflags +igndts+discardcorrupt \
-use_wallclock_as_timestamps 1 -fps_mode cfr \
-filter_complex "[0:v]split=2[full][motion];[motion]crop=1270:710:0:10,select='gt(scene, 0.01)'[detect];[full][detect]overlay=0:10[output];" \
-map "[output]" \
-r 10 \
-c:v h264 \
-b:v 500k \
-maxrate 1000k \
-crf 20 \
-preset veryslow \
-f segment \
-segment_time 60 \
-reset_timestamps 1 \
-strftime 1 \
-reconnect_at_eof 1 \
-reconnect_streamed 1 \
-reconnect_delay_max 120 \
-movflags +faststart+write_colr+frag_keyframe \
/tmpfs/Cam1_%Y%m%d%H%M%S.mp4
This command uses tmpfs and then inotifywait copy ready file to the storage, image built - ffmpeg + inotify. This is par of my program. But main issue is that this configurftion does not work correctly.
Upvotes: -2
Views: 21