investigate looks like ffmpeg is nice

master
bel 2020-04-11 02:55:51 +00:00
commit b076269c5d
11 changed files with 397 additions and 0 deletions

0
ffmpeg/ffmpegs.log Normal file
View File

68
ffmpeg/log Normal file
View File

@ -0,0 +1,68 @@
ffmpeg version 4.2.2-1ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-3ubuntu1)
configuration: --prefix=/usr --extra-version=1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!
[h264 @ 0x555d65c14b80] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x555d65c14b80] decode_slice_header error
[h264 @ 0x555d65c14b80] no frame!

41
ffmpeg/run.sh Normal file
View File

@ -0,0 +1,41 @@
#! /bin/bash
echo to start: ${@:-83}
for i in "${@:-83}"; do
echo starting $i...
ffmpeg \
-threads 0 \
-nostdin \
-nostats \
-loglevel error \
-i rtsp://192.168.0.$i:8554/unicast \
-an \
-map 0 \
-force_key_frames "expr:gte(t,n_forced*9)" \
-f segment \
-segment_time ${SEG:-10} \
-segment_format mp4 \
-strftime 1 \
-minrate .05k \
-vcodec copy \
"/tmp/ffmpeg_cap/ffmpeg_capture-$i-%Y%m%d_%H%M%S.mp4" \
-vf "select=gt(scene\,0.003),setpts=N/(15*TB)" \
2>&1 \
< /dev/null \
| grep -vE 'RTP: missed|max delay reached. need to consume packet|decode_slice_header|no.frame|non.existing.PPS|Last.message.repeated' \
>> ./ffmpegs.log &
done
clean() {
kill -9 $(jobs -p)
}
trap clean EXIT ERR
for i in "${@:-83}"; do
if ! wait -n 1; then
echo "Something died" >&2
exit 1
fi
exit 0
done

21
motion/cameras/wyze0.conf Normal file
View File

@ -0,0 +1,21 @@
# /etc/motion/camera1.conf
#
# This config file was generated by motion 4.2.2
###########################################################
# Configuration options specific to camera 1
############################################################
# User defined name for the camera.
camera_name Wyze0
# Numeric identifier for the camera.
camera_id 0
# The full URL of the network camera stream.
netcam_url rtsp://192.168.0.83:8554/unicast
# Text to be overlayed in the lower left corner of images
#text_left WYZE0
height 1080
width 1920

21
motion/cameras/wyze1.conf Normal file
View File

@ -0,0 +1,21 @@
# /etc/motion/camera1.conf
#
# This config file was generated by motion 4.2.2
###########################################################
# Configuration options specific to camera 1
############################################################
# User defined name for the camera.
camera_name Wyze1
# Numeric identifier for the camera.
camera_id 1
# The full URL of the network camera stream.
netcam_url rtsp://192.168.0.96:8554/unicast
# Text to be overlayed in the lower left corner of images
#text_left WYZE1
height 720
width 1280

21
motion/cameras/wyze2.conf Normal file
View File

@ -0,0 +1,21 @@
# /etc/motion/camera1.conf
#
# This config file was generated by motion 4.2.2
###########################################################
# Configuration options specific to camera 1
############################################################
# User defined name for the camera.
camera_name Wyze2
# Numeric identifier for the camera.
camera_id 2
# The full URL of the network camera stream.
netcam_url rtsp://192.168.0.97:8554/unicast
# Text to be overlayed in the lower left corner of images
#text_left WYZE2
height 720
width 1280

21
motion/cameras/wyze3.conf Normal file
View File

@ -0,0 +1,21 @@
# /etc/motion/camera1.conf
#
# This config file was generated by motion 4.2.2
###########################################################
# Configuration options specific to camera 1
############################################################
# User defined name for the camera.
camera_name Wyze3
# Numeric identifier for the camera.
camera_id 3
# The full URL of the network camera stream.
netcam_url rtsp://192.168.0.98:8554/unicast
# Text to be overlayed in the lower left corner of images
#text_left WYZE3
height 720
width 1280

196
motion/motion.conf Normal file
View File

@ -0,0 +1,196 @@
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion 4.2.2
# Documentation: /usr/share/doc/motion/motion_guide.html
#
# This file contains only the basic configuration options to get a
# system working. There are many more options available. Please
# consult the documentation for the complete list of all options.
#
############################################################
# System control configuration parameters
############################################################
# Start in daemon (background) mode and release terminal.
daemon off
# Start in Setup-Mode, daemon disabled.
setup_mode off
# File to store the process ID.
; pid_file value
# File to write logs messages into. If not defined stderr and syslog is used.
log_file /var/log/motion/motion.log
# Level of log messages [1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL).
log_level 9
# Target directory for pictures, snapshots and movies
target_dir /var/lib/motion
# Video device (e.g. /dev/video0) to be used for capturing.
# videodevice /dev/video0
# Parameters to control video device. See motion_guide.html
; vid_control_params value
# The full URL of the network camera stream.
; netcam_url value
# Name of mmal camera (e.g. vc.ril.camera for pi camera).
; mmalcam_name value
# Camera control parameters (see raspivid/raspistill tool documentation)
; mmalcam_control_params value
############################################################
# Image Processing configuration parameters
############################################################
# Image width in pixels.
width 1920
# Image height in pixels.
height 1080
# Maximum number of frames to be captured per second.
framerate 25
# Text to be overlayed in the lower left corner of images
#text_left CAMERA1
# Text to be overlayed in the lower right corner of images.
#text_right %Y-%m-%d\n%T-%q
text_left
text_right
############################################################
# Motion detection configuration parameters
############################################################
# Always save pictures and movies even if there was no motion.
emulate_motion off
# Threshold for number of changed pixels that triggers motion.
threshold 1500
# Noise threshold for the motion detection.
; noise_level 32
# Despeckle the image using (E/e)rode or (D/d)ilate or (l)abel.
despeckle_filter EedDl
# Number of images that must contain motion to trigger an event.
minimum_motion_frames 1
# Gap in seconds of no motion detected that triggers the end of an event.
event_gap 60
# The number of pre-captured (buffered) pictures from before motion.
pre_capture 15
# Number of frames to capture after motion is no longer detected.
post_capture 10
############################################################
# Script execution configuration parameters
############################################################
# Command to be executed when an event starts.
; on_event_start value
# Command to be executed when an event ends.
; on_event_end value
# Command to be executed when a movie file is closed.
; on_movie_end value
############################################################
# Picture output configuration parameters
############################################################
# Output pictures when motion is detected
picture_output off
# File name(without extension) for pictures relative to target directory
picture_filename %Y%m%d%H%M%S-%q
############################################################
# Movie output configuration parameters
############################################################
# Create movies of motion events.
movie_output on
# Maximum length of movie in seconds.
movie_max_time 60
# The encoding quality of the movie. (0=use bitrate. 1=worst quality, 100=best)
movie_quality 45
# Container/Codec to used for the movie. See motion_guide.html
movie_codec mkv
# File name(without extension) for movies relative to target directory
movie_filename %t-%Y%m%d%H%M%S
############################################################
# Webcontrol configuration parameters
############################################################
# Port number used for the webcontrol.
webcontrol_port 5080
# Restrict webcontrol connections to the localhost.
webcontrol_localhost off
# Type of configuration options to allow via the webcontrol.
webcontrol_parms 0
############################################################
# Live stream configuration parameters
############################################################
# The port number for the live stream.
stream_port 5081
# Restrict stream connections to the localhost.
stream_localhost off
stream_quality 10
##############################################################
# Camera config files - One for each camera.
##############################################################
; camera /etc/motion/camera1.conf
; camera /etc/motion/camera2.conf
; camera /etc/motion/camera3.conf
; camera /etc/motion/camera4.conf
############
# Bel
############
emulate_motion on
threshold 1
framerate 5
pre_capture 0
post_capture 0
stream_port 0
#emulate_motion off
#threshold 1500
#framerate 15
#pre_capture 5
#post_capture 5
##############################################################
# Directory to read '.conf' files for cameras.
##############################################################
; camera_dir /etc/motion/conf.d
camera_dir /home/bel/Go/src/local/containers/cctv/motion/cameras

1
motion/run.sh Normal file
View File

@ -0,0 +1 @@
motion -n -c motion.conf

6
openrtsp/install.sh Normal file
View File

@ -0,0 +1,6 @@
sudo apt-get install libssl-dev
wget http://www.live555.com/liveMedia/public/live555-latest.tar.gz
tar -xzf live555-latest.tar.gz
cd live
./genMakefiles linux
sudo make install

1
openrtsp/run.sh Normal file
View File

@ -0,0 +1 @@
openRTSP -w 1920 -h 1080 -f 15 -D 1 -c -B 10000000 -b 10000000 -4 -Q -F /tmp/openrtsp/83 -d 28800 -P 10 -t rtsp://192.168.0.83:8554/unicast